From: Trust me I am a Doctor <pillule@riseup.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 49275@debbugs.gnu.org
Subject: bug#49275: 28.0.50; [PATCH] improve-switch-to-prev-buffer-skip
Date: Thu, 08 Jul 2021 14:43:46 +0200 [thread overview]
Message-ID: <87sg0p55z1.fsf@riseup.net> (raw)
In-Reply-To: <14ae1372-39c7-c4b0-be94-6944df2724d4@gmx.at>
[-- Attachment #1: Type: text/plain, Size: 365 bytes --]
martin rudalics <rudalics@gmx.at> writes:
>> Conservatively I fix that by checking if 'switch-to-prev-buffer-skip'
>> is a function.
>
> What is the intended meaning of
>
> + (when (and skipped (not functionp switch-to-prev-buffer-skip-p))
>
> Did you mean
>
> + (when (and skipped (not (functionp switch-to-prev-buffer-skip)))
>
> here?
Duh. Indeed.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: improve switch to prev buffer skip with fixed parens --]
[-- Type: text/x-diff, Size: 1974 bytes --]
From 687725fa0ab9c5cae9a6c5efb7e24c14ce2c2a1f Mon Sep 17 00:00:00 2001
From: Trust me I am a doctor <pillule@riseup.net>
Date: Sun, 27 Jun 2021 02:24:27 +0200
Subject: [PATCH] Improve switch-to-prev-buffer-skip
* lisp/window.el (switch-to-prev-buffer): It was fall-backing to the
first skipped buffer, what I know is it is most probably undesirable
when 'switch-to-prev-buffer-skip' is a function. So we only do it when
it is not a function.
(switch-to-next-buffer): Tiddo, and also fix a bug where this function
was returning the same buffer, as it never should do.
---
lisp/window.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lisp/window.el b/lisp/window.el
index c0511bec4c..668bcf0d04 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4721,8 +4721,8 @@ switch-to-prev-buffer
window new-buffer (nth 1 entry) (nth 2 entry))
(throw 'found t)))))
- (when skipped
- ;; Show first skipped buffer.
+ (when (and skipped (not functionp switch-to-prev-buffer-skip-p))
+ ;; Show first skipped buffer, unless skip was a function.
(setq new-buffer skipped)
(set-window-buffer-start-and-point window new-buffer)))
@@ -4831,6 +4831,7 @@ switch-to-next-buffer
;; nreverse here!)
(dolist (entry (reverse (window-prev-buffers window)))
(when (and (not (eq new-buffer (car entry)))
+ (not (eq old-buffer (car entry)))
(setq new-buffer (car entry))
(or (buffer-live-p new-buffer)
(not (setq killed-buffers
@@ -4842,8 +4843,8 @@ switch-to-next-buffer
window new-buffer (nth 1 entry) (nth 2 entry))
(throw 'found t))))
- (when skipped
- ;; Show first skipped buffer.
+ (when (and skipped (not functionp switch-to-prev-buffer-skip-p))
+ ;; Show first skipped buffer, unless skip was a function.
(setq new-buffer skipped)
(set-window-buffer-start-and-point window new-buffer)))
--
2.20.1
[-- Attachment #3: Type: text/plain, Size: 4 bytes --]
--
next prev parent reply other threads:[~2021-07-08 12:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-29 15:56 bug#49275: 28.0.50; [PATCH] improve-switch-to-prev-buffer-skip Trust me I am a Doctor
2021-06-30 7:37 ` martin rudalics
2021-07-08 12:43 ` Trust me I am a Doctor [this message]
2021-07-18 8:27 ` martin rudalics
2021-07-21 9:59 ` Trust me I am a Doctor
2021-08-18 8:01 ` martin rudalics
2021-08-18 18:27 ` Trust me I am a Doctor
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sg0p55z1.fsf@riseup.net \
--to=pillule@riseup.net \
--cc=49275@debbugs.gnu.org \
--cc=rudalics@gmx.at \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).