From: F. Jason Park Date: Tue, 20 Aug 2024 05:40:25 +0000 (-0700) Subject: ; Rename internal variable in erc-fill X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=58dc0586c7a2958f2045ca81fe43c575825ef16d;p=emacs.git ; 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) (cherry picked from commit 8f326e0ba23f88ee5ef25fb89f6c7cedbdbda89e) --- diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index c863d99a339..986314822ba 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -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)) diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el index 4b602074ebb..711a2988302 100644 --- a/lisp/erc/erc-truncate.el +++ b/lisp/erc/erc-truncate.el @@ -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))) diff --git a/test/lisp/erc/erc-fill-tests.el b/test/lisp/erc/erc-fill-tests.el index f8bfc362085..b52a996f184 100644 --- a/test/lisp/erc/erc-fill-tests.el +++ b/test/lisp/erc/erc-fill-tests.el @@ -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) diff --git a/test/lisp/erc/resources/erc-d/erc-d-tests.el b/test/lisp/erc/resources/erc-d/erc-d-tests.el index dd0d5f8cb87..63d304907ea 100644 --- a/test/lisp/erc/resources/erc-d/erc-d-tests.el +++ b/test/lisp/erc/resources/erc-d/erc-d-tests.el @@ -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")) diff --git a/test/lisp/erc/resources/erc-d/resources/basic.eld b/test/lisp/erc/resources/erc-d/resources/basic.eld index 80e46d9a279..bbc8713d699 100644 --- a/test/lisp/erc/resources/erc-d/resources/basic.eld +++ b/test/lisp/erc/resources/erc-d/resources/basic.eld @@ -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")) diff --git a/test/lisp/erc/resources/erc-scenarios-common.el b/test/lisp/erc/resources/erc-scenarios-common.el index 0dc82c98d5f..130b0aae109 100644 --- a/test/lisp/erc/resources/erc-scenarios-common.el +++ b/test/lisp/erc/resources/erc-scenarios-common.el @@ -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)