jed-users mailing list

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

JWindows->Mark and bug


Hi John,

what's the meaning of JWindow->Mark and where is it different from the
fields of JWindow->buffer? Where is it used?

% grep '[>.]mark\>' svn/jed-upstream/src/*
ins.c:	     (*update_marks_fun) (&w->mark, line_num, n);
paste.c:	     while ((l != NULL) && (l != JWindow->mark.line)) l = l->next, n++;
paste.c:	       jed_init_mark (&JWindow->mark, 0);
screen.c:   JWindow->mark.line = CLine;
screen.c:   JWindow->mark.point = Point;
screen.c:   JWindow->mark.n = LineNum + CBuf->nup;
window.c:   jed_init_mark_for_buffer (&JWindow->mark, b, 0);
window.c:	     jed_init_mark (&w->mark, 0);
window.c:   jed_init_mark (&JWindow->mark,0);
window.c:   if (JWindow->mark.line != NULL)
window.c:     (void) jed_goto_mark (&JWindow->mark);
window.c:   jed_init_mark (&neew->mark, 0);

There are only assignments to mark, except in two lines in window.c. And
they cause a problem:

Run this code in jed, open a second window with a different buffer and go
there or switch to the mini buffer, e.g. open a file with ^XF. Then hit
#. The mark should go down, but doesn't do so.

#v+
sw2buf("Test");
loop (10) insert("Test\n");
bob();
push_visible_mark(); eol();

definekey("step_completion_window", "#", "Mini_Map");
setkey("step_completion_window", "#");

variable n = 0;

define step_completion_window()
{
    !if ( buffer_visible("Test") )
      return;

    variable obuf = whatbuf();

    % while (whatbuf() != "Test")
    %   otherwindow();
    setbuf("Test");

    % insert("$n"$); ++n;
    % insert_char('o');
    pop_mark(0);
    % insert_char('X');
    () = down(1);
    % insert_char('+');
    push_visible_mark(); eol();
    % insert_char('-');

    % while (whatbuf() != "Test")
    %   otherwindow();
    setbuf(obuf);
}
#v-

I think the problem is in window.c:other_window(). The mark that was
restored by switch_to_buffer() gets overwritten by jed_goto_mark(). The
editing point in the buffer does never change, because down() and
insert_char() do not change JWindow->mark, but this is restored by
other_window().

I've removed it from the code and I don't see any difference. So, what's
the meaning of Window_Type.mark?

Bye, Jörg.
-- 
“Programming today is a race between software engineers striving to
build bigger and better idiot—proof programs, and the Universe trying
to produce bigger and better idiots. So far, the Universe is winning.”
(Rich Cook)

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


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