emacs-devel
[Top][All Lists]
Advanced

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

Re: next-error-last-buffer


From: Juri Linkov
Subject: Re: next-error-last-buffer
Date: Mon, 24 May 2004 11:46:22 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

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/





reply via email to

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