From 9234627530cf2b766d7db64d2a059aaab11dc7b5 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 13 Nov 2012 08:40:07 +0100 Subject: [PATCH] Preserve window-point-insertion-type when copying window-point markers. (Bug#12588) * window.el (record-window-buffer) (display-buffer-record-window): When copying the markers to window-point preserve window-point-insertion-type. (Bug#12588) --- lisp/ChangeLog | 6 ++++++ lisp/window.el | 24 +++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 61d202433fc..c13ef1289f8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-11-13 Martin Rudalics + + * window.el (record-window-buffer) + (display-buffer-record-window): When copying the markers to + window-point preserve window-point-insertion-type. (Bug#12588) + 2012-11-13 Glenn Morris * emacs-lisp/eieio-datadebug.el (eieio-debug-methodinvoke): diff --git a/lisp/window.el b/lisp/window.el index 30ee622cfe6..6ea66d9d0a2 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -3049,8 +3049,10 @@ WINDOW must be a live window and defaults to the selected one." (set-marker (nth 2 entry) point)) ;; Make new markers. (list (copy-marker start) - (copy-marker point))))) - + (copy-marker + ;; Preserve window-point-insertion-type + ;; (Bug#12588). + point window-point-insertion-type))))) (set-window-prev-buffers window (cons entry (window-prev-buffers window)))))))) @@ -4555,13 +4557,17 @@ element is BUFFER." ;; If WINDOW has a quit-restore parameter, reset its car. (setcar (window-parameter window 'quit-restore) 'same)) ;; WINDOW shows another buffer. - (set-window-parameter - window 'quit-restore - (list 'other - ;; A quadruple of WINDOW's buffer, start, point and height. - (list (window-buffer window) (window-start window) - (window-point window) (window-total-size window)) - (selected-window) buffer)))) + (with-current-buffer (window-buffer window) + (set-window-parameter + window 'quit-restore + (list 'other + ;; A quadruple of WINDOW's buffer, start, point and height. + (list (current-buffer) (window-start window) + ;; Preserve window-point-insertion-type (Bug#12588). + (copy-marker + (window-point window) window-point-insertion-type) + (window-total-size window)) + (selected-window) buffer))))) ((eq type 'window) ;; WINDOW has been created on an existing frame. (set-window-parameter -- 2.39.2