emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master d82e73f: Handle 'unbound' like nil for 'window-poin


From: Martin Rudalics
Subject: [Emacs-diffs] master d82e73f: Handle 'unbound' like nil for 'window-point-insertion-type' (Bug#33871)
Date: Sun, 30 Dec 2018 09:48:32 -0500 (EST)

branch: master
commit d82e73f08f8c12cfa144ff2e404a65e8bff1ab2e
Author: Martin Rudalics <address@hidden>
Commit: Martin Rudalics <address@hidden>

    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).
---
 lisp/window.el |  4 ++--
 src/window.c   | 14 ++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/lisp/window.el b/lisp/window.el
index 50aec86..4e72d34 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."
                        (list (copy-marker start)
                              (copy-marker
                               ;; Preserve window-point-insertion-type
-                              ;; (Bug#12588).
+                              ;; (Bug#12855).
                               point window-point-insertion-type)))))
          (set-window-prev-buffers
           window (cons entry (window-prev-buffers window)))))
@@ -6110,7 +6110,7 @@ element is BUFFER."
         (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).
+                    ;; Preserve window-point-insertion-type (Bug#12855).
                     (copy-marker
                      (window-point window) window-point-insertion-type)
                     (if (window-combined-p window)
diff --git a/src/window.c b/src/window.c
index 14b3364..a69b115 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)
 
       if (BUFFERP (w->contents))
        {
+         Lisp_Object buffer_local_window_point_insertion_type
+           = (buffer_local_value (Qwindow_point_insertion_type, w->contents));
+         bool window_point_insertion_type
+           = (!NILP (buffer_local_window_point_insertion_type)
+              && !EQ (buffer_local_window_point_insertion_type, Qunbound));
+
          /* Save w's value of point in the window configuration.  If w
             is the selected window, then get the value of point from
             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)
          else
            p->pointm = Fcopy_marker (w->pointm, Qnil);
          p->old_pointm = Fcopy_marker (w->old_pointm, Qnil);
-         XMARKER (p->pointm)->insertion_type
-           = !NILP (buffer_local_value /* Don't signal error if void.  */
-                    (Qwindow_point_insertion_type, w->contents));
-         XMARKER (p->old_pointm)->insertion_type
-           = !NILP (buffer_local_value /* Don't signal error if void.  */
-                    (Qwindow_point_insertion_type, w->contents));
+         XMARKER (p->pointm)->insertion_type = window_point_insertion_type;
+         XMARKER (p->old_pointm)->insertion_type = window_point_insertion_type;
 
          p->start = Fcopy_marker (w->start, Qnil);
          p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]