aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2018-12-30 15:47:16 +0100
committerMartin Rudalics2018-12-30 15:47:16 +0100
commitd82e73f08f8c12cfa144ff2e404a65e8bff1ab2e (patch)
tree19d4f25859887f951ab165d541739f2eb7a7855e
parentb0e6ecfc33077fb2dce904d315c8ef24e3649c9b (diff)
downloademacs-d82e73f08f8c12cfa144ff2e404a65e8bff1ab2e.tar.gz
emacs-d82e73f08f8c12cfa144ff2e404a65e8bff1ab2e.zip
Handle 'unbound' like nil for 'window-point-insertion-type' (Bug#33871)
* src/window.c (save_window_save): When setting the marker insertion type of saved window points treat a buffer local value of 'unbound' for 'window-point-insertion-type' like nil (Bug#33871).
-rw-r--r--lisp/window.el4
-rw-r--r--src/window.c14
2 files changed, 10 insertions, 8 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 50aec86a427..4e72d343674 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4278,7 +4278,7 @@ WINDOW must be a live window and defaults to the selected one."
4278 (list (copy-marker start) 4278 (list (copy-marker start)
4279 (copy-marker 4279 (copy-marker
4280 ;; Preserve window-point-insertion-type 4280 ;; Preserve window-point-insertion-type
4281 ;; (Bug#12588). 4281 ;; (Bug#12855).
4282 point window-point-insertion-type))))) 4282 point window-point-insertion-type)))))
4283 (set-window-prev-buffers 4283 (set-window-prev-buffers
4284 window (cons entry (window-prev-buffers window))))) 4284 window (cons entry (window-prev-buffers window)))))
@@ -6110,7 +6110,7 @@ element is BUFFER."
6110 (list 'other 6110 (list 'other
6111 ;; A quadruple of WINDOW's buffer, start, point and height. 6111 ;; A quadruple of WINDOW's buffer, start, point and height.
6112 (list (current-buffer) (window-start window) 6112 (list (current-buffer) (window-start window)
6113 ;; Preserve window-point-insertion-type (Bug#12588). 6113 ;; Preserve window-point-insertion-type (Bug#12855).
6114 (copy-marker 6114 (copy-marker
6115 (window-point window) window-point-insertion-type) 6115 (window-point window) window-point-insertion-type)
6116 (if (window-combined-p window) 6116 (if (window-combined-p window)
diff --git a/src/window.c b/src/window.c
index 14b3364477e..a69b115e4bb 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6965,6 +6965,12 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, ptrdiff_t i)
6965 6965
6966 if (BUFFERP (w->contents)) 6966 if (BUFFERP (w->contents))
6967 { 6967 {
6968 Lisp_Object buffer_local_window_point_insertion_type
6969 = (buffer_local_value (Qwindow_point_insertion_type, w->contents));
6970 bool window_point_insertion_type
6971 = (!NILP (buffer_local_window_point_insertion_type)
6972 && !EQ (buffer_local_window_point_insertion_type, Qunbound));
6973
6968 /* Save w's value of point in the window configuration. If w 6974 /* Save w's value of point in the window configuration. If w
6969 is the selected window, then get the value of point from 6975 is the selected window, then get the value of point from
6970 the buffer; pointm is garbage in the selected window. */ 6976 the buffer; pointm is garbage in the selected window. */
@@ -6975,12 +6981,8 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, ptrdiff_t i)
6975 else 6981 else
6976 p->pointm = Fcopy_marker (w->pointm, Qnil); 6982 p->pointm = Fcopy_marker (w->pointm, Qnil);
6977 p->old_pointm = Fcopy_marker (w->old_pointm, Qnil); 6983 p->old_pointm = Fcopy_marker (w->old_pointm, Qnil);
6978 XMARKER (p->pointm)->insertion_type 6984 XMARKER (p->pointm)->insertion_type = window_point_insertion_type;
6979 = !NILP (buffer_local_value /* Don't signal error if void. */ 6985 XMARKER (p->old_pointm)->insertion_type = window_point_insertion_type;
6980 (Qwindow_point_insertion_type, w->contents));
6981 XMARKER (p->old_pointm)->insertion_type
6982 = !NILP (buffer_local_value /* Don't signal error if void. */
6983 (Qwindow_point_insertion_type, w->contents));
6984 6986
6985 p->start = Fcopy_marker (w->start, Qnil); 6987 p->start = Fcopy_marker (w->start, Qnil);
6986 p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil; 6988 p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil;