From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: next-error-last-buffer Date: Mon, 24 May 2004 11:46:22 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87u0y6jjq9.fsf@mail.jurta.org> References: <871xluig40.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085388575 17686 80.91.224.253 (24 May 2004 08:49:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 May 2004 08:49:35 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon May 24 10:49:23 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BSB99-00082B-00 for ; Mon, 24 May 2004 10:49:23 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BSB98-0002EN-00 for ; Mon, 24 May 2004 10:49:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BSB8i-00058N-AV for emacs-devel@quimby.gnus.org; Mon, 24 May 2004 04:48:56 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BSB8M-000555-An for emacs-devel@gnu.org; Mon, 24 May 2004 04:48:37 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BSB7j-0004v2-Oi for emacs-devel@gnu.org; Mon, 24 May 2004 04:48:29 -0400 Original-Received: from [66.33.219.19] (helo=spoon.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BSB7i-0004uW-RM for emacs-devel@gnu.org; Mon, 24 May 2004 04:47:55 -0400 Original-Received: from mail.jurta.org (80-235-39-186-dsl.mus.estpak.ee [80.235.39.186]) by spoon.dreamhost.com (Postfix) with ESMTP id 6E05413D8E0 for ; Mon, 24 May 2004 01:47:50 -0700 (PDT) Original-To: emacs-devel@gnu.org In-Reply-To: <871xluig40.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 09 May 2004 03:44:31 +0300") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23881 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23881 There is another problem related to `next-error-last-buffer'. When `next-error' visits a next-error capable buffer, it continues to visit places from that buffer instead of the original buffer from which it was found. This problem occurs when going through results in a grep buffer visits a patch file in diff mode. The next call of `next-error' continues to visit places from a patch file, not from a grep buffer. To avoid this problem, the variable `next-error-function' could be set to nil in a buffer visited by the latest call of `next-error-function'. Index: lisp/simple.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v retrieving revision 1.644 diff -u -r1.644 simple.el --- lisp/simple.el 23 May 2004 21:01:15 -0000 1.644 +++ lisp/simple.el 24 May 2004 07:32:57 -0000 @@ -168,7 +168,9 @@ (when (setq next-error-last-buffer (next-error-find-buffer)) ;; we know here that next-error-function is a valid symbol we can funcall (with-current-buffer next-error-last-buffer - (funcall next-error-function (prefix-numeric-value arg) reset)))) + (funcall next-error-function (prefix-numeric-value arg) reset) + ;; make buffers visited by next-error-function not a next-error capable + (if (and next-error-function (not (eq (current-buffer) next-error-last-buffer))) + (setq next-error-function nil))))) (defalias 'goto-next-locus 'next-error) (defalias 'next-match 'next-error) -- Juri Linkov http://www.jurta.org/emacs/