]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix regression in erc-keep-place-indicator-mode
authorF. Jason Park <jp@neverwas.me>
Sun, 31 Dec 2023 01:09:17 +0000 (17:09 -0800)
committerEshel Yaron <me@eshelyaron.com>
Tue, 2 Jan 2024 07:57:57 +0000 (08:57 +0100)
* lisp/erc/erc-goodies.el (erc-keep-place): Revert portion of
65735efdca0 "Improve multi-window erc-keep-place-indicator-mode" that
skipped modifying `window-prev-buffers' when the indicator's minor
mode was enabled.
* test/lisp/erc/erc-scenarios-keep-place-indicator.el: Modify test to
assert that point's place is preserved after switching away from a
buffer with the indicator enabled.
* test/lisp/erc/resources/keep-place/follow.eld: Update.
This feature was originally introduced by bug#59943.

(cherry picked from commit 4eda77ed335f982460f818ae1b8619cbd32ba77d)

lisp/erc/erc-goodies.el
test/lisp/erc/erc-scenarios-keep-place-indicator.el
test/lisp/erc/resources/keep-place/follow.eld

index 9d385b628dcb20d85e28c61380c9c15a37c47724..a0502a3b75c5354f28781d6748174b2c9fe66134 100644 (file)
@@ -471,8 +471,7 @@ For use with `keep-place-indicator' module."
     ;; if `switch-to-buffer-preserve-window-point' is set,
     ;; we cannot rely on point being saved, and must commit
     ;; it to window-prev-buffers.
-    (when (and switch-to-buffer-preserve-window-point
-               (not erc-keep-place-indicator-mode))
+    (when switch-to-buffer-preserve-window-point
       (dolist (frame (frame-list))
         (walk-window-tree
          (lambda (window)
index 7566288066e9da71c58e5476635be7be14f0574d..8ebef5404c1b87a9f21b22c1a8264a5eeb91bf7f 100644 (file)
         (switch-to-buffer "#spam") ; lower follows, speaks to sync
         (erc-scenarios-common-say "two")
         (funcall expect 10 "<bob> Cause they take")
+        (goto-char (point-max))
 
         ;; Upper switches back first, finds indicator gone.
         (other-window 1)
           (should (looking-back (rx "you can cog")))
           (should (= (pos-bol) (window-start)))
           (should (= (overlay-start erc--keep-place-indicator-overlay)
-                     (pos-bol))))))
+                     (pos-bol)))))
+
+      (ert-info ("description")
+        (erc-send-input-line "#spam" "three")
+        (save-excursion (erc-d-t-search-for 10 "Ready"))
+        (switch-to-buffer "#spam")
+        (should (< (point) erc-input-marker))))
 
     (erc-keep-place-mode -1)
     (erc-scrolltobottom-mode -1)))
index e857c17175d609da46b30af212ca144e2e038485..db9352d93bed0169efe4a902a5a4d4ad28fdf9ce 100644 (file)
@@ -71,3 +71,8 @@
 
  (0.03 ":bob!~u@2q6ysndq32az6.irc PRIVMSG #chan :alice: No egma, no riddle, no l'envoy; no salve in the mail, sir. O! sir, plantain, a plain plantain: no l'envoy, no l'envoy: no salve, sir, but a plantain.")
  (0.03 ":alice!~u@2q6ysndq32az6.irc PRIVMSG #chan :Signior Iachimo will not from it. Pray, let us follow 'em."))
+
+((privmsg 10 "PRIVMSG #spam :three")
+ ;; Third check point.
+ (0.01 ":bob!~u@2q6ysndq32az6.irc PRIVMSG #spam :Moved.")
+ (0.01 ":bob!~u@2q6ysndq32az6.irc PRIVMSG #chan :Ready."))