diff options
| author | Paul Eggert | 2017-12-15 09:07:52 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-12-15 09:08:27 -0800 |
| commit | e019c35df60a306750e1025db99c36701a726ecb (patch) | |
| tree | 1f7f35715aa20cbbb6c63ee1091161906f00980e /src/frame.c | |
| parent | d64b88da2fcc23cb0676fca382b4ddc7d1b68020 (diff) | |
| download | emacs-e019c35df60a306750e1025db99c36701a726ecb.tar.gz emacs-e019c35df60a306750e1025db99c36701a726ecb.zip | |
FOR_EACH_FRAME no longer assumes frame-list
This cleans up a recent fix related to Bug#29661.
Suggested by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2017-12/msg00544.html
* src/frame.c (next_frame, prev_frame, delete_frame):
Restore debugging checks that Vframe_list is non-nil,
as FOR_EACH_FRAME no longer has these checks.
(delete_frame): Remove no-longer-needed checks that Vframe_list is
non-nil, as FOR_EACH_FRAME no longer assumes that.
* src/frame.h (FOR_EACH_FRAME): Do not assume Vframe_list is non-nil.
Diffstat (limited to 'src/frame.c')
| -rw-r--r-- | src/frame.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/frame.c b/src/frame.c index 66d1b5c759e..63fa8abb7da 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1607,6 +1607,8 @@ next_frame (Lisp_Object frame, Lisp_Object minibuf) | |||
| 1607 | Lisp_Object f, tail; | 1607 | Lisp_Object f, tail; |
| 1608 | int passed = 0; | 1608 | int passed = 0; |
| 1609 | 1609 | ||
| 1610 | eassume (CONSP (Vframe_list)); | ||
| 1611 | |||
| 1610 | while (passed < 2) | 1612 | while (passed < 2) |
| 1611 | FOR_EACH_FRAME (tail, f) | 1613 | FOR_EACH_FRAME (tail, f) |
| 1612 | { | 1614 | { |
| @@ -1629,6 +1631,8 @@ prev_frame (Lisp_Object frame, Lisp_Object minibuf) | |||
| 1629 | { | 1631 | { |
| 1630 | Lisp_Object f, tail, prev = Qnil; | 1632 | Lisp_Object f, tail, prev = Qnil; |
| 1631 | 1633 | ||
| 1634 | eassume (CONSP (Vframe_list)); | ||
| 1635 | |||
| 1632 | FOR_EACH_FRAME (tail, f) | 1636 | FOR_EACH_FRAME (tail, f) |
| 1633 | { | 1637 | { |
| 1634 | if (EQ (frame, f) && !NILP (prev)) | 1638 | if (EQ (frame, f) && !NILP (prev)) |
| @@ -1914,6 +1918,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) | |||
| 1914 | if (f == sf) | 1918 | if (f == sf) |
| 1915 | { | 1919 | { |
| 1916 | Lisp_Object tail; | 1920 | Lisp_Object tail; |
| 1921 | eassume (CONSP (Vframe_list)); | ||
| 1917 | 1922 | ||
| 1918 | /* Look for another visible frame on the same terminal. | 1923 | /* Look for another visible frame on the same terminal. |
| 1919 | Do not call next_frame here because it may loop forever. | 1924 | Do not call next_frame here because it may loop forever. |
| @@ -2058,7 +2063,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) | |||
| 2058 | 2063 | ||
| 2059 | /* If we've deleted the last_nonminibuf_frame, then try to find | 2064 | /* If we've deleted the last_nonminibuf_frame, then try to find |
| 2060 | another one. */ | 2065 | another one. */ |
| 2061 | if (f == last_nonminibuf_frame && !NILP (Vframe_list)) | 2066 | if (f == last_nonminibuf_frame) |
| 2062 | { | 2067 | { |
| 2063 | last_nonminibuf_frame = 0; | 2068 | last_nonminibuf_frame = 0; |
| 2064 | 2069 | ||
| @@ -2076,7 +2081,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) | |||
| 2076 | 2081 | ||
| 2077 | /* If there's no other frame on the same kboard, get out of | 2082 | /* If there's no other frame on the same kboard, get out of |
| 2078 | single-kboard state if we're in it for this kboard. */ | 2083 | single-kboard state if we're in it for this kboard. */ |
| 2079 | if (kb != NULL && !NILP (Vframe_list)) | 2084 | if (kb != NULL) |
| 2080 | { | 2085 | { |
| 2081 | /* Some frame we found on the same kboard, or nil if there are none. */ | 2086 | /* Some frame we found on the same kboard, or nil if there are none. */ |
| 2082 | Lisp_Object frame_on_same_kboard = Qnil; | 2087 | Lisp_Object frame_on_same_kboard = Qnil; |
| @@ -2093,9 +2098,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) | |||
| 2093 | /* If we've deleted this keyboard's default_minibuffer_frame, try to | 2098 | /* If we've deleted this keyboard's default_minibuffer_frame, try to |
| 2094 | find another one. Prefer minibuffer-only frames, but also notice | 2099 | find another one. Prefer minibuffer-only frames, but also notice |
| 2095 | frames with other windows. */ | 2100 | frames with other windows. */ |
| 2096 | if (kb != NULL | 2101 | if (kb != NULL && EQ (frame, KVAR (kb, Vdefault_minibuffer_frame))) |
| 2097 | && EQ (frame, KVAR (kb, Vdefault_minibuffer_frame)) | ||
| 2098 | && !NILP (Vframe_list)) | ||
| 2099 | { | 2102 | { |
| 2100 | /* The last frame we saw with a minibuffer, minibuffer-only or not. */ | 2103 | /* The last frame we saw with a minibuffer, minibuffer-only or not. */ |
| 2101 | Lisp_Object frame_with_minibuf = Qnil; | 2104 | Lisp_Object frame_with_minibuf = Qnil; |