[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e51e43b7046 09/15: Fix buffer-mismatch bug in erc-scroll-to-botto
From: |
F. Jason Park |
Subject: |
master e51e43b7046 09/15: Fix buffer-mismatch bug in erc-scroll-to-bottom |
Date: |
Thu, 13 Jul 2023 21:50:42 -0400 (EDT) |
branch: master
commit e51e43b7046b56c58310854182a1d589ee4c770c
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
Fix buffer-mismatch bug in erc-scroll-to-bottom
* lisp/erc/erc-goodies.el (erc-scroll-to-bottom): Only `recenter' when
the selected window's buffer is current. Previously, the module
`scrolltobottom' signaled an "Error in `post-command-hook'" when a
user clicked a channel indicator in the mode line from a window
showing another ERC buffer.
* lisp/erc/erc-track.el (erc-track--switch-fallback-blockers): New
internal variable used by `erc-track--switch-buffer' in deciding
whether to set `erc-track-last-non-erc-buffer' to the current buffer.
(erc-track--switch-buffer): Consult list of `buffer-match-p'
conditions in `erc-track--switch-fallback-blockers' to decide whether
to set `erc-track-last-non-erc-buffer' to the current buffer.
(Bug#63595)
---
lisp/erc/erc-goodies.el | 1 +
lisp/erc/erc-track.el | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index afc05148506..96083de2c22 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -91,6 +91,7 @@ variable `erc-input-line-position'."
(save-restriction
(widen)
(when (and erc-insert-marker
+ (eq (current-buffer) (window-buffer))
;; we're editing a line. Scroll.
(> (point) erc-insert-marker))
(save-excursion
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 8101183ce3d..64e59a90047 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -923,13 +923,20 @@ is relative to `erc-track-switch-direction'."
(setq offset 0)))
(car (nth offset erc-modified-channels-alist))))
+(defvar erc-track--switch-fallback-blockers '((derived-mode . erc-mode))
+ "List of `buffer-match-p' conditions OR'd together.
+ERC sets `erc-track-last-non-erc-buffer' to the current buffer
+unless any passes.")
+
(defun erc-track--switch-buffer (fun arg)
(if (not erc-track-mode)
(message (concat "Enable the ERC track module if you want to use the"
" tracking minor mode"))
(cond (erc-modified-channels-alist
;; if we're not in erc-mode, set this buffer to return to
- (unless (eq major-mode 'erc-mode)
+ (unless (buffer-match-p (cons 'or
+ erc-track--switch-fallback-blockers)
+ (current-buffer))
(setq erc-track-last-non-erc-buffer (current-buffer)))
;; and jump to the next active channel
(if-let ((buf (erc-track-get-active-buffer arg))
- master updated (4e8d579f3da -> 2716dd13ced), F. Jason Park, 2023/07/13
- master 96785a80377 02/15: Deprecate erc-server-alist and erc-server-select, F. Jason Park, 2023/07/13
- master b95bb644ec2 01/15: Fix command-line parsing regression in erc-cmd-DCC, F. Jason Park, 2023/07/13
- master 4d6ed774fef 03/15: Respect existing invisibility props in erc-stamp, F. Jason Park, 2023/07/13
- master e51e43b7046 09/15: Fix buffer-mismatch bug in erc-scroll-to-bottom,
F. Jason Park <=
- master d45770e8d03 06/15: Optionally combine faces in erc-display-message, F. Jason Park, 2023/07/13
- master 08515350faf 13/15: Add mini modules bufbar and nickbar to ERC, F. Jason Park, 2023/07/13
- master 2716dd13ced 15/15: Decouple keep-place-indicator from global ERC module, F. Jason Park, 2023/07/13
- master 3c70e85d362 11/15: Add preset styles to erc-status-sidebar, F. Jason Park, 2023/07/13
- master b354b3a53bf 07/15: Allow custom display-buffer actions in ERC, F. Jason Park, 2023/07/13
- master 4f3d036957a 04/15: Simplify erc-button-add-nickname-buttons, F. Jason Park, 2023/07/13
- master 9bdc5c62049 08/15: Add module for colorizing nicknames to ERC, F. Jason Park, 2023/07/13
- master 30fe8703e60 10/15: Allow ERC's module toggles access to the prefix arg, F. Jason Park, 2023/07/13
- master 80e5e9ddc8d 14/15: Improve walkthrough and sample config in ERC manual, F. Jason Park, 2023/07/13
- master 6a96b862680 05/15: Add text props for CTCP messages and speakers in ERC, F. Jason Park, 2023/07/13