; Rename internal variable in erc-fill

* lisp/erc/erc-fill.el (erc--fill-wrap-scrolltobottom-exempt-p):
Rename to `erc-fill--wrap-scrolltobottom-exempt-p' so prefix matches
library and feature.
(erc-fill--wrap-ensure-dependencies): Update variable name.
* lisp/erc/erc-truncate.el (erc-max-buffer-size): Don't mention
`erc-insert-post-hook' in doc string because truncation now happens
elsewhere.
(erc-truncate-buffer-to-size): Update obsolete comment that describes
pre-5.5/Emacs 29 behavior.
* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--wrap-populate):
Update variable name.
* test/lisp/erc/resources/erc-d/erc-d-tests.el
(erc-d-u--canned-load-dialog--basic)
(erc-d-u--canned-load-dialog--intermingled)
(erc-d-u--rewrite-for-slow-mo): Timeouts.
* test/lisp/erc/resources/erc-d/resources/basic.eld: Timeouts.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--make-bindings): Use updated variable name.
(Bug#72736)
This commit is contained in:
F. Jason Park 2024-08-19 22:40:25 -07:00
parent dd4c67907e
commit 8f326e0ba2
6 changed files with 11 additions and 14 deletions

View file

@ -421,7 +421,7 @@ is 0, reset to value of `erc-fill-wrap-visual-keys'."
(defvar erc-scrolltobottom-mode)
(defvar erc-legacy-invisible-bounds-p)
(defvar erc--fill-wrap-scrolltobottom-exempt-p nil)
(defvar erc-fill--wrap-scrolltobottom-exempt-p nil)
(defun erc-fill--wrap-ensure-dependencies ()
(with-suppressed-warnings ((obsolete erc-legacy-invisible-bounds-p))
@ -435,7 +435,7 @@ is 0, reset to value of `erc-fill-wrap-visual-keys'."
(unless erc-fill-mode
(push 'fill missing-deps)
(erc-fill-mode +1))
(unless (or erc-scrolltobottom-mode erc--fill-wrap-scrolltobottom-exempt-p
(unless (or erc-scrolltobottom-mode erc-fill--wrap-scrolltobottom-exempt-p
(memq 'scrolltobottom erc-modules))
(push 'scrolltobottom missing-deps)
(erc-scrolltobottom-mode +1))

View file

@ -38,7 +38,7 @@
(defcustom erc-max-buffer-size 30000
"Maximum size in chars of each ERC buffer.
Used only when auto-truncation is enabled.
\(see `erc-truncate-buffer' and `erc-insert-post-hook')."
\(Also see `erc-truncate-buffer'.)"
:type 'integer)
;;;###autoload(autoload 'erc-truncate-mode "erc-truncate" nil t)
@ -92,10 +92,7 @@ present in `erc-modules'."
(error "erc-truncate-buffer-to-size: %S is not a buffer" buffer)))
(when (> (buffer-size buffer) (+ size 512))
(with-current-buffer buffer
;; Note that when erc-insert-post-hook runs, the buffer is
;; narrowed to the new message. So do this delicate widening.
;; I am not sure, I think this was not recommended behavior in
;; Emacs 20.
;; Though unneeded, widen anyway to preserve pre-5.5 behavior.
(save-restriction
(widen)
(let ((end (- erc-insert-marker size)))

View file

@ -52,7 +52,7 @@
(defun erc-fill-tests--wrap-populate (test)
(let ((original-window-buffer (window-buffer (selected-window)))
(erc--fill-wrap-scrolltobottom-exempt-p t)
(erc-fill--wrap-scrolltobottom-exempt-p t)
(erc-stamp--tz t)
(erc-fill-function 'erc-fill-wrap)
(pre-command-hook pre-command-hook)

View file

@ -50,7 +50,7 @@
'(0 ":irc.example.org 422 tester :MOTD File is missing"))))
(should (equal (car (funcall reap)) '(mode-user 5 "MODE tester +i")))
(should (equal (funcall reap)
'((mode-chan 1.2 "MODE #chan")
'((mode-chan 3.2 "MODE #chan")
(0.1 ":bob!~bob@example.org PRIVMSG #chan :hey"))))
;; See `define-error' site for `iter-end-of-sequence'
(ert-info ("EOB detected") (should-not (erc-d-u--read-dialog exes))))
@ -74,7 +74,7 @@
(should (equal (funcall user) '(user 0.2 "USER user 0 * :tester")))
(should (equal (funcall modu) '(mode-user 5 "MODE tester +i")))
(should (equal (funcall modc) '(mode-chan 1.2 "MODE #chan")))
(should (equal (funcall modc) '(mode-chan 3.2 "MODE #chan")))
(cl-loop repeat 8 do (funcall user)) ; skip a few
(should (equal (funcall user)
@ -147,7 +147,7 @@
(should (equal (car (funcall reap exes))
'(mode-user 15 "MODE tester +i")))
(should (equal (car (funcall reap exes))
'(mode-chan 11.2 "MODE #chan")))
'(mode-chan 13.2 "MODE #chan")))
(should-not (erc-d-u--read-dialog exes)))
(ert-info ("Rewrite for slowmo bounded")
@ -176,7 +176,7 @@
(should (equal (car (funcall reap exes-custom))
'(mode-user 10 "MODE tester +i")))
(should (equal (car (funcall reap exes-custom))
'(mode-chan 2.4 "MODE #chan")))
'(mode-chan 6.4 "MODE #chan")))
(should-not (erc-d-u--read-dialog exes-custom))))
(should-not (get-buffer "basic.eld"))

View file

@ -27,5 +27,5 @@
(0 ":irc.example.org 366 alice #chan :End of NAMES list"))
;; Some comment (to prevent regression)
((mode-chan 1.2 "MODE #chan")
((mode-chan 3.2 "MODE #chan")
(0.1 ":bob!~bob@example.org PRIVMSG #chan :hey"))

View file

@ -150,7 +150,7 @@
(timer-list (copy-sequence timer-list))
(timer-idle-list (copy-sequence timer-idle-list))
(erc-auth-source-parameters-join-function nil)
(erc--fill-wrap-scrolltobottom-exempt-p t)
(erc-fill--wrap-scrolltobottom-exempt-p t)
(erc-autojoin-channels-alist nil)
(erc-server-auto-reconnect nil)
(erc-after-connect nil)