diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 9d385b628dc..a0502a3b75c 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -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) diff --git a/test/lisp/erc/erc-scenarios-keep-place-indicator.el b/test/lisp/erc/erc-scenarios-keep-place-indicator.el index 7566288066e..8ebef5404c1 100644 --- a/test/lisp/erc/erc-scenarios-keep-place-indicator.el +++ b/test/lisp/erc/erc-scenarios-keep-place-indicator.el @@ -107,6 +107,7 @@ (switch-to-buffer "#spam") ; lower follows, speaks to sync (erc-scenarios-common-say "two") (funcall expect 10 " Cause they take") + (goto-char (point-max)) ;; Upper switches back first, finds indicator gone. (other-window 1) @@ -126,7 +127,13 @@ (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))) diff --git a/test/lisp/erc/resources/keep-place/follow.eld b/test/lisp/erc/resources/keep-place/follow.eld index e857c17175d..db9352d93be 100644 --- a/test/lisp/erc/resources/keep-place/follow.eld +++ b/test/lisp/erc/resources/keep-place/follow.eld @@ -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."))