mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-07 06:50:23 -08:00
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)
This commit is contained in:
parent
9bdc5c6204
commit
e51e43b704
2 changed files with 9 additions and 1 deletions
|
|
@ -91,6 +91,7 @@ variable `erc-input-line-position'."
|
||||||
(save-restriction
|
(save-restriction
|
||||||
(widen)
|
(widen)
|
||||||
(when (and erc-insert-marker
|
(when (and erc-insert-marker
|
||||||
|
(eq (current-buffer) (window-buffer))
|
||||||
;; we're editing a line. Scroll.
|
;; we're editing a line. Scroll.
|
||||||
(> (point) erc-insert-marker))
|
(> (point) erc-insert-marker))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
|
|
||||||
|
|
@ -923,13 +923,20 @@ is relative to `erc-track-switch-direction'."
|
||||||
(setq offset 0)))
|
(setq offset 0)))
|
||||||
(car (nth offset erc-modified-channels-alist))))
|
(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)
|
(defun erc-track--switch-buffer (fun arg)
|
||||||
(if (not erc-track-mode)
|
(if (not erc-track-mode)
|
||||||
(message (concat "Enable the ERC track module if you want to use the"
|
(message (concat "Enable the ERC track module if you want to use the"
|
||||||
" tracking minor mode"))
|
" tracking minor mode"))
|
||||||
(cond (erc-modified-channels-alist
|
(cond (erc-modified-channels-alist
|
||||||
;; if we're not in erc-mode, set this buffer to return to
|
;; 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)))
|
(setq erc-track-last-non-erc-buffer (current-buffer)))
|
||||||
;; and jump to the next active channel
|
;; and jump to the next active channel
|
||||||
(if-let ((buf (erc-track-get-active-buffer arg))
|
(if-let ((buf (erc-track-get-active-buffer arg))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue