emacs-diffs
[Top][All Lists]
Advanced

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

master 427d4b3: Minimise the time Vminibuffer_list is in an inconsistent


From: Alan Mackenzie
Subject: master 427d4b3: Minimise the time Vminibuffer_list is in an inconsistent state (src/minibuf.c)
Date: Sun, 31 Jan 2021 12:25:47 -0500 (EST)

branch: master
commit 427d4b3c69f9d2fd8473189564dc1e96b27937ff
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    Minimise the time Vminibuffer_list is in an inconsistent state 
(src/minibuf.c)
    
    src/minibuf.c (get_minibuffer): Move the XSETCAR which writes the new
    minibuffer into Vminibuffer_list to immediately after the MB's creation, so
    that the list is in a consistent state before calling fundamental-mode or
    minibuffer-inactive-mode.
---
 src/minibuf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/minibuf.c b/src/minibuf.c
index 0221f38..949c3d9 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -971,12 +971,12 @@ get_minibuffer (EMACS_INT depth)
       char name[sizeof name_fmt + INT_STRLEN_BOUND (EMACS_INT)];
       AUTO_STRING_WITH_LEN (lname, name, sprintf (name, name_fmt, depth));
       buf = Fget_buffer_create (lname, Qnil);
+      /* Do this before set_minibuffer_mode.  */
+      XSETCAR (tail, buf);
       set_minibuffer_mode (buf, depth);
       /* Although the buffer's name starts with a space, undo should be
         enabled in it.  */
       Fbuffer_enable_undo (buf);
-
-      XSETCAR (tail, buf);
     }
   else
     {



reply via email to

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