From ace25f206640b94d876d7d0966fcd9e512f81fc9 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 15 Oct 2020 09:37:44 +0200 Subject: Clarify the seq-reduce documentation * doc/lispref/sequences.texi (Sequence Functions): Ditto. * lisp/emacs-lisp/seq.el (seq-reduce): Clarify the order of the arguments (bug#43995). --- doc/lispref/sequences.texi | 9 +++++++-- lisp/emacs-lisp/seq.el | 8 +++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index ca52369bd0c..952834bd4e3 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -658,8 +658,13 @@ for which @var{predicate} returns @code{nil}. @var{initial-value} and the first element of @var{sequence}, then calling @var{function} with that result and the second element of @var{sequence}, then with that result and the third element of @var{sequence}, etc. -@var{function} should be a function of two arguments. If -@var{sequence} is empty, this returns @var{initial-value} without +@var{function} should be a function of two arguments. + +@var{function} is called with two arguments. @var{intial-value} +(and then the accumulated value) is used as the first argument, and +the elements in @var{sequence} are used for the second argument. + +If @var{sequence} is empty, this returns @var{initial-value} without calling @var{function}. @example diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index e3037a71901..42b145da2fd 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -336,9 +336,11 @@ list." "Reduce the function FUNCTION across SEQUENCE, starting with INITIAL-VALUE. Return the result of calling FUNCTION with INITIAL-VALUE and the -first element of SEQUENCE, then calling FUNCTION with that result and -the second element of SEQUENCE, then with that result and the third -element of SEQUENCE, etc. +first element of SEQUENCE, then calling FUNCTION with that result +and the second element of SEQUENCE, then with that result and the +third element of SEQUENCE, etc. FUNCTION will be called with +INITIAL-VALUE (and then the accumulated value) as the first +argument, and the elements from SEQUENCE as the second argument. If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called." (if (seq-empty-p sequence) -- cgit v1.2.1 From 72dd9119819eea5d8b1138e14a6010759f38366b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 16 Oct 2020 10:02:50 +0300 Subject: Fix posn-at-x-y in builds --without-x * src/keyboard.c (make_lispy_position): Don't exclude the window_or_frame = frame case from TTY-only builds. Reported by Jared Finder . * doc/lispref/commands.texi (Click Events): Document the format of POSITION in click events on the frame's internal border. --- doc/lispref/commands.texi | 48 +++++++++++++++++++++++++++++++++++++++++++---- src/keyboard.c | 7 ++++--- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 25f657404f3..aabaec256b4 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -1346,10 +1346,11 @@ button. @xref{Repeat Events}. To access the contents of a mouse position list in the @var{position} slot of a click event, you should typically use the -functions documented in @ref{Accessing Mouse}. The explicit format of -the list depends on where the click occurred. For clicks in the text -area, mode line, header line, tab line, or in the fringe or marginal -areas, the mouse position list has the form +functions documented in @ref{Accessing Mouse}. + +The explicit format of the list depends on where the click occurred. +For clicks in the text area, mode line, header line, tab line, or in +the fringe or marginal areas, the mouse position list has the form @example (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} @@ -1479,6 +1480,45 @@ handle), @code{up} (the up arrow at one end of the scroll bar), or @c The 'top', 'bottom', and 'end-scroll' codes don't seem to be used. @end table +For clicks on the frame's internal border (@pxref{Frame Layout}), +@var{position} has this form: + +@example + (@var{frame} @var{part} (@var{X} . @var{Y}) @var{timestamp}) +@end example + +@table @asis +@item @var{frame} +The frame whose internal border was clicked on. + +@item @var{part} +The part of the internal border which was clicked on. This can be one +of the following: + +@table @code +@item nil +The frame does not have an internal border. This usually happens on +text-mode frames. This can also happen on GUI frames with internal +border if the frame doesn't have its @code{drag-internal-border} +parameter (@pxref{Mouse Dragging Parameters}) set to a non-@code{nil} +value. + +@item left-edge +@itemx top-edge +@itemx right-edge +@itemx bottom-edge +The click was on the corresponding border at an offset of at least one +canonical character from the border's nearest corner. + +@item top-left-corner +@itemx top-right-corner +@itemx bottom-right-corner +@itemx bottom-left-corner +The click was on the corresponding corner of the internal border. +@end table + +@end table + @node Drag Events @subsection Drag Events diff --git a/src/keyboard.c b/src/keyboard.c index 5f136f03ecf..fca71985b92 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5246,7 +5246,6 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, extra_info))); } -#ifdef HAVE_WINDOW_SYSTEM else if (f) { /* Return mouse pixel coordinates here. */ @@ -5254,7 +5253,9 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, xret = XFIXNUM (x); yret = XFIXNUM (y); - if (FRAME_LIVE_P (f) +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (f) + && FRAME_LIVE_P (f) && FRAME_INTERNAL_BORDER_WIDTH (f) > 0 && !NILP (get_frame_param (f, Qdrag_internal_border))) { @@ -5263,8 +5264,8 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, posn = builtin_lisp_symbol (internal_border_parts[part]); } - } #endif + } else window_or_frame = Qnil; -- cgit v1.2.1 From c37b2a9b425a8f347015fb9404b512334b5a1f57 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 16 Oct 2020 10:17:42 +0300 Subject: Yet another fix for 'set-minibuffer-message' * lisp/minibuffer.el (set-minibuffer-message): Handle the case of separate minibuffer-only frame. Suggested by Gregory Heytings . --- lisp/minibuffer.el | 83 +++++++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 10cfca8d587..942fb019fe2 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -783,45 +783,50 @@ The text is displayed for `minibuffer-message-clear-timeout' seconds whichever comes first. Unlike `minibuffer-message', this function is called automatically via `set-message-function'." - (when (and (not noninteractive) - (window-live-p (active-minibuffer-window)) - (eq (window-frame) (window-frame (active-minibuffer-window)))) - (with-current-buffer (window-buffer (active-minibuffer-window)) - (setq message (if (string-match-p "\\` *\\[.+\\]\\'" message) - ;; Make sure we can put-text-property. - (copy-sequence message) - (concat " [" message "]"))) - (unless (or (null minibuffer-message-properties) - ;; Don't overwrite the face properties the caller has set - (text-properties-at 0 message)) - (setq message (apply #'propertize message minibuffer-message-properties))) - - (clear-minibuffer-message) - - (let ((ovpos (minibuffer--message-overlay-pos))) - (setq minibuffer-message-overlay - (make-overlay ovpos ovpos nil t t))) - (unless (zerop (length message)) - ;; The current C cursor code doesn't know to use the overlay's - ;; marker's stickiness to figure out whether to place the cursor - ;; before or after the string, so let's spoon-feed it the pos. - (put-text-property 0 1 'cursor 1 message)) - (overlay-put minibuffer-message-overlay 'after-string message) - ;; Make sure the overlay with the message is displayed before - ;; any other overlays in that position, in case they have - ;; resize-mini-windows set to nil and the other overlay strings - ;; are too long for the mini-window width. This makes sure the - ;; temporary message will always be visible. - (overlay-put minibuffer-message-overlay 'priority 1100) - - (when (numberp minibuffer-message-clear-timeout) - (setq minibuffer-message-timer - (run-with-timer minibuffer-message-clear-timeout nil - #'clear-minibuffer-message))) - - ;; Return `t' telling the caller that the message - ;; was handled specially by this function. - t))) + (let* ((minibuf-window (active-minibuffer-window)) + (minibuf-frame (and (window-live-p minibuf-window) + (window-frame minibuf-window)))) + (when (and (not noninteractive) + (window-live-p minibuf-window) + (or (eq (window-frame) minibuf-frame) + (eq (frame-parameter minibuf-frame 'minibuffer) 'only))) + (with-current-buffer (window-buffer minibuf-window) + (setq message (if (string-match-p "\\` *\\[.+\\]\\'" message) + ;; Make sure we can put-text-property. + (copy-sequence message) + (concat " [" message "]"))) + (unless (or (null minibuffer-message-properties) + ;; Don't overwrite the face properties the caller has set + (text-properties-at 0 message)) + (setq message + (apply #'propertize message minibuffer-message-properties))) + + (clear-minibuffer-message) + + (let ((ovpos (minibuffer--message-overlay-pos))) + (setq minibuffer-message-overlay + (make-overlay ovpos ovpos nil t t))) + (unless (zerop (length message)) + ;; The current C cursor code doesn't know to use the overlay's + ;; marker's stickiness to figure out whether to place the cursor + ;; before or after the string, so let's spoon-feed it the pos. + (put-text-property 0 1 'cursor 1 message)) + (overlay-put minibuffer-message-overlay 'after-string message) + ;; Make sure the overlay with the message is displayed before + ;; any other overlays in that position, in case they have + ;; resize-mini-windows set to nil and the other overlay strings + ;; are too long for the mini-window width. This makes sure the + ;; temporary message will always be visible. + (overlay-put minibuffer-message-overlay 'priority 1100) + + (when (numberp minibuffer-message-clear-timeout) + (setq minibuffer-message-timer + (run-with-timer minibuffer-message-clear-timeout nil + #'clear-minibuffer-message))) + + ;; Return `t' telling the caller that the message + ;; was handled specially by this function. + t)))) (setq set-message-function 'set-minibuffer-message) -- cgit v1.2.1 From 30305b543d04f5d888c6d63e314d596ca0f3baa8 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Fri, 16 Oct 2020 16:25:19 +0000 Subject: Make lisp/progmodes/js.el dependent on CC Mode in the Makefile. This will prevent version mismatches between compile time and runtime versions. This fixes bug #43037. * lisp/Makefile.in: Make js.el dependent on cc-{defs,engine,mode}.elc. --- lisp/Makefile.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 57527bb5afc..dac62cedec2 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -525,4 +525,10 @@ $(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \ $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \ $(lisp)/progmodes/cc-align.elc +# https://debbugs.gnu.org/43037 +# js.elc (like all modes using CC Mode's compile time macros) needs to +# be compiled under the same version of CC Mode it will run with. +$(lisp)/progmodes/js.elc: $(lisp)/progmodes/cc-defs.elc \ + $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-mode.elc + # Makefile ends here. -- cgit v1.2.1 From 65078e0a760950783e56f6765465a59bd642e8e4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 17 Oct 2020 10:32:26 +0300 Subject: * lisp/info.el (Info-hide-note-references): Doc fix. (Bug#44043) --- lisp/info.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/info.el b/lisp/info.el index 033a7a5cbb5..13c57bdcd13 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -305,10 +305,11 @@ when you hit the end of the current node." (defcustom Info-hide-note-references t "If non-nil, hide the tag and section reference in *note and * menu items. -If value is non-nil but not `hide', also replaces the \"*note\" with \"see\". -If value is non-nil but not t or `hide', the reference section is still shown. -nil completely disables this feature. If this is non-nil, you might -want to set `Info-refill-paragraphs'." +If the value is t, the default, replace \"*note\" with \"see\". +If the value is `hide', remove \"*note\" without replacing it with anything. +If value is non-nil, but not t or `hide', the reference section is still shown. +nil completely disables this feature, leaving the original \"*note\" visible. +If this is non-nil, you may wish setting `Info-refill-paragraphs' non-nil." :version "22.1" :type '(choice (const :tag "No hiding" nil) (const :tag "Replace tag and hide reference" t) -- cgit v1.2.1 From 47b8a1c7672608f220c3e0d7f6cedc63e6f63386 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 17 Oct 2020 02:06:26 +0200 Subject: * admin/release-process: Add note to update files from upstream. (cherry picked from commit 86dd9d12aa5a273da2efd4ce8c6e35ae343f1494) --- admin/release-process | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/admin/release-process b/admin/release-process index c3728b582f1..a1f42f05075 100644 --- a/admin/release-process +++ b/admin/release-process @@ -195,6 +195,17 @@ pt-br Rodrigo Real ru Alex Ott sk Miroslav Vaško +** Update some files from their upstream. + +Some files in Emacs are copies of data files maintained elsewhere. +Make sure that they are reasonably up-to-date. + +- etc/publicsuffix.txt +https://publicsuffix.org/list/public_suffix_list.dat + +- leim/SKK-DIC/SKK-JISYO.L +https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.L + * BUGS ** Check for modes which bind M-s that conflicts with a new global binding M-s -- cgit v1.2.1 From 18c0e20bea07cf4591b45800205cf25a927045f6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 17 Oct 2020 14:43:25 +0300 Subject: Improve documentation of 'Info-hide-note-references' in info.texi * doc/misc/info.texi (Help-Xref): Improve the wording. (Emacs Info Variables): Update the documentation of 'Info-hide-note-references'. (Bug#44043) --- doc/misc/info.texi | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/doc/misc/info.texi b/doc/misc/info.texi index f3ab305e350..85e04a99608 100644 --- a/doc/misc/info.texi +++ b/doc/misc/info.texi @@ -798,17 +798,17 @@ in cross references and node names if it differs from the current file, so you can always know that you are going to be switching to another manual and which one. -However, Emacs normally hides some other text in cross-references. -If you put your mouse over the cross reference, then the information -appearing in a separate box (tool tip) or in the echo area will show -the full cross-reference including the file name and the node name of -the cross reference. If you have a mouse, just leave it over the -cross reference @xref{Top,, Overview of Texinfo, texinfo, Texinfo: -The GNU Documentation Format}, and watch what happens. If you -always like to have that information visible without having to move -your mouse over the cross reference, use @kbd{M-x visible-mode}, or -set @code{Info-hide-note-references} to a value other than @code{t} -(@pxref{Emacs Info Variables}). +Emacs normally hides some text in cross references. If you put your +mouse over the cross reference, then the information appearing in a +separate box (tool tip) or in the echo area will show the full +cross reference, including the file name and the node name of the +cross reference if it leads to another file. If you have a mouse, +just leave it over the next cross reference: @xref{Top,, Overview of +Texinfo, texinfo, Texinfo: The GNU Documentation Format}, and watch +what happens. If you always like to have that information visible +without having to move your mouse over the cross reference, use +@kbd{M-x visible-mode}, or set @code{Info-hide-note-references} to a +value other than @code{t} (@pxref{Emacs Info Variables}). @format >> Now type @kbd{n} to learn more commands. @@ -1227,12 +1227,20 @@ not scroll with the rest of the buffer, making these links always visible. @item Info-hide-note-references -As explained in earlier nodes, the Emacs version of Info normally -hides some text in menus and cross-references. You can completely -disable this feature, by setting this option to @code{nil}. Setting -it to a value that is neither @code{nil} nor @code{t} produces an -intermediate behavior, hiding a limited amount of text, but showing -all text that could potentially be useful. +As explained in earlier sections, the Emacs version of Info normally +hides some text in menus and cross references. It also replaces the +@samp{*note} prefix of each cross reference with a more grammatically +correct @samp{see}. This is the effect of the default value of this +option, @code{t}. Setting this option to @code{nil} disables both +hiding and replacing of the original cross reference text, and Emacs +will then display them as they are in the Info file. If you set it to +the value @code{hide}, Emacs will do the same as with @code{t}, but +will also remove @samp{*note} without replacing it with anything. +Setting it to any other non-@code{nil} value produces an intermediate +behavior, hiding a limited amount of text, but showing all text that +could potentially be useful, including the name of the node that is +the target of the cross reference and its file if it is different from +the current file. @item Info-scroll-prefer-subnodes If set to a non-@code{nil} value, @key{SPC} and @key{BACKSPACE} (or -- cgit v1.2.1 From e29cace60afdab04ff20c4f4043a3ee64ec9d01d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 21 Oct 2020 18:32:51 +0300 Subject: Avoid rare crashes while producing line numbers * src/xdisp.c (maybe_produce_line_number): Prevent freeing of realized faces for as long as we are using lnum_face_id and current_lnum_face_id for producing glyphs. (Bug#44111) --- src/xdisp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index 6c401d0abb9..03dc4bec712 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22793,6 +22793,10 @@ maybe_produce_line_number (struct it *it) int lnum_face_id = merge_faces (it->w, Qline_number, 0, DEFAULT_FACE_ID); int current_lnum_face_id = merge_faces (it->w, Qline_number_current_line, 0, DEFAULT_FACE_ID); + /* From here onwards, we must prevent freeing realized faces, because + we are using the above 2 face IDs for the glyphs we produce. */ + bool save_free_realized_faces = inhibit_free_realized_faces; + inhibit_free_realized_faces = true; /* Compute point's line number if needed. */ if ((EQ (Vdisplay_line_numbers, Qrelative) || EQ (Vdisplay_line_numbers, Qvisual) @@ -22922,10 +22926,13 @@ maybe_produce_line_number (struct it *it) it->lnum_width = 0; it->lnum_pixel_width = 0; bidi_unshelve_cache (itdata, false); + inhibit_free_realized_faces = save_free_realized_faces; return; } } + inhibit_free_realized_faces = save_free_realized_faces; + /* Record the width in pixels we need for the line number display. */ it->lnum_pixel_width = tem_it.current_x; /* Copy the produced glyphs into IT's glyph_row. */ -- cgit v1.2.1 From 8b87ea6844036c168c9ec67dd318ee3ba8dab5ae Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 01:50:50 +0200 Subject: Recommend lexical-binding in Coding Conventions * doc/lispref/tips.texi (Coding Conventions, Library Headers): Recommend using lexical-binding. --- doc/lispref/tips.texi | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 5b09b2ccea6..4d6dcb9f834 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -94,6 +94,11 @@ it to Emacs. If and when we do, we can change the name easily enough. If one prefix is insufficient, your package can use two or three alternative common prefixes, so long as they make sense. +@item +We recommend enabling @code{lexical-binding} in new code, and +converting existing Emacs Lisp code to enable @code{lexical-binding} +if it doesn't already. @xref{Using Lexical Binding}. + @item Put a call to @code{provide} at the end of each separate Lisp file. @xref{Named Features}. @@ -963,7 +968,7 @@ explains these conventions, starting with an example: @smallexample @group -;;; foo.el --- Support for the Foo programming language +;;; foo.el --- Support for the Foo programming language -*- lexical-binding: t; -*- ;; Copyright (C) 2010-2020 Your Name @end group @@ -986,14 +991,14 @@ explains these conventions, starting with an example: The very first line should have this format: @example -;;; @var{filename} --- @var{description} +;;; @var{filename} --- @var{description} -*- lexical-binding: t; -*- @end example @noindent -The description should be contained in one line. If the file -needs a @samp{-*-} specification, put it after @var{description}. -If this would make the first line too long, use a Local Variables -section at the end of the file. +The description should be contained in one line. If the file needs to +set more variables in the @samp{-*-} specification, add it after +@code{lexical-binding}. If this would make the first line too long, use +a Local Variables section at the end of the file. The copyright notice usually lists your name (if you wrote the file). If you have an employer who claims copyright on your work, you -- cgit v1.2.1