From 4c8172467533d70e6d2d0a58f527a84a7e59355a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 20 Jun 2020 10:29:37 +0300 Subject: [PATCH 01/10] Don't use 'cl' functions in ELisp manual's examples * doc/lispref/control.texi (pcase Macro): Use 'cl-evenp' instead of 'evenp'. (Bug#41947) --- doc/lispref/control.texi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 01ae94ea7dd..d2419f415bf 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -959,8 +959,9 @@ For example, the following is invalid: @example @group +(require 'cl-lib) (pcase (read-number "Enter an integer: ") - ((or (and (pred evenp) + ((or (and (pred cl-evenp) e-num) ; @r{bind @code{e-num} to @var{expval}} o-num) ; @r{bind @code{o-num} to @var{expval}} (list e-num o-num))) @@ -984,9 +985,10 @@ Reworking the above example: @example @group +(require 'cl-lib) (pcase (read-number "Enter an integer: ") ((and num ; @r{line 1} - (or (and (pred evenp) ; @r{line 2} + (or (and (pred cl-evenp) ; @r{line 2} (let spin 'even)) ; @r{line 3} (let spin 'odd))) ; @r{line 4} (list spin num))) ; @r{line 5} From 11e3413cff3126c54244d0ecaface36ca518bf42 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Wed, 10 Jun 2020 23:41:39 -0400 Subject: [PATCH 02/10] Fix text about Lisp archives in the Emacs FQ * doc/misc/efaq.texi (Packages that do not come with Emacs): Warn about using Lisp archives other than GNU ELPA. --- doc/misc/efaq.texi | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index b2ed60b8d80..f948a489f44 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -3474,15 +3474,18 @@ You can browse the resulting @file{*Packages*} buffer to see what is available, and then Emacs can automatically download and install the packages that you select. @xref{Packages,,, emacs, The GNU Emacs Manual}. -There are other, non-GNU, Emacs Lisp package servers, including: -@uref{https://melpa.org, MELPA}; and -@uref{https://marmalade-repo.org, Marmalade}. To use additional -package servers, customize the @code{package-archives} variable. Be -aware that installing a package can run arbitrary code, so only add -sources that you trust. Also, packages hosted on non-GNU package -servers may encourage or require you to install and use non-free -software; for example, MELPA is known to host some packages that do -this. +There are other Emacs Lisp package archives. To use additional +archives, you can customize the @code{package-archives} variable. +Those archives have no affiliation with GNU Emacs, and we do not +monitor how they are maintained. They may pay close attention to +correctness and safety of the code, or they may give only cursory +attention. + +Also, packages hosted on these other archives may encourage or require +you to install and use other nonfree programs. Unless you can verify +that a package is free software, and that it functions without +installing any nonfree software, we recommend for your freedom's sake +that you stay away from it. The @uref{https://lists.gnu.org/mailman/listinfo/gnu-emacs-sources, GNU Emacs sources mailing list}, which is gatewayed to the From 368e140660bf84e91c67c87c47b73cfb2ea25476 Mon Sep 17 00:00:00 2001 From: Stephen Berman Date: Thu, 11 Jun 2020 23:10:07 +0200 Subject: [PATCH 03/10] Avoid crashes in 'defconst' * src/eval.c (Fdefconst): Verify that SYMBOL is a known symbol. (Bug#41817) --- src/eval.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/eval.c b/src/eval.c index 014905ce6df..16c36fa284c 100644 --- a/src/eval.c +++ b/src/eval.c @@ -831,6 +831,7 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) Lisp_Object sym, tem; sym = XCAR (args); + CHECK_SYMBOL (sym); Lisp_Object docstring = Qnil; if (!NILP (XCDR (XCDR (args)))) { From f61bff3ee9c4e01764825ac62502d81b5b1329d5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 20 Jun 2020 11:42:41 +0300 Subject: [PATCH 04/10] ; * CONTRIBUTE: Clarify the preferences for patch formatting. --- CONTRIBUTE | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTE b/CONTRIBUTE index d9502dcac35..26efbd7e5aa 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -53,9 +53,18 @@ archives. To email a patch you can use a shell command like 'git format-patch -1' to create a file, and then attach the file to your email. This nicely -packages the patch's commit message and changes. To send just one -such patch without additional remarks, you can use a command like -'git send-email --to=bug-gnu-emacs@gnu.org 0001-DESCRIPTION.patch'. +packages the patch's commit message and changes, and makes sure the +format and whitespace are not munged in transit by the various mail +agents. To send just one such patch without additional remarks, it is +also possible to use a command like + + git send-email --to=bug-gnu-emacs@gnu.org 0001-DESCRIPTION.patch'. + +However, we prefer the 'git format-patch' method with attachment, as +doing so delivers patches in the correct and easily-recognizable format +more reliably, and makes the job of applying the patches easier and less +error-prone. It also allows to send patches whose author is someone +other than the email sender. Once the cumulative amount of your submissions exceeds about 15 lines of non-trivial changes, we will need you to assign to the FSF the From c37de84845a4e666cadd209470b81c8abaa2fd77 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Mon, 22 Jun 2020 14:43:53 +0100 Subject: [PATCH 05/10] Fix typos and markup in fill column indicator docs * doc/emacs/display.texi (Displaying Boundaries): Fix typos and Texinfo markup. --- doc/emacs/display.texi | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index d98441b5ab8..849679ec501 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -1174,19 +1174,20 @@ right-to-left paragraphs. @findex display-fill-column-indicator-mode @findex global-display-fill-column-indicator-mode Emacs can add an indicator to display a fill column position. The -fill column indicator is a useful functionality specially in -prog-mode to indicate the position of an specific column. +fill column indicator is a useful functionality especially in +@code{prog-mode} to indicate the position of a specific column. - You can set the buffer-local variables @code{display-fill-column-indicator} -and @code{display-fill-column-indicator-character} to activate the -indicator and controls how the indicator looks. + You can set the buffer-local variables +@code{display-fill-column-indicator} and +@code{display-fill-column-indicator-character} to activate the +indicator and control how it looks, respectively. Alternatively you can type @w{@kbd{M-x display-fill-column-indicator-mode}} -or @w{@kbd{M-x global-display-fill-column-indicator-mode}} which enables the -indicator locally and globally respectively and also chooses the -character to use if none is set already. It is possible to use the -first one to activate the indicator in a hook or the second one to -enable it globally. +or @w{@kbd{M-x global-display-fill-column-indicator-mode}} which +enables the indicator locally or globally, respectively, and also +chooses the character to use if none is already set. It is possible +to use the first one to activate the indicator in a hook and the +second one to enable it globally. There are 2 buffer local variables and 1 face to customize this mode: @@ -1203,20 +1204,20 @@ Any other value disables the indicator. The default value is @code{t}. @item display-fill-column-indicator-character @vindex display-fill-column-indicator-character Specifies the character used for the indicator. This character can be -any valid char including unicode ones if the actual font supports -them. +any valid character including Unicode ones if the font supports them. When the mode is enabled through the functions @code{display-fill-column-indicator-mode} or @code{global-display-fill-column-indicator-mode}, the initialization -functions check if this variable is @code{non-nil}, otherwise the -initialization tries to set it to U+2502 or @samp{|}. +functions check if this variable is non-@code{nil}, otherwise the +initialization tries to set it to @code{U+2502} or @samp{|}. @item fill-column-indicator @vindex fill-column-indicator Specifies the face used to display the indicator. It inherits its -default values from shadow but without background color. To change -the indicator color you need to set only the foreground color of this face. +default values from the face @code{shadow} but without background +color. To change the indicator color you need only set the foreground +color of this face. @end table @vindex indicate-buffer-boundaries From dbfcdab83772a01a50ac819cc094c2cb3f8e089e Mon Sep 17 00:00:00 2001 From: Richard Copley Date: Thu, 18 Jun 2020 18:59:21 +0100 Subject: [PATCH 06/10] Unbreak 'reverse-region' * lisp/sort.el (reverse-region): Unbreak the function. It was broken by a fix for bug#39376. Copyright-paperwork-exempt: yes --- lisp/sort.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/sort.el b/lisp/sort.el index de0e1b9519d..f878db24a3c 100644 --- a/lisp/sort.el +++ b/lisp/sort.el @@ -554,9 +554,6 @@ is the one that ends before END." (if (> beg end) (let (mid) (setq mid end end beg beg mid))) (save-excursion - (when (or (< (line-beginning-position) beg) - (< end (line-end-position))) - (user-error "There are no full lines in the region")) ;; Put beg at the start of a line and end and the end of one -- ;; the largest possible region which fits this criteria. (goto-char beg) @@ -568,6 +565,8 @@ is the one that ends before END." ;; reversal; it isn't difficult to add it afterward. (or (and (eolp) (not (bolp))) (progn (forward-line -1) (end-of-line))) (setq end (point-marker)) + (when (<= end beg) + (user-error "There are no full lines in the region")) ;; The real work. This thing cranks through memory on large regions. (let (ll (do t)) (while do From 632b0119e1ac0b907af41e4e4b7b5ab7557a5d90 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Mon, 22 Jun 2020 18:14:48 +0100 Subject: [PATCH 07/10] Add Jansson dependency to Windows Build * admin/nt/dist-build/build-dep-zips.py: Add dependency --- admin/nt/dist-build/build-dep-zips.py | 1 + 1 file changed, 1 insertion(+) diff --git a/admin/nt/dist-build/build-dep-zips.py b/admin/nt/dist-build/build-dep-zips.py index 33ed4b6fb01..0e5f1ae1dc6 100755 --- a/admin/nt/dist-build/build-dep-zips.py +++ b/admin/nt/dist-build/build-dep-zips.py @@ -32,6 +32,7 @@ EMACS_MAJOR_VERSION="27" PKG_REQ='''mingw-w64-x86_64-giflib mingw-w64-x86_64-gnutls mingw-w64-x86_64-harfbuzz +mingw-w64-x86_64-jansson mingw-w64-x86_64-lcms2 mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libpng From 0c4b033670e34898414b7f9af263d21d0923c7d7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 26 Jun 2020 10:41:09 +0300 Subject: [PATCH 08/10] Improve documentation of Info node movement commands * lisp/info.el (Info-next, Info-prev, Info-forward-node) (Info-backward-node): More detailed descriptions of what each commands does with respect to child and parent nodes. (Bug#42050) --- lisp/info.el | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/info.el b/lisp/info.el index 7a11bb3ff9d..033a7a5cbb5 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2265,7 +2265,8 @@ End of submatch 0, 1, and 3 are the same, so you can safely concat." (match-string-no-properties 1))) (defun Info-next () - "Go to the next node of this node." + "Go to the \"next\" node, staying on the same hierarchical level. +This command doesn't descend into sub-nodes, like \\\\[Info-forward-node] does." (interactive) ;; In case another window is currently selected (save-window-excursion @@ -2273,7 +2274,8 @@ End of submatch 0, 1, and 3 are the same, so you can safely concat." (Info-goto-node (Info-extract-pointer "next")))) (defun Info-prev () - "Go to the previous node of this node." + "Go to the \"previous\" node, staying on the same hierarchical level. +This command doesn't go up to the parent node, like \\\\[Info-backward-node] does." (interactive) ;; In case another window is currently selected (save-window-excursion @@ -2887,7 +2889,13 @@ N is the digit argument used to invoke this command." (Info-goto-node (Info-extract-menu-counting nil))))) (defun Info-forward-node (&optional not-down not-up no-error) - "Go forward one node, considering all nodes as forming one sequence." + "Go forward one node, considering all nodes as forming one sequence. +Interactively, if the current node has sub-nodes, descend into the first +sub-node; otherwise go to the \"next\" node, if it exists, else go \"up\" +to the parent node. +When called from Lisp, NOT-DOWN non-nil means don't descend into sub-nodes, +NOT-UP non-nil means don't go to parent nodes, and NO-ERROR non-nil means +don't signal a user-error if there's no node to go to." (interactive) (goto-char (point-min)) (forward-line 1) @@ -2922,7 +2930,9 @@ N is the digit argument used to invoke this command." (t (user-error "No pointer forward from this node"))))) (defun Info-backward-node () - "Go backward one node, considering all nodes as forming one sequence." + "Go backward one node, considering all nodes as forming one sequence. +If the current node has a \"previous\" node, go to it, descending into its +last sub-node, if any; otherwise go \"up\" to the parent node." (interactive) (let ((prevnode (Info-extract-pointer "prev[ious]*" t)) (upnode (Info-extract-pointer "up" t)) From bb1a9481c9044ced4b7d7f514557b5ab508f80db Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 26 Jun 2020 15:01:44 +0300 Subject: [PATCH 09/10] Fix posn-at-point at beginning of a display string * src/xdisp.c (pos_visible_p): Account for the line-number width when the display string at CHARPOS ends in a newline. (Bug#42039) --- src/xdisp.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index a280b48de99..15901af9a8d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1782,6 +1782,12 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, start_display (&it3, w, top); if (start > CHARPOS (top)) move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS); + /* Record the line-number width, if any. Do it here, + before subsequent calls to start_display etc. reset + the line_number_produced_p flag, and we can no + longer be sure we are not using stale info. */ + int lnum_pixel_width = + it3.line_number_produced_p ? it3.lnum_pixel_width : 0; /* Move forward one more line if the position before the display string is a newline or if it is the rightmost character on a line that is @@ -1850,10 +1856,14 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, top_x = it3.current_x - it3.pixel_width; /* Account for line-number display, if IT3 still didn't. This can happen if START - 1 is the - first character on its display line. */ - if (!it3.line_number_produced_p - && it.line_number_produced_p) - top_x += it.lnum_pixel_width; + first or the last character on its display line. */ + if (!it3.line_number_produced_p) + { + if (lnum_pixel_width > 0) + top_x += lnum_pixel_width; + else if (it.line_number_produced_p) + top_x += it.lnum_pixel_width; + } /* Normally, we would exit the above loop because we found the display element whose character position is CHARPOS. For the contingency that we From 5280e118c07d738321f61b3f2bc3cd27a5ac8dbc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 26 Jun 2020 16:34:50 +0300 Subject: [PATCH 10/10] ; * src/xdisp.c (pos_visible_p): Fix last change. (Bug#42039) --- src/xdisp.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 15901af9a8d..2aff120bc80 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1782,12 +1782,6 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, start_display (&it3, w, top); if (start > CHARPOS (top)) move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS); - /* Record the line-number width, if any. Do it here, - before subsequent calls to start_display etc. reset - the line_number_produced_p flag, and we can no - longer be sure we are not using stale info. */ - int lnum_pixel_width = - it3.line_number_produced_p ? it3.lnum_pixel_width : 0; /* Move forward one more line if the position before the display string is a newline or if it is the rightmost character on a line that is @@ -1857,13 +1851,10 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, /* Account for line-number display, if IT3 still didn't. This can happen if START - 1 is the first or the last character on its display line. */ - if (!it3.line_number_produced_p) - { - if (lnum_pixel_width > 0) - top_x += lnum_pixel_width; - else if (it.line_number_produced_p) - top_x += it.lnum_pixel_width; - } + if (it3.lnum_pixel_width > 0) + top_x += it3.lnum_pixel_width; + else if (it.line_number_produced_p) + top_x += it.lnum_pixel_width; /* Normally, we would exit the above loop because we found the display element whose character position is CHARPOS. For the contingency that we