diff options
| author | Eli Zaretskii | 2024-08-24 06:04:51 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2024-08-24 06:04:51 -0400 |
| commit | 1e528f38b50b402614fb33a8e83ffb0998148bc7 (patch) | |
| tree | b5bb562e6d05a29900a4a4b9cde4c947c5e4c76a | |
| parent | 1d8ff948d7c1e920cdf425aa88a26dbf27152965 (diff) | |
| parent | 4211d85eec0858583bd9d35f8de9cd6e358d6c72 (diff) | |
| download | emacs-1e528f38b50b402614fb33a8e83ffb0998148bc7.tar.gz emacs-1e528f38b50b402614fb33a8e83ffb0998148bc7.zip | |
Merge from origin/emacs-30
4211d85eec0 Fix rare segfaults due to freed fontsets
44c26140b6e ; Fix infloop in checkdoc-next-docstring
25f53721668 Avoid putting a dead buffer in the minibuffer window (Bug...
| -rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 2 | ||||
| -rw-r--r-- | src/minibuf.c | 39 | ||||
| -rw-r--r-- | src/window.c | 3 | ||||
| -rw-r--r-- | src/xfaces.c | 5 |
4 files changed, 33 insertions, 16 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index d81eba7e85c..6865a02f9e8 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -989,7 +989,7 @@ buffer and save warnings in a separate buffer." | |||
| 989 | Return nil if there are no more doc strings." | 989 | Return nil if there are no more doc strings." |
| 990 | (let (found) | 990 | (let (found) |
| 991 | (while (and (not (setq found (checkdoc--next-docstring))) | 991 | (while (and (not (setq found (checkdoc--next-docstring))) |
| 992 | (beginning-of-defun -1))) | 992 | (beginning-of-defun-raw -1))) |
| 993 | found)) | 993 | found)) |
| 994 | 994 | ||
| 995 | (defun checkdoc--next-docstring () | 995 | (defun checkdoc--next-docstring () |
diff --git a/src/minibuf.c b/src/minibuf.c index 1dfee0a59c9..f16880011f7 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -63,7 +63,7 @@ Lisp_Object last_minibuf_string; | |||
| 63 | 63 | ||
| 64 | static Lisp_Object minibuf_prompt; | 64 | static Lisp_Object minibuf_prompt; |
| 65 | 65 | ||
| 66 | /* The frame containinug the most recently opened Minibuffer. This is | 66 | /* The frame containing the most recently opened minibuffer. This is |
| 67 | used only when `minibuffer-follows-selected-frame' is neither nil | 67 | used only when `minibuffer-follows-selected-frame' is neither nil |
| 68 | nor t. */ | 68 | nor t. */ |
| 69 | 69 | ||
| @@ -1248,27 +1248,36 @@ static void | |||
| 1248 | minibuffer_unwind (void) | 1248 | minibuffer_unwind (void) |
| 1249 | { | 1249 | { |
| 1250 | struct frame *f; | 1250 | struct frame *f; |
| 1251 | struct window *w; | ||
| 1252 | Lisp_Object window; | ||
| 1253 | Lisp_Object entry; | ||
| 1254 | 1251 | ||
| 1255 | if (NILP (exp_MB_frame)) return; /* "Can't happen." */ | 1252 | if (NILP (exp_MB_frame)) return; /* "Can't happen." */ |
| 1256 | f = XFRAME (exp_MB_frame); | 1253 | f = XFRAME (exp_MB_frame); |
| 1257 | window = f->minibuffer_window; | ||
| 1258 | w = XWINDOW (window); | ||
| 1259 | if (FRAME_LIVE_P (f)) | 1254 | if (FRAME_LIVE_P (f)) |
| 1260 | { | 1255 | { |
| 1261 | /* minibuf_window = sf->minibuffer_window; */ | 1256 | Lisp_Object window = f->minibuffer_window; |
| 1262 | if (!NILP (w->prev_buffers)) | 1257 | |
| 1258 | if (WINDOW_LIVE_P (window)) | ||
| 1263 | { | 1259 | { |
| 1264 | entry = Fcar (w->prev_buffers); | 1260 | struct window *w = XWINDOW (window); |
| 1265 | w->prev_buffers = Fcdr (w->prev_buffers); | 1261 | |
| 1266 | set_window_buffer (window, Fcar (entry), 0, 0); | 1262 | /* minibuf_window = sf->minibuffer_window; */ |
| 1267 | Fset_window_start (window, Fcar (Fcdr (entry)), Qnil); | 1263 | if (!NILP (w->prev_buffers)) |
| 1268 | Fset_window_point (window, Fcar (Fcdr (Fcdr (entry)))); | 1264 | { |
| 1265 | Lisp_Object entry = Fcar (w->prev_buffers); | ||
| 1266 | |||
| 1267 | if (BUFFERP (Fcar (entry)) | ||
| 1268 | && BUFFER_LIVE_P (XBUFFER (Fcar (entry)))) | ||
| 1269 | { | ||
| 1270 | wset_prev_buffers (w, Fcdr (w->prev_buffers)); | ||
| 1271 | set_window_buffer (window, Fcar (entry), 0, 0); | ||
| 1272 | Fset_window_start (window, Fcar (Fcdr (entry)), Qnil); | ||
| 1273 | Fset_window_point (window, Fcar (Fcdr (Fcdr (entry)))); | ||
| 1274 | } | ||
| 1275 | else | ||
| 1276 | set_window_buffer (window, nth_minibuffer (0), 0, 0); | ||
| 1277 | } | ||
| 1278 | else | ||
| 1279 | set_window_buffer (window, nth_minibuffer (0), 0, 0); | ||
| 1269 | } | 1280 | } |
| 1270 | else | ||
| 1271 | set_window_buffer (window, nth_minibuffer (0), 0, 0); | ||
| 1272 | } | 1281 | } |
| 1273 | } | 1282 | } |
| 1274 | 1283 | ||
diff --git a/src/window.c b/src/window.c index 559919689a3..35092ddd582 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4230,6 +4230,9 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, | |||
| 4230 | specpdl_ref count = SPECPDL_INDEX (); | 4230 | specpdl_ref count = SPECPDL_INDEX (); |
| 4231 | bool samebuf = EQ (buffer, w->contents); | 4231 | bool samebuf = EQ (buffer, w->contents); |
| 4232 | 4232 | ||
| 4233 | /* It's never OK to assign WINDOW a dead buffer. */ | ||
| 4234 | eassert (BUFFER_LIVE_P (b)); | ||
| 4235 | |||
| 4233 | wset_buffer (w, buffer); | 4236 | wset_buffer (w, buffer); |
| 4234 | 4237 | ||
| 4235 | if (EQ (window, selected_window)) | 4238 | if (EQ (window, selected_window)) |
diff --git a/src/xfaces.c b/src/xfaces.c index 684b6ccfac7..34897817ffd 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -736,6 +736,11 @@ recompute_basic_faces (struct frame *f) | |||
| 736 | clear_face_cache (false); | 736 | clear_face_cache (false); |
| 737 | if (!realize_basic_faces (f)) | 737 | if (!realize_basic_faces (f)) |
| 738 | emacs_abort (); | 738 | emacs_abort (); |
| 739 | /* Force complete face recalculation next time we use the display | ||
| 740 | code, because realize_basic_faces could free the fontset used | ||
| 741 | by non-ASCII faces corresponding to ASCII faces of the basic | ||
| 742 | faces, and attempt to use that fontset might segfault. */ | ||
| 743 | f->face_change = true; | ||
| 739 | } | 744 | } |
| 740 | } | 745 | } |
| 741 | 746 | ||