From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier " Newsgroups: gmane.emacs.help Subject: Re: strange behavior with multi-buffer Lisp code Date: 18 Nov 2002 11:17:08 -0500 Organization: Yale University Sender: help-gnu-emacs-admin@gnu.org Message-ID: <5lheeezwcb.fsf@rum.cs.yale.edu> References: <86heefd2h6.fsf@kronstadt.homeunix.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1037638103 23378 80.91.224.249 (18 Nov 2002 16:48:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 18 Nov 2002 16:48:23 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Dp4P-00064l-00 for ; Mon, 18 Nov 2002 17:48:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18DouR-0006FN-00; Mon, 18 Nov 2002 11:38:03 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news.ycc.yale.edu!rum.cs.yale.edu!rum.cs.yale.edu Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: rum.cs.yale.edu User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-Original-NNTP-Posting-Host: rum.cs.yale.edu X-Original-Trace: 18 Nov 2002 11:17:08 -0500, rum.cs.yale.edu Original-Xref: shelby.stanford.edu gnu.emacs.help:107154 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:3704 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:3704 >>>>> "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. Stefan