From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 40919@debbugs.gnu.org, tspiteri@ieee.org
Subject: bug#40919: 27.0.91; next-error-select-buffer does not always behave as documented
Date: Thu, 11 Jun 2020 02:05:39 +0300 [thread overview]
Message-ID: <87a71amsho.fsf@mail.linkov.net> (raw)
In-Reply-To: <caad2e39-13b8-fb14-9773-7a3beaa1be97@yandex.ru> (Dmitry Gutov's message of "Tue, 2 Jun 2020 02:04:39 +0300")
[-- Attachment #1: Type: text/plain, Size: 470 bytes --]
>> Tho I think in master next-error-find-buffer-function
>> should support a list of functions, so the user could customize
>> their order to arrange their priorities. Then they could be called
>> with run-hook-with-args-until-success.
>
> I suppose.
>
> We should perhaps wait and see if people do customize that variable at
> all. But the idea is solid.
Actually, people already want to customize it to a list (at least, I know one such user :)
So here is a patch:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: next-error-find-buffer-function-repeat.patch --]
[-- Type: text/x-diff, Size: 2518 bytes --]
diff --git a/lisp/simple.el b/lisp/simple.el
index 0fe8a1025c..646236879c 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -199,7 +199,7 @@ next-error-buffer-p
(and extra-test-inclusive
(funcall extra-test-inclusive))))))
-(defcustom next-error-find-buffer-function #'ignore
+(defcustom next-error-find-buffer-function '(ignore)
"Function called to find a `next-error' capable buffer.
This functions takes the same three arguments as the function
`next-error-find-buffer', and should return the buffer to be
@@ -208,12 +208,13 @@ next-error-find-buffer-function
If the function returns nil, `next-error-find-buffer' will
try to use the buffer it used previously, and failing that
all other buffers."
- :type '(choice (const :tag "No default" ignore)
- (const :tag "Single next-error capable buffer on selected frame"
- next-error-buffer-on-selected-frame)
- (const :tag "Current buffer if next-error capable and outside navigation"
- next-error-no-navigation-try-current)
- (function :tag "Other function"))
+ :type '(repeat
+ (choice (const :tag "No default" ignore)
+ (const :tag "Single next-error capable buffer on selected frame"
+ next-error-buffer-on-selected-frame)
+ (const :tag "Current buffer if next-error capable and outside navigation"
+ next-error-no-navigation-try-current)
+ (function :tag "Other function")))
:group 'next-error
:version "28.1")
@@ -275,9 +276,13 @@ next-error-find-buffer
that buffer is rejected."
(or
;; 1. If a customizable function returns a buffer, use it.
- (funcall next-error-find-buffer-function avoid-current
- extra-test-inclusive
- extra-test-exclusive)
+ (or (and (functionp next-error-find-buffer-function)
+ (funcall next-error-find-buffer-function avoid-current
+ extra-test-inclusive extra-test-exclusive))
+ (and (listp next-error-find-buffer-function)
+ (run-hook-with-args-until-success
+ 'next-error-find-buffer-function avoid-current
+ extra-test-inclusive extra-test-exclusive)))
;; 2. If next-error-last-buffer is an acceptable buffer, use that.
(if (and next-error-last-buffer
(next-error-buffer-p next-error-last-buffer avoid-current
next prev parent reply other threads:[~2020-06-10 23:05 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 1:51 bug#40919: 27.0.91; next-error-select-buffer does not always behave as documented Trevor Spiteri
2020-04-28 11:37 ` Trevor Spiteri
2020-04-28 23:40 ` Juri Linkov
2020-04-29 0:13 ` Trevor Spiteri
2020-04-29 20:38 ` Juri Linkov
2020-04-29 22:40 ` Trevor Spiteri
2020-04-30 20:14 ` Juri Linkov
2020-04-30 23:18 ` Trevor Spiteri
2020-05-02 23:38 ` Juri Linkov
2020-05-03 2:40 ` Eli Zaretskii
2020-05-03 22:36 ` Juri Linkov
2020-05-19 1:48 ` Dmitry Gutov
2020-05-19 22:21 ` Juri Linkov
2020-05-21 23:57 ` Dmitry Gutov
2020-05-23 22:24 ` Juri Linkov
2020-05-23 23:30 ` Dmitry Gutov
2020-05-24 21:48 ` Juri Linkov
2020-05-25 1:58 ` Dmitry Gutov
2020-05-25 15:17 ` Eli Zaretskii
2020-05-25 23:17 ` Dmitry Gutov
2020-05-26 16:06 ` Eli Zaretskii
2020-05-26 16:20 ` Dmitry Gutov
2020-05-26 16:33 ` Eli Zaretskii
2020-05-26 20:39 ` Dmitry Gutov
2020-05-27 19:18 ` Dmitry Gutov
2020-05-30 22:29 ` Juri Linkov
2020-06-10 23:03 ` Juri Linkov
2020-06-10 23:28 ` Dmitry Gutov
2020-06-11 13:11 ` Eli Zaretskii
2020-06-11 22:39 ` Juri Linkov
2020-06-12 7:06 ` Eli Zaretskii
2020-06-13 22:53 ` Juri Linkov
2020-06-14 23:17 ` Juri Linkov
2020-05-28 23:07 ` Dmitry Gutov
2020-06-01 22:41 ` Juri Linkov
2020-06-01 23:04 ` Dmitry Gutov
2020-06-10 23:05 ` Juri Linkov [this message]
2020-06-10 23:32 ` Dmitry Gutov
2020-06-11 22:43 ` Juri Linkov
2020-06-14 11:50 ` Dmitry Gutov
2020-06-14 23:15 ` Juri Linkov
2020-06-15 7:58 ` Dmitry Gutov
2020-06-24 23:38 ` Juri Linkov
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=87a71amsho.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=40919@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=tspiteri@ieee.org \
/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.