diff options
author | Jay Kamat <jaygkamat@gmail.com> | 2017-11-21 08:31:40 +0100 |
---|---|---|
committer | Martin Rudalics <rudalics@gmx.at> | 2017-11-21 08:31:40 +0100 |
commit | 37a3b4ea40095ea1d47ed61d6c0c6f9d32f79e60 (patch) | |
tree | a894a6444c212cebeb077ecf7d15cd7190a93c80 /lisp | |
parent | 6c312605bf6d89ae90df8e45121776226bf3550b (diff) | |
download | emacs-37a3b4ea40095ea1d47ed61d6c0c6f9d32f79e60.tar.gz |
Fix erc keep-place module with new defaults (Bug#29111)
* lisp/erc/erc-goodies.el (erc-keep-place): Allow erc
keep-place to continue working with
switch-to-buffer-preserve-window-point set to t, the new default.
Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/erc/erc-goodies.el | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index a655d48a6ac..8906da1e47d 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -147,7 +147,19 @@ Put this function on `erc-insert-post-hook' and/or `erc-send-post-hook'." (>= (point) erc-insert-marker)) (deactivate-mark) (goto-char (erc-beg-of-input-line)) - (forward-line -1))) + (forward-line -1) + ;; 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 switch-to-buffer-preserve-window-point + (dolist (frame (frame-list)) + (walk-window-tree + (lambda (window) + (let ((prev (assq (current-buffer) + (window-prev-buffers window)))) + (when prev + (setf (nth 2 prev) (point-marker))))) + frame nil 'nominibuf))))) ;;; Distinguish non-commands (defvar erc-noncommands-list '(erc-cmd-ME |