[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange behavior with multi-buffer Lisp code

From: Stefan Monnier <address@hidden>
Subject: Re: strange behavior with multi-buffer Lisp code
Date: 18 Nov 2002 11:17:08 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Ian" == Ian Zimmerman <> writes:
> This command is intended to be executed when the language buffer is in
> the selected window.  simple-ml-eval-marker is set earlier by the code
> that sends the chunk over to the interpreter.  What happens is that
> this _always jumps to the same error_, because even after the point is
> moved by the re-search-forward in the comint buffer, it is restored
> for some unfathomable (to me - not to you, I hope) reason when the
> command returns.

The notion of `point' is not unique for a buffer.  Each buffer can have
several `point's, one per window.  What happens is that whenever you leave
and re-enter the *Simple ML* buffer, the point is re-initialized from the
point corresponding to the cursor in the window where *Simple ML* is
displayed (or something like that: it's not completely clear how and when
those things happen).

I.e. you'll want to explicitly maintain a marker indicating up-to-where
you've processed the output.

Now as to what you're doing I'd recommend you simply use the mechanism
used for `next-error': put the *Simple ML* buffer in some kind of
compilation-minor-mode and set the compilation-error-regexp-alist
and friends.  Then C-x ` will magically work.

Check sml-mode to see how I've done it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]