bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#28864: 25.3.50; next-error-no-select does select


From: Tino Calancha
Subject: bug#28864: 25.3.50; next-error-no-select does select
Date: Sat, 21 Oct 2017 12:52:36 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 10/20/17 10:21 AM, Tino Calancha wrote:
>
>>> It kind of improves something, but the behavior is still wonky and
>>> counter-intuitive. Here are my steps:
>> I think I understand it now:
>> * change-log-mode sets 'next-error-last-buffer' to the current buffer (the
>>    ChangeLog source).
>>
>> We can restrict to not do that when we are calling 'next-error-no-select.
>> I think some people don't like to use this-command in such
>> situations; alternatively, we could use `change-log-mode-hook' but the patch
>> below is shorter and explicit.
>
> It's really a hack though, right? Maybe no major modes should set
> next-error-last-buffer by itself, no matter the current command.
That sounds better.
> I'd like to know what Juri thinks about this.
In case Juri think that change-log-mode should keep seting
next-error-last-buffer for other reasons we could just
bind next-error-last-buffer:
--8<-----------------------------cut here---------------start------------->8---
commit c7b2ecd19714055b89ce348c07bae1c88a3fdc0a
Author: Tino Calancha <tino.calancha@gmail.com>
Date:   Sat Oct 21 12:49:30 2017 +0900

    Dont select the source with next-error-no-select
    
    * lisp/simple.el (next-error): Bind `next-error-last-buffer'
    before call next-error-function (Bug#28864).

diff --git a/lisp/simple.el b/lisp/simple.el
index 5ef511ce0a..b321d324e7 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -281,7 +281,9 @@ next-error
   (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)
+       ;; next-error-function should not change `next-error-last-buffer' 
Bug#28864.
+      (let ((next-error-last-buffer next-error-last-buffer))
+        (funcall next-error-function (prefix-numeric-value arg) reset))
       (when next-error-recenter
         (recenter next-error-recenter))
       (run-hooks 'next-error-hook))))

--8<-----------------------------cut here---------------end--------------->8---





reply via email to

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