fix(irc): lui-autopaste & lui-track init

- enable-lui-track-bar was deprecated for enable-lui-track.
- Neither function has buffer-local side-effects, so they shouldn't be
  used with hooks.

Close: #7959
Co-authored-by: Thaodan <Thaodan@users.noreply.github.com>
This commit is contained in:
Henrik Lissner 2024-07-23 14:08:29 -04:00
parent f99a58906b
commit bb79a7603f
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -169,6 +169,9 @@ playback.")
(setq lui-time-stamp-format "%H:%M" (setq lui-time-stamp-format "%H:%M"
lui-time-stamp-position 'right-margin) lui-time-stamp-position 'right-margin)
(enable-lui-autopaste) ; prompt to use paste service for large pastes
(enable-lui-track) ; horizontal line marking last read message
(add-hook! 'lui-pre-output-hook (add-hook! 'lui-pre-output-hook
(defun +irc-truncate-nicks-h () (defun +irc-truncate-nicks-h ()
"Truncate long nicknames in chat output non-destructively." "Truncate long nicknames in chat output non-destructively."
@ -214,9 +217,6 @@ Courtesy of esh-mode.el"
(add-hook! 'lui-mode-hook (add-hook! 'lui-mode-hook
(add-hook 'pre-command-hook #'+irc-preinput-scroll-to-bottom-h nil t)) (add-hook 'pre-command-hook #'+irc-preinput-scroll-to-bottom-h nil t))
;; enable a horizontal line marking the last read message
(add-hook 'lui-mode-hook #'enable-lui-track-bar)
(add-hook! 'lui-mode-hook (add-hook! 'lui-mode-hook
(defun +irc-init-lui-margins-h () (defun +irc-init-lui-margins-h ()
(pcase lui-time-stamp-position (pcase lui-time-stamp-position
@ -231,7 +231,3 @@ Courtesy of esh-mode.el"
(use-package! lui-logging (use-package! lui-logging
:after lui :after lui
:config (enable-lui-logging)) :config (enable-lui-logging))
(use-package! lui-autopaste
:hook (circe-channel-mode . enable-lui-autopaste))