all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu>
Subject: Re: strange behavior with multi-buffer Lisp code
Date: 18 Nov 2002 11:17:08 -0500	[thread overview]
Message-ID: <5lheeezwcb.fsf@rum.cs.yale.edu> (raw)
In-Reply-To: 86heefd2h6.fsf@kronstadt.homeunix.net

>>>>> "Ian" == Ian Zimmerman <itz@speakeasy.org> 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.


        Stefan

  reply	other threads:[~2002-11-18 16:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-18  2:40 strange behavior with multi-buffer Lisp code Ian Zimmerman
2002-11-18 16:17 ` Stefan Monnier <foo@acm.com> [this message]
2002-11-18 18:31   ` Ian Zimmerman
2002-11-18 22:36     ` Stefan Monnier <foo@acm.com>
2002-11-19  0:38       ` Ian Zimmerman
2002-11-19  6:04         ` Ian Zimmerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5lheeezwcb.fsf@rum.cs.yale.edu \
    --to=monnier+gnu.emacs.help/news/@flint.cs.yale.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.