From 232c6465ce789f980da16063a865ac915b060ca4 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Thu, 14 Dec 2017 09:38:06 +0100 Subject: Fix doc-string of Fbuffer_list * src/buffer.c (Fbuffer_list): Fix doc-string. --- src/buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/buffer.c b/src/buffer.c index c6f9eb28e25..7ae889decf7 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -386,9 +386,9 @@ Value is nil if OBJECT is not a buffer or if it has been killed. */) } DEFUN ("buffer-list", Fbuffer_list, Sbuffer_list, 0, 1, 0, - doc: /* Return a list of all existing live buffers. -If the optional arg FRAME is a frame, we return the buffer list in the -proper order for that frame: the buffers show in FRAME come first, + doc: /* Return a list of all live buffers. +If the optional arg FRAME is a frame, return the buffer list in the +proper order for that frame: the buffers shown in FRAME come first, followed by the rest of the buffers. */) (Lisp_Object frame) { -- cgit v1.2.1 From aa66da220cdb6aaab5b347093fd40f0e1580913b Mon Sep 17 00:00:00 2001 From: Charles A. Roelli Date: Thu, 14 Dec 2017 20:53:35 +0100 Subject: * src/data.c (Fadd_variable_watcher): Doc fix. --- src/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/data.c b/src/data.c index d54c46d72bf..841a295fbee 100644 --- a/src/data.c +++ b/src/data.c @@ -1481,7 +1481,7 @@ SYMBOL is the variable being changed. NEWVAL is the value it will be changed to. OPERATION is a symbol representing the kind of change, one of: `set', `let', `unlet', `makunbound', and `defvaralias'. -WHERE is a buffer if the buffer-local value of the variable being +WHERE is a buffer if the buffer-local value of the variable is being changed, nil otherwise. All writes to aliases of SYMBOL will call WATCH-FUNCTION too. */) -- cgit v1.2.1 From 9bf66c6beec81927e960d31e78b7b3bad060c63e Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 15 Dec 2017 08:30:09 +0100 Subject: Don't run FOR_EACH_FRAME when there's no frame left (Bug#29961) This does not fix Bug#29961 but avoids that Emacs segfaults when trying to shut down because it lost connection to the X server. * src/dispnew.c (check_glyph_memory): * src/frame.c (delete_frame): Don't run FOR_EACH_FRAME when there's no frame left (Bug#29961). --- src/dispnew.c | 5 +++-- src/frame.c | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/dispnew.c b/src/dispnew.c index b0fc5c31fa1..d07864718c3 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -2260,8 +2260,9 @@ check_glyph_memory (void) Lisp_Object tail, frame; /* Free glyph memory for all frames. */ - FOR_EACH_FRAME (tail, frame) - free_glyphs (XFRAME (frame)); + if (!NILP (Vframe_list)) + FOR_EACH_FRAME (tail, frame) + free_glyphs (XFRAME (frame)); #if defined GLYPH_DEBUG && defined ENABLE_CHECKING /* Check that nothing is left allocated. */ diff --git a/src/frame.c b/src/frame.c index 5bafbeddcce..66d1b5c759e 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2058,7 +2058,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) /* If we've deleted the last_nonminibuf_frame, then try to find another one. */ - if (f == last_nonminibuf_frame) + if (f == last_nonminibuf_frame && !NILP (Vframe_list)) { last_nonminibuf_frame = 0; @@ -2076,7 +2076,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) /* If there's no other frame on the same kboard, get out of single-kboard state if we're in it for this kboard. */ - if (kb != NULL) + if (kb != NULL && !NILP (Vframe_list)) { /* Some frame we found on the same kboard, or nil if there are none. */ Lisp_Object frame_on_same_kboard = Qnil; @@ -2093,7 +2093,9 @@ delete_frame (Lisp_Object frame, Lisp_Object force) /* If we've deleted this keyboard's default_minibuffer_frame, try to find another one. Prefer minibuffer-only frames, but also notice frames with other windows. */ - if (kb != NULL && EQ (frame, KVAR (kb, Vdefault_minibuffer_frame))) + if (kb != NULL + && EQ (frame, KVAR (kb, Vdefault_minibuffer_frame)) + && !NILP (Vframe_list)) { /* The last frame we saw with a minibuffer, minibuffer-only or not. */ Lisp_Object frame_with_minibuf = Qnil; -- cgit v1.2.1 From d64b88da2fcc23cb0676fca382b4ddc7d1b68020 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 15 Dec 2017 12:30:30 +0200 Subject: * src/font.c (Ffont_info): Doc fix. (Bug#29682) --- src/font.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/font.c b/src/font.c index 441652b0951..69efd7d56d2 100644 --- a/src/font.c +++ b/src/font.c @@ -5055,10 +5055,10 @@ DEFUN ("font-info", Ffont_info, Sfont_info, 1, 2, 0, doc: /* Return information about a font named NAME on frame FRAME. If FRAME is omitted or nil, use the selected frame. -The returned value is a vector: +The returned value is a vector of 14 elements: [ OPENED-NAME FULL-NAME SIZE HEIGHT BASELINE-OFFSET RELATIVE-COMPOSE DEFAULT-ASCENT MAX-WIDTH ASCENT DESCENT SPACE-WIDTH AVERAGE-WIDTH - CAPABILITY ] + FILENAME CAPABILITY ] where OPENED-NAME is the name used for opening the font, FULL-NAME is the full name of the font, @@ -5068,12 +5068,12 @@ where RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling how to compose characters, MAX-WIDTH is the maximum advance width of the font, - ASCENT, DESCENT, SPACE-WIDTH, AVERAGE-WIDTH are metrics of the font - in pixels, + ASCENT, DESCENT, SPACE-WIDTH, and AVERAGE-WIDTH are metrics of + the font in pixels, FILENAME is the font file name, a string (or nil if the font backend doesn't provide a file name). CAPABILITY is a list whose first element is a symbol representing the - font format, one of x, opentype, truetype, type1, pcf, or bdf. + font format, one of `x', `opentype', `truetype', `type1', `pcf', or `bdf'. The remaining elements describe the details of the font capabilities, as follows: -- cgit v1.2.1 From e019c35df60a306750e1025db99c36701a726ecb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 15 Dec 2017 09:07:52 -0800 Subject: 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. --- src/frame.c | 13 ++++++++----- src/frame.h | 5 ++--- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') 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) Lisp_Object f, tail; int passed = 0; + eassume (CONSP (Vframe_list)); + while (passed < 2) FOR_EACH_FRAME (tail, f) { @@ -1629,6 +1631,8 @@ prev_frame (Lisp_Object frame, Lisp_Object minibuf) { Lisp_Object f, tail, prev = Qnil; + eassume (CONSP (Vframe_list)); + FOR_EACH_FRAME (tail, f) { if (EQ (frame, f) && !NILP (prev)) @@ -1914,6 +1918,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) if (f == sf) { Lisp_Object tail; + eassume (CONSP (Vframe_list)); /* Look for another visible frame on the same terminal. Do not call next_frame here because it may loop forever. @@ -2058,7 +2063,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) /* If we've deleted the last_nonminibuf_frame, then try to find another one. */ - if (f == last_nonminibuf_frame && !NILP (Vframe_list)) + if (f == last_nonminibuf_frame) { last_nonminibuf_frame = 0; @@ -2076,7 +2081,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) /* If there's no other frame on the same kboard, get out of single-kboard state if we're in it for this kboard. */ - if (kb != NULL && !NILP (Vframe_list)) + if (kb != NULL) { /* Some frame we found on the same kboard, or nil if there are none. */ Lisp_Object frame_on_same_kboard = Qnil; @@ -2093,9 +2098,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) /* If we've deleted this keyboard's default_minibuffer_frame, try to find another one. Prefer minibuffer-only frames, but also notice frames with other windows. */ - if (kb != NULL - && EQ (frame, KVAR (kb, Vdefault_minibuffer_frame)) - && !NILP (Vframe_list)) + if (kb != NULL && EQ (frame, KVAR (kb, Vdefault_minibuffer_frame))) { /* The last frame we saw with a minibuffer, minibuffer-only or not. */ Lisp_Object frame_with_minibuf = Qnil; diff --git a/src/frame.h b/src/frame.h index a3b77636435..a5d4e4fc88b 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1149,8 +1149,7 @@ default_pixels_per_inch_y (void) /* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a `for' loop which iterates over the elements of Vframe_list. The loop will set FRAME_VAR, a Lisp_Object, to each frame in - Vframe_list in succession and execute the statement. Vframe_list - should be nonempty, so the body is executed at least once. LIST_VAR + Vframe_list in succession and execute the statement. LIST_VAR should be a Lisp_Object too; it is used to iterate through the Vframe_list. Note that this macro walks over child frames and the tooltip frame as well. @@ -1160,7 +1159,7 @@ default_pixels_per_inch_y (void) something which executes the statement once. */ #define FOR_EACH_FRAME(list_var, frame_var) \ - for ((list_var) = (eassume (CONSP (Vframe_list)), Vframe_list); \ + for ((list_var) = Vframe_list; \ (CONSP (list_var) \ && (frame_var = XCAR (list_var), true)); \ list_var = XCDR (list_var)) -- cgit v1.2.1 From a1327bbc645efa42f14024785da4fed88aa7ec21 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 16 Dec 2017 10:14:29 +0100 Subject: Remove one more check that Vframe_list is non-nil * src/dispnew.c (check_glyph_memory): Remove no-longer-needed check that Vframe_list is non-nil, as FOR_EACH_FRAME no longer assumes that. --- src/dispnew.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/dispnew.c b/src/dispnew.c index d07864718c3..b0fc5c31fa1 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -2260,9 +2260,8 @@ check_glyph_memory (void) Lisp_Object tail, frame; /* Free glyph memory for all frames. */ - if (!NILP (Vframe_list)) - FOR_EACH_FRAME (tail, frame) - free_glyphs (XFRAME (frame)); + FOR_EACH_FRAME (tail, frame) + free_glyphs (XFRAME (frame)); #if defined GLYPH_DEBUG && defined ENABLE_CHECKING /* Check that nothing is left allocated. */ -- cgit v1.2.1 From 78908644131e70f20de28fed08ef4dc2878878a3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 16 Dec 2017 12:15:06 +0200 Subject: Improve documentation of 'invisible-p' * doc/lispref/display.texi (Invisible Text): Document the return value of 'invisible-p'. * src/xdisp.c (Finvisible_p): Rename the argument POS. Doc fix. (Bug#29721) --- src/xdisp.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 0a37013c560..7601e26a902 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25086,19 +25086,25 @@ invisible_prop (Lisp_Object propval, Lisp_Object list) } DEFUN ("invisible-p", Finvisible_p, Sinvisible_p, 1, 1, 0, - doc: /* Non-nil if the property makes the text invisible. -POS-OR-PROP can be a marker or number, in which case it is taken to be -a position in the current buffer and the value of the `invisible' property -is checked; or it can be some other value, which is then presumed to be the -value of the `invisible' property of the text of interest. -The non-nil value returned can be t for truly invisible text or something -else if the text is replaced by an ellipsis. */) - (Lisp_Object pos_or_prop) + doc: /* Non-nil if text properties at POS cause text there to be currently invisible. +POS should be a marker or a buffer position; the value of the `invisible' +property at that position in the current buffer is examined. +POS can also be the actual value of the `invisible' text or overlay +property of the text of interest, in which case the value itself is +examined. + +The non-nil value returned can be t for currently invisible text that is +entirely hidden on display, or some other non-nil, non-t value if the +text is replaced by an ellipsis. + +Note that whether text with `invisible' property is actually hidden on +display may depend on `buffer-invisibility-spec', which see. */) + (Lisp_Object pos) { Lisp_Object prop - = (NATNUMP (pos_or_prop) || MARKERP (pos_or_prop) - ? Fget_char_property (pos_or_prop, Qinvisible, Qnil) - : pos_or_prop); + = (NATNUMP (pos) || MARKERP (pos) + ? Fget_char_property (pos, Qinvisible, Qnil) + : pos); int invis = TEXT_PROP_MEANS_INVISIBLE (prop); return (invis == 0 ? Qnil : invis == 1 ? Qt -- cgit v1.2.1