Exempt text-scale-mode from erc-scrolltobottom-all
* lisp/erc/erc-goodies.el (erc--scrolltobottom-post-ignore-commands): New variable, a list of commands that should not trigger a re-scroll. (erc--scrolltobottom-on-post-command): Don't `recenter' when the current command appears in `erc--scrolltobottom-post-ignore-commands'. This fixes a bug that prevented managed recentering when disabling `text-scale-mode'. Thanks to Corwin Brust for reporting this. Note that this doesn't address any fill-related alignment issues involving `text-scale-mode'. Nor does it address likely problems involving the erroneous restoration of point after the insertion of invisible lines. (erc-keep-place-enable, erc-keep-place-mode): Adjust hook depth to fall within reserved interval. (erc-keep-place-indicator-enable, erc-keep-place-indicator-mode, erc--keep-place-indicator-on-global-module): Lower hook depth to fall within reserved interval. Note that this hook has a buffer-local value, so all members run after their global counterparts. (Bug#66073)
This commit is contained in:
parent
6135fec692
commit
06fb8b7620
1 changed files with 10 additions and 4 deletions
|
@ -128,6 +128,11 @@ may be nil, is the number of lines between `window-start' and
|
|||
That is, ERC recalculates the window's start instead of blindly
|
||||
restoring it.")
|
||||
|
||||
;; Unfortunately, this doesn't work when `erc-scrolltobottom-relaxed'
|
||||
;; is enabled (scaling up still moves the prompt).
|
||||
(defvar erc--scrolltobottom-post-ignore-commands '(text-scale-adjust)
|
||||
"Commands to skip instead of force-scroll on `post-command-hook'.")
|
||||
|
||||
(defvar erc--scrolltobottom-relaxed-skip-commands
|
||||
'(recenter-top-bottom scroll-down-command)
|
||||
"Commands exempt from triggering a stash and restore of `window-start'.
|
||||
|
@ -158,7 +163,8 @@ unnarrowed."
|
|||
((= (nth 2 found)
|
||||
(count-screen-lines (window-start) (point-max)))))
|
||||
(set-window-start (selected-window) (nth 1 found))
|
||||
(erc--scrolltobottom-confirm))
|
||||
(unless (memq this-command erc--scrolltobottom-post-ignore-commands)
|
||||
(erc--scrolltobottom-confirm)))
|
||||
(setq erc--scrolltobottom-window-info nil)))
|
||||
|
||||
(defun erc--scrolltobottom-on-pre-command-relaxed ()
|
||||
|
@ -372,7 +378,7 @@ Put this function on `erc-insert-post-hook' and/or `erc-send-post-hook'."
|
|||
;;;###autoload(autoload 'erc-keep-place-mode "erc-goodies" nil t)
|
||||
(define-erc-module keep-place nil
|
||||
"Leave point above un-viewed text in other channels."
|
||||
((add-hook 'erc-insert-pre-hook #'erc-keep-place 85))
|
||||
((add-hook 'erc-insert-pre-hook #'erc-keep-place 65))
|
||||
((remove-hook 'erc-insert-pre-hook #'erc-keep-place)))
|
||||
|
||||
(defcustom erc-keep-place-indicator-style t
|
||||
|
@ -467,7 +473,7 @@ and `keep-place-indicator' in different buffers."
|
|||
((memq 'keep-place erc-modules)
|
||||
(erc-keep-place-mode +1))
|
||||
;; Enable a local version of `keep-place-mode'.
|
||||
(t (add-hook 'erc-insert-pre-hook #'erc-keep-place 85 t)))
|
||||
(t (add-hook 'erc-insert-pre-hook #'erc-keep-place 65 t)))
|
||||
(if (pcase erc-keep-place-indicator-buffer-type
|
||||
('target erc--target)
|
||||
('server (not erc--target))
|
||||
|
@ -490,7 +496,7 @@ That is, ensure the local module can survive a user toggling the
|
|||
global one."
|
||||
(if erc-keep-place-mode
|
||||
(remove-hook 'erc-insert-pre-hook #'erc-keep-place t)
|
||||
(add-hook 'erc-insert-pre-hook #'erc-keep-place 85 t)))
|
||||
(add-hook 'erc-insert-pre-hook #'erc-keep-place 65 t)))
|
||||
|
||||
(defun erc-keep-place-move (pos)
|
||||
"Move keep-place indicator to current line or POS.
|
||||
|
|
Loading…
Add table
Reference in a new issue