- Subject: Re: pop_spot(0)
- From: "John E. Davis" <davis@xxxxxxxxxxxxx>
- Date: Tue, 8 Jul 2003 10:35:12 -0400
Klaus Schmid <klaus.schmid@xxxxxx> wrote:
>Reading the docs I fear I do not understand the user-mark mechanics
>completly, especially move_user_marks.
>
>define fun1( m){
>..
>move_user_mark( m) % m= create_user_mark() would not change the m in calling
>space
>..
>}
>
>m= create_user_mark();
>fun1( m);
>goto_user_mark( m); % m redefined in fun1()
>
>Is my understanding correct?
A user-mark is passed by reference. Hence, any changes to it by a
function will manifest itself outside the function. So
define fun1 (m)
{
move_user_mark (m);
}
eob ();
m = create_user_mark ();
bob ();
fun1 (m);
will result in the mark m associated with the beginnining of the
buffer (bob) and not the end of the buffer (eob) where it was
originally attached.
At the moment, there is no trivial way to get the line number
associated with the usermark. Until I add such support, I suggest
define user_mark_line (m)
{
push_spot ();
goto_user_mark (m);
variable l = what_line ();
pop_spot ();
return l;
}
Note: to get the buffer name associated with the user mark m, use
m.buffer_name. The next version of jed will support m.line and m.point.
I hope this helps clarify things.
Thanks,
--John
[2003 date index]
[2003 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]