jed-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [lists] Re: Odd problem with regions


On 11/10/2004 at 01:20 John E. Davis wrote:

>John Skilleter <john@xxxxxxxxxxxxxxxx> wrote:
>>I have a problem where the code will sometimes behave as if it is acting
>on
>>a region when one _isn't_ obviously defined and no region is visible.
I've
>
>  If you see an "m" as the 4th character on the status line, then the
>mark stack is not empty and a region exists.   The text between the
>top mark on the mark stack and the cursor will get highlighted as long
>as the mark has its visible attribute set.
>
>[...]
>>My question: What are invisible marks, and how do they get defined (and
>>why).
>
>  A mark that does not have the visible attribute is one that is
>generated by "push_mark".  The "push_visible_mark" and "set_mark_cmd"
>functions push a mark with the visible attribute.
>
>>Also, in the s-lang files in the lib directory, markp() is used far more
>>often than is_visible_mark() and often in a context where I would have
>>thought that is_visible_mark() should be used instead (unless I'm wrong
>>about what my code is doing) - so, my bonus question: Are many of these
>>uses of markp() wrong as well, or am I just confused?
>
>  If a function is specified to operate on a region (text between the
>top mark and the current position), then it should work on the region
>no matter how the region or the mark was created.  For this reason,
>markp is most often the appropriate choice.
>
>I hope this explanation helps a bit.
>Thanks,
>--John
>
>--------------------------
>To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
>the word "unsubscribe" in the message body.
>Need help? Email <jed-users-owner@xxxxxxxxxxx>.

That helps a lot, thanks very much. I'd completely overlooked the fact that
marks set with push_mark and set_mark_cmd were the same and both defined
regions, but one was invisible and the other visible. I suppose it is
because I use invisible marks in S-Lang and visible ones when editing, and
had not connected the two.

Silly(ish) me!

John Skilleter

-----------------------------------------
John Skilleter - john@xxxxxxxxxxxxxxxx & elsewhere
'DOS is best spelt backwards!'
    http://www.skilleter.org.uk
    http://www.roada.org.uk
-----------------------------------------



--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]