From 3fb69fad492dd40279cf29c4d417cc86a8018cc7 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Sat, 27 Aug 2022 10:50:57 +0300
Subject: [PATCH 001/915] Fix documentation of 'glyphless-char-display'
* src/xdisp.c (syms_of_xdisp): Doc fix.
(gui_produce_glyphs, lookup_glyphless_char_display): Fix
indentation.
---
src/xdisp.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index 9740e6b590e..a4881c48350 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7408,8 +7408,8 @@ lookup_glyphless_char_display (int c, struct it *it)
if (c >= 0)
{
glyphless_method = CHAR_TABLE_REF (Vglyphless_char_display, c);
- if (CONSP (glyphless_method))
- glyphless_method = FRAME_WINDOW_P (it->f)
+ if (CONSP (glyphless_method))
+ glyphless_method = FRAME_WINDOW_P (it->f)
? XCAR (glyphless_method)
: XCDR (glyphless_method);
}
@@ -30546,9 +30546,9 @@ gui_produce_glyphs (struct it *it)
/* When no suitable font is found, display this character by
the method specified in the first extra slot of
Vglyphless_char_display. */
- Lisp_Object acronym = lookup_glyphless_char_display (-1, it);
+ Lisp_Object acronym = lookup_glyphless_char_display (-1, it);
- eassert (it->what == IT_GLYPHLESS);
+ eassert (it->what == IT_GLYPHLESS);
produce_glyphless_glyph (it, true,
STRINGP (acronym) ? acronym : Qnil);
goto done;
@@ -35821,14 +35821,15 @@ Each element, if non-nil, should be one of the following:
`empty-box': display as an empty box
`thin-space': display as 1-pixel width space
`zero-width': don't display
+Any other value is interpreted as `empty-box'.
An element may also be a cons cell (GRAPHICAL . TEXT), which specifies the
display method for graphical terminals and text terminals respectively.
GRAPHICAL and TEXT should each have one of the values listed above.
-The char-table has one extra slot to control the display of a character for
-which no font is found. This slot only takes effect on graphical terminals.
-Its value should be an ASCII acronym string, `hex-code', `empty-box', or
-`thin-space'. The default is `empty-box'.
+The char-table has one extra slot to control the display of characters for
+which no font is found on graphical terminals, and characters that cannot
+be displayed by text-mode terminals. Its value should be an ASCII acronym
+string, `hex-code', `empty-box', or `thin-space'. The default is `hex-code'.
If a character has a non-nil entry in an active display table, the
display table takes effect; in this case, Emacs does not consult
From 72ae02377ebdc3105156be0e3dc0a9c53156599e Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Sat, 27 Aug 2022 14:24:59 +0300
Subject: [PATCH 002/915] ; * lisp/jit-lock.el (jit-lock-chunk-size): Doc fix.
---
lisp/jit-lock.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 20c12024745..6884313d1ba 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -45,9 +45,12 @@ Preserves the `buffer-modified-p' state of the current buffer."
:group 'font-lock)
(defcustom jit-lock-chunk-size 1500
- "Jit-lock fontifies chunks of at most this many characters at a time.
+ "Jit-lock asks to fontify chunks of at most this many characters at a time.
-This variable controls both `display-time' and stealth fontification.
+The actual size of the fontified chunk of text can be different,
+depending on what the `fontification-functions' actually decide to do.
+
+This variable controls both display-time and stealth fontifications.
The optimum value is a little over the typical number of buffer
characters which fit in a typical window."
From 195fcc932eea396c94483e0265b43a3c01147776 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Sun, 28 Aug 2022 08:40:25 +0300
Subject: [PATCH 003/915] Improve the documentation of glyphless-character
display
* lisp/international/characters.el (glyphless-char-display-control):
* src/xdisp.c (syms_of_xdisp) : Mention
the 'glyphless-char' face in the doc string.
* doc/lispref/display.texi (Glyphless Chars): Index
'glyphless-char' face.
---
doc/lispref/display.texi | 4 +++-
lisp/international/characters.el | 8 ++++++--
src/xdisp.c | 3 +++
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 9aed5b2d7ae..b068c7d08c6 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -7994,6 +7994,7 @@ Display with @var{graphical} on graphical displays, and with
must be one of the display methods described above.
@end table
+@vindex glyphless-char@r{ face}
@noindent
The @code{thin-space}, @code{empty-box}, @code{hex-code}, and
@acronym{ASCII} string display methods are drawn with the
@@ -8048,7 +8049,8 @@ emojis).
@item no-font
Characters for which there is no suitable font, or which cannot be
-encoded by the terminal's coding system.
+encoded by the terminal's coding system, or those for which the
+text-mode terminal has no glyphs.
@end table
@c FIXME: this can also be 'acronym', but that's not currently
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index 7d625d1382a..d845baa2ebf 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -1599,7 +1599,8 @@ GROUP must be one of these symbols:
presentation).
`no-font': characters for which no suitable font is found.
For character terminals, characters that cannot
- be encoded by `terminal-coding-system'.
+ be encoded by `terminal-coding-system' or those
+ for which the terminal has no glyphs.
METHOD must be one of these symbols:
`zero-width': don't display.
@@ -1613,7 +1614,10 @@ METHOD must be one of these symbols:
Do not set its value directly from Lisp; the value takes effect
only via a custom `:set'
function (`update-glyphless-char-display'), which updates
-`glyphless-char-display'."
+`glyphless-char-display'.
+
+See also the `glyphless-char' face, which is used to display the
+visual representation of these characters."
:version "28.1"
:type '(alist :key-type (symbol :tag "Character Group")
:value-type (symbol :tag "Display Method"))
diff --git a/src/xdisp.c b/src/xdisp.c
index a4881c48350..6d42105474f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -35831,6 +35831,9 @@ which no font is found on graphical terminals, and characters that cannot
be displayed by text-mode terminals. Its value should be an ASCII acronym
string, `hex-code', `empty-box', or `thin-space'. The default is `hex-code'.
+With the obvious exception of `zero-width', all the other representations
+are displayed using the face `glyphless-char'.
+
If a character has a non-nil entry in an active display table, the
display table takes effect; in this case, Emacs does not consult
`glyphless-char-display' at all. */);
From cc945ec0ed11c93a322db6258d47ea2746aead18 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Sun, 28 Aug 2022 08:51:09 +0300
Subject: [PATCH 004/915] ; Fix doc strings in latin1-disp.el
* lisp/international/latin1-disp.el (latin1-display-ucs-per-lynx)
(latin1-display): Doc fix.
---
lisp/international/latin1-disp.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/international/latin1-disp.el b/lisp/international/latin1-disp.el
index 96a54cc2128..c8c91fd5709 100644
--- a/lisp/international/latin1-disp.el
+++ b/lisp/international/latin1-disp.el
@@ -87,7 +87,7 @@ This option also treats some characters in the `mule-unicode-...'
charsets if you don't have a Unicode font with which to display them.
Setting this variable directly does not take effect;
-use either \\[customize] or the function `latin1-display'."
+use either \\[customize] or the command `latin1-display'."
:group 'latin1-display
:type 'boolean
:require 'latin1-disp
@@ -745,7 +745,7 @@ This uses the transliterations of the Lynx browser. The display isn't
changed if the display can render Unicode characters.
Setting this variable directly does not take effect;
-use either \\[customize] or the function `latin1-display'."
+use either \\[customize] or the command `latin1-display-ucs-per-lynx'."
:group 'latin1-display
:type 'boolean
:require 'latin1-disp
From d111b5b6512e1c8e932572906e2f516832e6c408 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Sun, 28 Aug 2022 14:42:07 +0300
Subject: [PATCH 005/915] * lisp/info.el (Info-mode): Support the Linux console
better.
---
lisp/info.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/info.el b/lisp/info.el
index 739116cceac..5655e3f3ce9 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -4446,9 +4446,12 @@ Advanced commands:
(setq buffer-read-only t)
(setq Info-tag-table-marker (make-marker))
(unless (or (display-multi-font-p)
- (coding-system-equal
- (coding-system-base (terminal-coding-system))
- 'utf-8))
+ (and (coding-system-equal
+ (coding-system-base (terminal-coding-system))
+ 'utf-8)
+ ;; The Linux console has limited character
+ ;; repertoire even when its encoding is UTF-8.
+ (not (equal (tty-type) "linux"))))
(dolist (elt info-symbols-and-replacements)
(let ((ch (car elt))
(repl (cdr elt)))
From c8c3cd3b08c468a8bc2c93fefaaf1c6f819a0d88 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Sun, 28 Aug 2022 17:40:49 +0300
Subject: [PATCH 006/915] ; Fix docs of glyphless-character display
* etc/NEWS: Update "glyphless character" entries.
* doc/lispref/display.texi (Glyphless Chars): The extra slot of
the char-table can now use a cons cell.
---
doc/lispref/display.texi | 2 +-
etc/NEWS | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index a56f467e0b5..db58cd14c63 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -8563,7 +8563,7 @@ square brackets, @samp{[]}.
The char-table has one extra slot, which determines how to display any
character that cannot be displayed with any available font, or cannot
be encoded by the terminal's coding system. Its value should be one
-of the above display methods, except @code{zero-width} or a cons cell.
+of the above display methods, except @code{zero-width}.
If a character has a non-@code{nil} entry in an active display table,
the display table takes effect; in this case, Emacs does not consult
diff --git a/etc/NEWS b/etc/NEWS
index 1317cd01283..f337381dd44 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1532,11 +1532,13 @@ completion, and adds the Emoji into the search string.
This allows an easy way to toggle seeing all glyphless characters in
the current buffer.
++++
*** The extra slot of 'glyphless-char-display' can now have cons values.
The extra slot of the 'glyphless-char-display' char-table can now have
values that are cons cells, specifying separate values for text-mode
and GUI terminals.
+---
*** "Replacement character" feature for undisplayable characters on TTYs.
The 'acronym' method of displaying glyphless characters on text-mode
frames treats single-character acronyms specially: they are displayed
From 3edee9a6a352d0c352a29d6590233b412bd1ab04 Mon Sep 17 00:00:00 2001
From: Ken Brown
Date: Sat, 27 Aug 2022 17:42:42 -0400
Subject: [PATCH 007/915] Fix data for files-tests-bug-21454 on Cygwin
* test/lisp/files-tests.el (files-tests-bug-21454): Fix test data
to reflect the fact that Cygwin supports UNC paths.
---
test/lisp/files-tests.el | 47 ++++++++++++++++++++++++++++------------
1 file changed, 33 insertions(+), 14 deletions(-)
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 20c712226ed..682b5cdb449 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -223,20 +223,39 @@ form.")
("x:/foo/bar/baz/" "z:/qux/foo/"))
("///foo/bar/" "$FOO/baz/;/qux/foo/"
("//foo/bar//baz/" "/qux/foo/")))
- '(("/foo/bar//baz/:/bar/foo/baz//" nil
- ("/foo/bar//baz/" "/bar/foo/baz//"))
- ("/foo/bar/:/bar/qux/:/qux/foo" nil
- ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
- ("//foo/bar/:/bar/qux/:/qux/foo/" nil
- ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
- ("/foo/bar/:/bar/qux/:/qux/foo/" nil
- ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
- ("/foo//bar/:/bar/qux/:/qux/foo/" nil
- ("/foo//bar/" "/bar/qux/" "/qux/foo/"))
- ("/foo//bar/:/bar/qux/:/qux/foo" nil
- ("/foo//bar/" "/bar/qux/" "/qux/foo/"))
- ("/foo/bar" "$FOO/baz/:/qux/foo/" ("/foo/bar/baz/" "/qux/foo/"))
- ("//foo/bar/" "$FOO/baz/:/qux/foo/" ("/foo/bar//baz/" "/qux/foo/")))))
+ (if (eq system-type 'cygwin)
+ '(("/foo/bar//baz/:/bar/foo/baz//" nil
+ ("/foo/bar//baz/" "/bar/foo/baz//"))
+ ("/foo/bar/:/bar/qux/:/qux/foo" nil
+ ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("//foo/bar/:/bar/qux/:/qux/foo/" nil
+ ("//foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo/bar/:/bar/qux/:/qux/foo/" nil
+ ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo//bar/:/bar/qux/:/qux/foo/" nil
+ ("/foo//bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo//bar/:/bar/qux/:/qux/foo" nil
+ ("/foo//bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo/bar" "$FOO/baz/:/qux/foo/"
+ ("/foo/bar/baz/" "/qux/foo/"))
+ ("///foo/bar/" "$FOO/baz/:/qux/foo/"
+ ("//foo/bar//baz/" "/qux/foo/")))
+ '(("/foo/bar//baz/:/bar/foo/baz//" nil
+ ("/foo/bar//baz/" "/bar/foo/baz//"))
+ ("/foo/bar/:/bar/qux/:/qux/foo" nil
+ ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("//foo/bar/:/bar/qux/:/qux/foo/" nil
+ ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo/bar/:/bar/qux/:/qux/foo/" nil
+ ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo//bar/:/bar/qux/:/qux/foo/" nil
+ ("/foo//bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo//bar/:/bar/qux/:/qux/foo" nil
+ ("/foo//bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo/bar" "$FOO/baz/:/qux/foo/"
+ ("/foo/bar/baz/" "/qux/foo/"))
+ ("//foo/bar/" "$FOO/baz/:/qux/foo/"
+ ("/foo/bar//baz/" "/qux/foo/"))))))
(foo-env (getenv "FOO"))
(bar-env (getenv "BAR")))
(unwind-protect
From 35af917f187719fecadde278a51fd10bf47eed07 Mon Sep 17 00:00:00 2001
From: Juri Linkov
Date: Sun, 28 Aug 2022 22:13:45 +0300
Subject: [PATCH 008/915] Revert parts of 3f076a8e44 that caused test failures
* lisp/simple.el (line-move-finish):
* lisp/window.el (scroll-command--goto-goal-column):
Revert back to using truncate-partial-width-windows instead of
truncated-partial-width-window-p. This change caused test failures
in lisp/ls-lisp-tests.log and lisp/emacs-lisp/edebug-tests.log.
---
lisp/simple.el | 2 +-
lisp/window.el | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index ceb29b1e30a..daacf697ff3 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7973,7 +7973,7 @@ If NOERROR, don't signal an error if we can't move that many lines."
;; Move to the desired column.
(if (and line-move-visual
- (not (or truncate-lines (truncated-partial-width-window-p))))
+ (not (or truncate-lines truncate-partial-width-windows)))
;; Under line-move-visual, goal-column should be
;; interpreted in units of the frame's canonical character
;; width, which is exactly what vertical-motion does.
diff --git a/lisp/window.el b/lisp/window.el
index db69379e692..ec2b0a69302 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -10137,7 +10137,7 @@ semipermanent goal column for this command."
(when goal-column
;; Move to the desired column.
(if (and line-move-visual
- (not (or truncate-lines (truncated-partial-width-window-p))))
+ (not (or truncate-lines truncate-partial-width-windows)))
;; Under line-move-visual, goal-column should be
;; interpreted in units of the frame's canonical character
;; width, which is exactly what vertical-motion does.
From 4803fba487d41f0817feab48b5095ef4b4940ff6 Mon Sep 17 00:00:00 2001
From: Juri Linkov
Date: Sun, 28 Aug 2022 22:38:51 +0300
Subject: [PATCH 009/915] 'C-x v v' on a diff buffer commits it as a patch
(bug#52349)
* lisp/vc/diff-mode.el (diff-vc-deduce-fileset): New function.
* lisp/vc/log-edit.el (log-edit-diff-patch): New function.
* lisp/vc/vc-dispatcher.el (vc-log-edit): Set log-edit-diff-function
to log-edit-diff-patch when vc-patch-string is non-nil.
(vc-start-logentry): New optional arg 'patch-string'.
Set buffer-local 'vc-patch-string' to 'patch-string'.
(vc-dispatcher-browsing): Add (derived-mode-p 'diff-mode).
* lisp/vc/vc-git.el (vc-git-checkin-patch): New function.
(vc-git-checkin): When vc-git-patch-string is non-nil,
use `git apply --cached` to add the patch to the index,
then commit the staged changes.
* lisp/vc/vc.el: New backend function 'checkin-patch'.
(vc-deduce-fileset-1): Call diff-vc-deduce-fileset in diff-mode.
(vc-next-action): For model 'patch' call vc-checkin with the
diff buffer string.
(vc-checkin): New optional arg 'patch-string'.
Call backend function 'checkin-patch' when 'patch-string' is non-nil.
Call vc-start-logentry with 'patch-string'.
(vc-diff-patch-string): New function.
---
etc/NEWS | 6 ++++++
lisp/vc/diff-mode.el | 9 +++++++++
lisp/vc/log-edit.el | 6 ++++++
lisp/vc/vc-dispatcher.el | 18 +++++++++++++-----
lisp/vc/vc-git.el | 23 +++++++++++++++++++---
lisp/vc/vc.el | 41 ++++++++++++++++++++++++++++++++++++----
6 files changed, 91 insertions(+), 12 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index f337381dd44..b27f0760d12 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1580,6 +1580,12 @@ info node. This command only works for the Emacs and Emacs Lisp manuals.
This command marks files based on a regexp. If given a prefix
argument, unmark instead.
+*** 'C-x v v' on a diff buffer commits it as a patch.
+You can create a diff buffer by e.g. 'C-x v D' ('vc-root-diff'),
+then remove unnecessary hunks, and commit only part of your changes
+by typing 'C-x v v' in that diff buffer. Currently this works only
+with Git.
+
---
*** 'C-x v v' on an unregistered file will now use the most specific backend.
Previously, if you had an SVN-covered "~/" directory, and a Git-covered
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 6b30de3cb37..a01943437c1 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2928,6 +2928,15 @@ hunk text is not found in the source file."
(forward-line 1)))
(nreverse props)))
+;;;###autoload
+(defun diff-vc-deduce-fileset ()
+ (let ((backend (vc-responsible-backend default-directory))
+ files)
+ (save-excursion
+ (goto-char (point-min))
+ (while (progn (diff-file-next) (not (eobp)))
+ (push (diff-find-file-name nil t) files)))
+ (list backend (nreverse files) nil nil 'patch)))
(defun diff--filter-substring (str)
(when diff-font-lock-prettify
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index e958673fea8..4a94553b214 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -664,6 +664,12 @@ comment history, see `log-edit-comment-ring', and hides `log-edit-files-buf'."
(indent-rigidly (point) (point-max)
(- log-edit-common-indent common)))))
+(defvar vc-patch-string)
+
+(autoload 'vc-diff-patch-string "vc")
+(defun log-edit-diff-patch ()
+ (vc-diff-patch-string vc-patch-string))
+
(defun log-edit-show-diff ()
"Show the diff for the files to be committed."
(interactive)
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index e2a490092b5..df5bf1cfa69 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -624,6 +624,8 @@ NOT-URGENT means it is ok to continue if the user says not to save."
(declare-function log-edit-empty-buffer-p "log-edit" ())
+(defvar vc-patch-string)
+
(defun vc-log-edit (fileset mode backend)
"Set up `log-edit' for use on FILE."
(setq default-directory
@@ -653,15 +655,17 @@ NOT-URGENT means it is ok to continue if the user says not to save."
(mapcar
(lambda (file) (file-relative-name file root))
fileset))))
- (log-edit-diff-function . vc-diff)
+ (log-edit-diff-function
+ . ,(if vc-patch-string 'log-edit-diff-patch 'vc-diff))
(log-edit-vc-backend . ,backend)
- (vc-log-fileset . ,fileset))
+ (vc-log-fileset . ,fileset)
+ (vc-patch-string . ,vc-patch-string))
nil
mode)
(set-buffer-modified-p nil)
(setq buffer-file-name nil))
-(defun vc-start-logentry (files comment initial-contents msg logbuf mode action &optional after-hook backend)
+(defun vc-start-logentry (files comment initial-contents msg logbuf mode action &optional after-hook backend patch-string)
"Accept a comment for an operation on FILES.
If COMMENT is nil, pop up a LOGBUF buffer, emit MSG, and set the
action on close to ACTION. If COMMENT is a string and
@@ -673,7 +677,8 @@ empty comment. Remember the file's buffer in `vc-parent-buffer'
\(current one if no file). Puts the log-entry buffer in major mode
MODE, defaulting to `log-edit-mode' if MODE is nil.
AFTER-HOOK specifies the local value for `vc-log-after-operation-hook'.
-BACKEND, if non-nil, specifies a VC backend for the Log Edit buffer."
+BACKEND, if non-nil, specifies a VC backend for the Log Edit buffer.
+PATCH-STRING is a patch to check in."
(let ((parent
(if (vc-dispatcher-browsing)
;; If we are called from a directory browser, the parent buffer is
@@ -688,6 +693,8 @@ BACKEND, if non-nil, specifies a VC backend for the Log Edit buffer."
(setq-local vc-parent-buffer parent)
(setq-local vc-parent-buffer-name
(concat " from " (buffer-name vc-parent-buffer)))
+ (when patch-string
+ (setq-local vc-patch-string patch-string))
(vc-log-edit files mode backend)
(make-local-variable 'vc-log-after-operation-hook)
(when after-hook
@@ -753,7 +760,8 @@ the buffer contents as a comment."
(defun vc-dispatcher-browsing ()
"Are we in a directory browser buffer?"
(or (derived-mode-p 'vc-dir-mode)
- (derived-mode-p 'dired-mode)))
+ (derived-mode-p 'dired-mode)
+ (derived-mode-p 'diff-mode)))
;; These are unused.
;; (defun vc-dispatcher-in-fileset-p (fileset)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 46a486a46c3..7395253745e 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -53,7 +53,8 @@
;; - responsible-p (file) OK
;; - receive-file (file rev) NOT NEEDED
;; - unregister (file) OK
-;; * checkin (files rev comment) OK
+;; * checkin (files comment rev) OK
+;; - checkin-patch (patch-string comment) OK
;; * find-revision (file rev buffer) OK
;; * checkout (file &optional rev) OK
;; * revert (file &optional contents-done) OK
@@ -914,6 +915,12 @@ If toggling on, also insert its message into the buffer."
"Major mode for editing Git log messages.
It is based on `log-edit-mode', and has Git-specific extensions.")
+(defvar vc-git-patch-string nil)
+
+(defun vc-git-checkin-patch (patch-string comment)
+ (let ((vc-git-patch-string patch-string))
+ (vc-git-checkin nil comment)))
+
(defun vc-git-checkin (files comment &optional _rev)
(let* ((file1 (or (car files) default-directory))
(root (vc-git-root file1))
@@ -936,12 +943,21 @@ It is based on `log-edit-mode', and has Git-specific extensions.")
(if (eq system-type 'windows-nt)
(let ((default-directory (file-name-directory file1)))
(make-nearby-temp-file "git-msg")))))
+ (when vc-git-patch-string
+ (unless (zerop (vc-git-command nil t nil "diff" "--cached" "--quiet"))
+ (user-error "Index not empty"))
+ (let ((patch-file (make-temp-file "git-patch")))
+ (with-temp-file patch-file
+ (insert vc-git-patch-string))
+ (unwind-protect
+ (vc-git-command nil 0 patch-file "apply" "--cached")
+ (delete-file patch-file))))
(cl-flet ((boolean-arg-fn
(argument)
(lambda (value) (when (equal value "yes") (list argument)))))
;; When operating on the whole tree, better pass "-a" than ".", since "."
;; fails when we're committing a merge.
- (apply #'vc-git-command nil 0 (if only files)
+ (apply #'vc-git-command nil 0 (if (and only (not vc-git-patch-string)) files)
(nconc (if msg-file (list "commit" "-F"
(file-local-name msg-file))
(list "commit" "-m"))
@@ -959,7 +975,8 @@ It is based on `log-edit-mode', and has Git-specific extensions.")
(write-region (car args) nil msg-file))
(setq args (cdr args)))
args)
- (if only (list "--only" "--") '("-a")))))
+ (unless vc-git-patch-string
+ (if only (list "--only" "--") '("-a"))))))
(if (and msg-file (file-exists-p msg-file)) (delete-file msg-file))))
(defun vc-git-find-revision (file rev buffer)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 85a96a29fa3..88139fe13d8 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -247,6 +247,11 @@
;; revision argument is only supported with some older VCSes, like
;; RCS and CVS, and is otherwise silently ignored.
;;
+;; - checkin-patch (patch-string comment)
+;;
+;; Commit a single patch PATCH-STRING to this backend, bypassing
+;; the changes in filesets. COMMENT is used as a check-in comment.
+;;
;; * find-revision (file rev buffer)
;;
;; Fetch revision REV of file FILE and put it into BUFFER.
@@ -1102,6 +1107,8 @@ BEWARE: this function may change the current buffer."
(vc-dir-deduce-fileset state-model-only-files))
((derived-mode-p 'dired-mode)
(dired-vc-deduce-fileset state-model-only-files not-state-changing))
+ ((derived-mode-p 'diff-mode)
+ (diff-vc-deduce-fileset))
((setq backend (vc-backend buffer-file-name))
(if state-model-only-files
(list backend (list buffer-file-name)
@@ -1114,7 +1121,8 @@ BEWARE: this function may change the current buffer."
(or (buffer-file-name vc-parent-buffer)
(with-current-buffer vc-parent-buffer
(or (derived-mode-p 'vc-dir-mode)
- (derived-mode-p 'dired-mode)))))
+ (derived-mode-p 'dired-mode)
+ (derived-mode-p 'diff-mode)))))
(progn ;FIXME: Why not `with-current-buffer'? --Stef.
(set-buffer vc-parent-buffer)
(vc-deduce-fileset-1 not-state-changing allow-unregistered state-model-only-files)))
@@ -1230,6 +1238,8 @@ with, using the most specific one."
(error "Fileset files are missing, so cannot be operated on"))
((eq state 'ignored)
(error "Fileset files are ignored by the version-control system"))
+ ((eq model 'patch)
+ (vc-checkin files backend nil nil nil (buffer-string)))
((or (null state) (eq state 'unregistered))
(cond (verbose
(let ((backend (vc-read-backend "Backend to register to: ")))
@@ -1615,13 +1625,14 @@ Type \\[vc-next-action] to check in changes.")
".\n")
(message "Please explain why you stole the lock. Type C-c C-c when done.")))
-(defun vc-checkin (files backend &optional comment initial-contents rev)
+(defun vc-checkin (files backend &optional comment initial-contents rev patch-string)
"Check in FILES. COMMENT is a comment string; if omitted, a
buffer is popped up to accept a comment. If INITIAL-CONTENTS is
non-nil, then COMMENT is used as the initial contents of the log
entry buffer.
The optional argument REV may be a string specifying the new revision
level (only supported for some older VCSes, like RCS and CVS).
+The optional argument PATCH-STRING is a string to check in as a patch.
Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
(run-hooks 'vc-before-checkin-hook)
@@ -1643,7 +1654,9 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
;; vc-checkin-switches, but 'the' local buffer is
;; not a well-defined concept for filesets.
(progn
- (vc-call-backend backend 'checkin files comment rev)
+ (if patch-string
+ (vc-call-backend backend 'checkin-patch patch-string comment)
+ (vc-call-backend backend 'checkin files comment rev))
(mapc #'vc-delete-automatic-version-backups files))
`((vc-state . up-to-date)
(vc-checkout-time . ,(file-attribute-modification-time
@@ -1651,7 +1664,8 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
(vc-working-revision . nil)))
(message "Checking in %s...done" (vc-delistify files)))
'vc-checkin-hook
- backend))
+ backend
+ patch-string))
;;; Additional entry points for examining version histories
@@ -1779,6 +1793,25 @@ objects, and finally killing buffer ORIGINAL."
(defvar vc-diff-added-files nil
"If non-nil, diff added files by comparing them to /dev/null.")
+(defvar vc-patch-string nil)
+
+(defun vc-diff-patch-string (patch-string)
+ "Report diffs to be committed from the patch.
+Like `vc-diff-internal' but uses PATCH-STRING to display
+in the output buffer."
+ (let ((buffer "*vc-diff*"))
+ (vc-setup-buffer buffer)
+ (let ((buffer-undo-list t)
+ (inhibit-read-only t))
+ (insert patch-string))
+ (setq buffer-read-only t)
+ (diff-mode)
+ (setq-local diff-vc-backend (vc-responsible-backend default-directory))
+ (setq-local revert-buffer-function (lambda (_ _) (vc-diff-patch-string)))
+ (setq-local vc-patch-string patch-string)
+ (pop-to-buffer (current-buffer))
+ (vc-run-delayed (vc-diff-finish (current-buffer) nil))))
+
(defun vc-diff-internal (async vc-fileset rev1 rev2 &optional verbose buffer)
"Report diffs between two revisions of a fileset.
Output goes to the buffer BUFFER, which defaults to *vc-diff*.
From 78698e9211ce642fb0ddeb63ce7d26339863d557 Mon Sep 17 00:00:00 2001
From: Juri Linkov
Date: Sun, 28 Aug 2022 22:44:52 +0300
Subject: [PATCH 010/915] 'C-c C-d' on vc-log buffer shows the diff from
'vc-log-fileset' (bug#52349)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* lisp/vc/log-edit.el (log-edit-diff-fileset): New function.
* lisp/vc/vc-dispatcher.el (vc-log-edit): Set log-edit-diff-function to
log-edit-diff-fileset instead of vc-diff.
* lisp/vc/vc.el (vc-diff): New optional arg ‘fileset’.
If non-nil, use instead of vc-deduce-fileset.
---
lisp/vc/log-edit.el | 7 +++++++
lisp/vc/vc-dispatcher.el | 2 +-
lisp/vc/vc.el | 7 ++++---
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index 4a94553b214..52906163024 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -670,6 +670,13 @@ comment history, see `log-edit-comment-ring', and hides `log-edit-files-buf'."
(defun log-edit-diff-patch ()
(vc-diff-patch-string vc-patch-string))
+(defvar vc-log-fileset)
+
+(defun log-edit-diff-fileset ()
+ "Display diffs for the files to be committed."
+ (interactive)
+ (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset)))
+
(defun log-edit-show-diff ()
"Show the diff for the files to be committed."
(interactive)
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index df5bf1cfa69..36a6f27891b 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -656,7 +656,7 @@ NOT-URGENT means it is ok to continue if the user says not to save."
(lambda (file) (file-relative-name file root))
fileset))))
(log-edit-diff-function
- . ,(if vc-patch-string 'log-edit-diff-patch 'vc-diff))
+ . ,(if vc-patch-string 'log-edit-diff-patch 'log-edit-diff-fileset))
(log-edit-vc-backend . ,backend)
(vc-log-fileset . ,fileset)
(vc-patch-string . ,vc-patch-string))
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 88139fe13d8..d93be951a3c 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2001,19 +2001,20 @@ state of each file in the fileset."
(when buffer-file-name (vc-buffer-sync not-urgent))))
;;;###autoload
-(defun vc-diff (&optional historic not-urgent)
+(defun vc-diff (&optional historic not-urgent fileset)
"Display diffs between file revisions.
Normally this compares the currently selected fileset with their
working revisions. With a prefix argument HISTORIC, it reads two revision
designators specifying which revisions to compare.
The optional argument NOT-URGENT non-nil means it is ok to say no to
-saving the buffer."
+saving the buffer. The optional argument FILESET can override the
+deduced fileset."
(interactive (list current-prefix-arg t))
(if historic
(call-interactively 'vc-version-diff)
(vc-maybe-buffer-sync not-urgent)
- (let ((fileset (vc-deduce-fileset t)))
+ (let ((fileset (or fileset (vc-deduce-fileset t))))
(vc-buffer-sync-fileset fileset not-urgent)
(vc-diff-internal t fileset nil nil
(called-interactively-p 'interactive)))))
From 18d5eadf2c3460ce85655211f9870a4035c202c0 Mon Sep 17 00:00:00 2001
From: Po Lu
Date: Mon, 29 Aug 2022 17:23:18 +0800
Subject: [PATCH 011/915] Unify floating point handling when reading XI motion
events
* src/xterm.c (handle_one_xevent): Always round values as
recommended, instead of just truncating them. Also fixes
weird "jitter" during drag-and-drop on some clients.
---
src/xterm.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index 7a0a21b1369..e0a8e13b24e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -21333,26 +21333,26 @@ handle_one_xevent (struct x_display_info *dpyinfo,
/* Also remember the mouse glyph and set
mouse_moved. */
if (f != dpyinfo->last_mouse_glyph_frame
- || xev->event_x < r->x
- || xev->event_x >= r->x + r->width
- || xev->event_y < r->y
- || xev->event_y >= r->y + r->height)
+ || lrint (xev->event_x) < r->x
+ || lrint (xev->event_x) >= r->x + r->width
+ || lrint (xev->event_y) < r->y
+ || lrint (xev->event_y) >= r->y + r->height)
{
f->mouse_moved = true;
f->last_mouse_device = (source ? source->name
: Qnil);
dpyinfo->last_mouse_scroll_bar = NULL;
- remember_mouse_glyph (f, xev->event_x,
- xev->event_y, r);
+ remember_mouse_glyph (f, lrint (xev->event_x),
+ lrint (xev->event_y), r);
dpyinfo->last_mouse_glyph_frame = f;
}
}
if (xev->root == dpyinfo->root_window)
target = x_dnd_get_target_window (dpyinfo,
- xev->root_x,
- xev->root_y,
+ lrint (xev->root_x),
+ lrint (xev->root_y),
&target_proto,
&motif_style,
&toplevel,
@@ -21490,14 +21490,16 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (x_dnd_last_window_is_frame && target != None)
x_dnd_note_self_position (dpyinfo, target,
- xev->root_x, xev->root_y);
+ lrint (xev->root_x),
+ lrint (xev->root_y));
else if (x_dnd_last_protocol_version != -1 && target != None)
{
dnd_state = xi_convert_event_state (xev);
x_dnd_send_position (x_dnd_frame, target,
x_dnd_last_protocol_version,
- xev->root_x, xev->root_y,
+ lrint (xev->root_x),
+ lrint (xev->root_y),
x_dnd_selection_timestamp,
x_dnd_wanted_action, 0,
dnd_state);
@@ -21705,7 +21707,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
#endif
x_dnd_note_self_wheel (dpyinfo,
x_dnd_last_seen_window,
- xev->root_x, xev->root_y,
+ lrint (xev->root_x),
+ lrint (xev->root_y),
xev->detail, dnd_state,
xev->time);
}
@@ -21713,7 +21716,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
x_dnd_send_position (x_dnd_frame,
x_dnd_last_seen_window,
x_dnd_last_protocol_version,
- xev->root_x, xev->root_y,
+ lrint (xev->root_x),
+ lrint (xev->root_y),
xev->time, x_dnd_wanted_action,
xev->detail, dnd_state);
@@ -21756,7 +21760,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
{
x_dnd_waiting_for_finish = false;
x_dnd_note_self_drop (dpyinfo, x_dnd_last_seen_window,
- xev->root_x, xev->root_y, xev->time);
+ lrint (xev->root_x),
+ lrint (xev->root_y), xev->time);
}
else if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1)
@@ -21831,12 +21836,14 @@ handle_one_xevent (struct x_display_info *dpyinfo,
x_dnd_send_unsupported_drop (dpyinfo, (x_dnd_last_seen_toplevel != None
? x_dnd_last_seen_toplevel
: x_dnd_last_seen_window),
- xev->root_x, xev->root_y, xev->time);
+ lrint (xev->root_x),
+ lrint (xev->root_y), xev->time);
}
else if (x_dnd_last_seen_toplevel != None)
x_dnd_send_unsupported_drop (dpyinfo,
x_dnd_last_seen_toplevel,
- xev->root_x, xev->root_y,
+ lrint (xev->root_x),
+ lrint (xev->root_y),
xev->time);
x_dnd_last_protocol_version = -1;
From 19ec23e82cbbc59a9900f524cdb292dce46821b4 Mon Sep 17 00:00:00 2001
From: Michael Albinus
Date: Mon, 29 Aug 2022 12:05:02 +0200
Subject: [PATCH 012/915] Do not connect unreachable remote hosts in recentf
* lisp/recentf.el (recentf-expand-file-name): Protect against
stalled remote hosts. (Bug#57336)
---
lisp/recentf.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/recentf.el b/lisp/recentf.el
index b80ee3dd7d8..32badb1a370 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -411,7 +411,8 @@ returned nil."
"Convert file NAME to absolute, and canonicalize it.
NAME is first passed to the function `expand-file-name', then to
`recentf-filename-handlers' to post process it."
- (recentf-apply-filename-handlers (expand-file-name name)))
+ (let ((non-essential t))
+ (recentf-apply-filename-handlers (expand-file-name name))))
(defun recentf-include-p (filename)
"Return non-nil if FILENAME should be included in the recent list.
From 5cae71834bd55e0bf90689b12b801206ee8c9da9 Mon Sep 17 00:00:00 2001
From: Stefan Monnier
Date: Mon, 29 Aug 2022 09:03:34 -0400
Subject: [PATCH 013/915] * src/keyboard.c (safe_run_hooks*): Simplify and
generalize
(safe_run_hooks_1, safe_run_hook_funcall): Simplify and generalize to
arbitrary `nargs`.
(safe_run_hooks_error): Remove unneeded assertion.
---
src/keyboard.c | 52 +++++++++++++++++---------------------------------
1 file changed, 17 insertions(+), 35 deletions(-)
diff --git a/src/keyboard.c b/src/keyboard.c
index 1d7125a0a3e..77280d08c5b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1827,21 +1827,15 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
}
}
-/* Subroutine for safe_run_hooks: run the hook, which is ARGS[1]. */
+/* Subroutine for safe_run_hooks: run the hook's function.
+ ARGS[0] holds the name of the hook, which we don't need here (we only use
+ it in the failure case of the internal_condition_case_n). */
static Lisp_Object
safe_run_hooks_1 (ptrdiff_t nargs, Lisp_Object *args)
{
- eassert (nargs >= 2 && nargs <= 4);
- switch (nargs)
- {
- case 2:
- return call0 (args[1]);
- case 3:
- return call1 (args[1], args[2]);
- default:
- return call2 (args[1], args[2], args[3]);
- }
+ eassert (nargs >= 2);
+ return Ffuncall (nargs - 1, args + 1);
}
/* Subroutine for safe_run_hooks: handle an error by clearing out the function
@@ -1850,7 +1844,7 @@ safe_run_hooks_1 (ptrdiff_t nargs, Lisp_Object *args)
static Lisp_Object
safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args)
{
- eassert (nargs >= 2 && nargs <= 4);
+ eassert (nargs >= 2);
AUTO_STRING (format, "Error in %s (%S): %S");
Lisp_Object hook = args[0];
Lisp_Object fun = args[1];
@@ -1886,27 +1880,13 @@ safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args)
static Lisp_Object
safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args)
{
- eassert (nargs >= 2 && nargs <= 4);
- /* Yes, run_hook_with_args works with args in the other order. */
- switch (nargs)
- {
- case 2:
- internal_condition_case_n (safe_run_hooks_1,
- 2, ((Lisp_Object []) {args[1], args[0]}),
- Qt, safe_run_hooks_error);
- break;
- case 3:
- internal_condition_case_n (safe_run_hooks_1,
- 3, ((Lisp_Object []) {args[1], args[0], args[2]}),
- Qt, safe_run_hooks_error);
- break;
- default:
- internal_condition_case_n (safe_run_hooks_1,
- 4, ((Lisp_Object [])
- {args[1], args[0], args[2], args[3]}),
- Qt, safe_run_hooks_error);
- break;
- }
+ eassert (nargs >= 2);
+ /* We need to swap args[0] and args[1] here or in `safe_run_hooks_1`.
+ It's more convenient to do it here. */
+ Lisp_Object fun = args[0], hook = args[1];
+ args[0] = hook, args[1] = fun;
+ internal_condition_case_n (safe_run_hooks_1, nargs, args,
+ Qt, safe_run_hooks_error);
return Qnil;
}
@@ -1920,7 +1900,8 @@ safe_run_hooks (Lisp_Object hook)
specpdl_ref count = SPECPDL_INDEX ();
specbind (Qinhibit_quit, Qt);
- run_hook_with_args (2, ((Lisp_Object []) {hook, hook}), safe_run_hook_funcall);
+ run_hook_with_args (2, ((Lisp_Object []) {hook, hook}),
+ safe_run_hook_funcall);
unbind_to (count, Qnil);
}
@@ -1936,7 +1917,8 @@ safe_run_hooks_maybe_narrowed (Lisp_Object hook, struct window *w)
make_fixnum (get_narrowed_zv (w, PT)),
true);
- run_hook_with_args (2, ((Lisp_Object []) {hook, hook}), safe_run_hook_funcall);
+ run_hook_with_args (2, ((Lisp_Object []) {hook, hook}),
+ safe_run_hook_funcall);
unbind_to (count, Qnil);
}
From 6f57cb6d8141e35fee39ea31f08d4ce5cf6c51e5 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Mon, 29 Aug 2022 16:52:07 +0300
Subject: [PATCH 014/915] Fix point adjustment in recreated *Messages* buffers
* lisp/startup.el (normal-top-level): Move setting of
'window-point-insertion-type' from here...
* lisp/simple.el (messages-buffer-mode): ...to here. This is so
any *Messages* buffers we create instead of the original one, if
it's killed, will have the same type of the window-point marker.
(Bug#57466)
---
lisp/simple.el | 4 +++-
lisp/startup.el | 2 --
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index daacf697ff3..2512397b240 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10431,7 +10431,9 @@ and setting it to nil."
map))
(define-derived-mode messages-buffer-mode special-mode "Messages"
- "Major mode used in the \"*Messages*\" buffer.")
+ "Major mode used in the \"*Messages*\" buffer."
+ ;; Make it easy to do like "tail -f".
+ (setq-local window-point-insertion-type t))
(defun messages-buffer ()
"Return the \"*Messages*\" buffer.
diff --git a/lisp/startup.el b/lisp/startup.el
index b0fbf7a34cd..50a8f491d8e 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -718,8 +718,6 @@ It is the default value of the variable `top-level'."
(let ((dir default-directory))
(with-current-buffer "*Messages*"
(messages-buffer-mode)
- ;; Make it easy to do like "tail -f".
- (setq-local window-point-insertion-type t)
;; Give *Messages* the same default-directory as *scratch*,
;; just to keep things predictable.
(setq default-directory (or dir (expand-file-name "~/")))))
From 4d52fe6b968b63e9c9025121147d4930ca65a05f Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Mon, 29 Aug 2022 17:02:46 +0300
Subject: [PATCH 015/915] * lisp/find-file.el (ff-other-file-alist): Doc fix.
(Bug#57325)
---
lisp/find-file.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/find-file.el b/lisp/find-file.el
index 614ff420f25..e9aba883ae1 100644
--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -204,7 +204,12 @@ The list of extensions should contain the most used extensions before the
others, since the search algorithm searches sequentially through each
directory specified in `ff-search-directories'. If a file is not found,
a new one is created with the first matching extension (`.cc' yields `.hh').
-This alist should be set by the major mode."
+This alist should be set by the major mode.
+
+Note: if an element of the alist names a FUNCTION as its cdr, that
+function must return a non-nil list of file-name extensions. It cannot
+return nil, nor can it signal in any way a failure to find a suitable
+list of extensions."
:type '(choice (repeat (list regexp (choice (repeat string) function)))
symbol))
From a5a92e577cba1af6a7947bf1f7c020a1b5adb39e Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Mon, 29 Aug 2022 17:09:02 +0300
Subject: [PATCH 016/915] ; * src/window.c (syms_of_window)
: Doc fix.
---
src/window.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/window.c b/src/window.c
index 35ec2a1f908..ed30544ff83 100644
--- a/src/window.c
+++ b/src/window.c
@@ -8309,7 +8309,8 @@ on their symbols to be controlled by this variable. */);
Vscroll_preserve_screen_position = Qnil;
DEFVAR_LISP ("window-point-insertion-type", Vwindow_point_insertion_type,
- doc: /* Type of marker to use for `window-point'. */);
+ doc: /* Insertion type of marker to use for `window-point'.
+See `marker-insertion-type' for the meaning of the possible values. */);
Vwindow_point_insertion_type = Qnil;
DEFSYM (Qwindow_point_insertion_type, "window-point-insertion-type");
From 46a49b748eaf5553a6eb45215b14baebc090b33b Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Mon, 29 Aug 2022 17:15:17 +0200
Subject: [PATCH 017/915] Work around `&' dired command when using the fish
shell
* lisp/dired-aux.el (dired-shell-stuff-it): Add a space before
&wait; this apparently makes the `&' command work with the fish
shell (bug#57472).
---
lisp/dired-aux.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 06f0b86fc43..0e8062af528 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -987,7 +987,7 @@ Also see the `dired-confirm-shell-command' variable."
;; Add 'wait' to force those POSIX shells to wait until
;; all commands finish.
(or (and parallel-in-background (not w32-shell)
- "&wait")
+ " &wait")
"")))
(t
(let ((files (mapconcat #'shell-quote-argument
@@ -999,7 +999,7 @@ Also see the `dired-confirm-shell-command' variable."
;; Be consistent in how we treat inputs to commands -- do
;; the same here as in the `on-each' case.
(if (and in-background (not w32-shell))
- "&wait"
+ " &wait"
"")))))
(or (and in-background "&")
""))))
From df62a3f85ac71bde3b045c19867f142d8e1ead67 Mon Sep 17 00:00:00 2001
From: Jake Moss
Date: Mon, 29 Aug 2022 17:23:46 +0200
Subject: [PATCH 018/915] Show gdb-mi disassembly over tramp
* lisp/progmodes/gdb-mi.el (gdb-invalidate-disassembly): Show
gdb-mi disassembly over tramp (bug#57464).
Copyright-paperwork-exempt: yes
---
lisp/progmodes/gdb-mi.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index bab80719dbd..6e8032b7eae 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -4033,11 +4033,12 @@ DOC is an optional documentation string."
(file (gdb-mi--field frame 'fullname))
(line (gdb-mi--field frame 'line)))
(if file
- (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line)
- ;; If we're unable to get a file name / line for $PC, simply
- ;; follow $PC, disassembling the next 10 (x ~15 (on IA) ==
- ;; 150 bytes) instructions.
- "-data-disassemble -s $pc -e \"$pc + 150\" -- 0"))
+ (format "-data-disassemble -f %s -l %s -n -1 -- 0"
+ (file-local-name file) line)
+ ;; If we're unable to get a file name / line for $PC, simply
+ ;; follow $PC, disassembling the next 10 (x ~15 (on IA) ==
+ ;; 150 bytes) instructions.
+ "-data-disassemble -s $pc -e \"$pc + 150\" -- 0"))
gdb-disassembly-handler
;; We update disassembly only after we have actual frame information
;; about all threads, so no there's `update' signal in this list
From c0bb1aac102f8727484763370b154f635a6a1fd1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?=
Date: Mon, 29 Aug 2022 17:44:31 +0200
Subject: [PATCH 019/915] Fix reader memory leak upon error (bug#56623)
Reported by Tom Gillespie; error found by Greg Hendershott.
* src/lread.c (read_stack_reset): New.
(read0): Reset read stack when unwinding from an error.
---
src/lread.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/lread.c b/src/lread.c
index ccccd79cd7c..15bbf46f78f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3686,6 +3686,12 @@ read_stack_push (struct read_stack_entry e)
rdstack.stack[rdstack.sp++] = e;
}
+static void
+read_stack_reset (intmax_t sp)
+{
+ eassert (sp <= rdstack.sp);
+ rdstack.sp = sp;
+}
/* Read a Lisp object.
If LOCATE_SYMS is true, symbols are read with position. */
@@ -3699,6 +3705,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
specpdl_ref count = SPECPDL_INDEX ();
ptrdiff_t base_sp = rdstack.sp;
+ record_unwind_protect_intmax (read_stack_reset, base_sp);
bool uninterned_symbol;
bool skip_shorthand;
From 9f692bcd84e2b6e450e154361e1058186e6481a8 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Mon, 29 Aug 2022 19:26:39 +0200
Subject: [PATCH 020/915] Improve point-at-{bol,eol} obsoletion message
* lisp/subr.el (point-at-eol, point-at-bol): Mention 'pos-eol' and
'pos-bol' in obsoletion message.
---
lisp/subr.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/subr.el b/lisp/subr.el
index 36f5e2fee49..2ffc594997c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1913,8 +1913,10 @@ be a list of the form returned by `event-start' and `event-end'."
(defalias 'mkdir #'make-directory)
;; These were the XEmacs names, now obsolete:
-(define-obsolete-function-alias 'point-at-eol #'line-end-position "29.1")
-(define-obsolete-function-alias 'point-at-bol #'line-beginning-position "29.1")
+(defalias 'point-at-eol #'line-end-position)
+(make-obsolete 'point-at-eol "use `line-end-position' or `pos-eol' instead." "29.1")
+(defalias 'point-at-bol #'line-beginning-position)
+(make-obsolete 'point-at-bol "use `line-beginning-position' or `pos-bol' instead." "29.1")
(define-obsolete-function-alias 'user-original-login-name #'user-login-name "28.1")
;; These are in obsolete/autoload.el, but are commonly used by
From 2d9a39172734ab024126fb08496b5272d1b68e47 Mon Sep 17 00:00:00 2001
From: Gregory Heytings
Date: Mon, 29 Aug 2022 16:06:37 +0000
Subject: [PATCH 021/915] Recommend using fbterm in the Linux console.
* doc/misc/efaq.texi (Emacs in a Linux console): New node.
(Common requests): Entry for the new node.
* etc/PROBLEMS (Linux console problems...): Mention the new FAQ node.
---
doc/misc/efaq.texi | 85 ++++++++++++++++++++++++++++++++++++++++++++++
etc/PROBLEMS | 7 ++++
2 files changed, 92 insertions(+)
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 373efe9ad5f..2da37a1d215 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -1603,6 +1603,7 @@ is better to write ``Emacs and XEmacs.''
* Filling paragraphs with a single space::
* Escape sequences in shell output::
* Fullscreen mode on MS-Windows::
+* Emacs in a Linux console::
@end menu
@node Setting up a customization file
@@ -3020,6 +3021,90 @@ To compute the correct values for width and height, first maximize the
Emacs frame and then evaluate @code{(frame-height)} and
@code{(frame-width)} with @kbd{M-:}.
+@node Emacs in a Linux console
+@section How can I alleviate the limitations of the Linux console?
+@cindex Console, Linux console, TTY, fbterm
+
+If possible, we recommend running Emacs inside @command{fbterm}, when
+in a Linux console. This brings the Linux console on par with most
+terminal emulators under X. To do this, install @command{fbterm}, for
+example with the package manager of your GNU/Linux distribution, and
+execute the command
+
+@example
+$ fbterm
+@end example
+
+This will create a sample configuration file @file{~/.fbtermrc} in
+your home directory. Edit that file and change the options
+@code{font-names} and @code{font-size} if necessary. For the former,
+you can choose one or more of the lines in the output of the following
+command, separated by commas:
+
+@example
+$ fc-list :spacing=mono family | sed 's/ /\\ /g'
+@end example
+
+You can now start Emacs inside @command{fbterm} with the command
+
+@example
+$ fbterm -- emacs
+@end example
+
+You may want to add an alias for that command in your shell
+configuration file. For example, if you use Bash, you can add the
+following line to your @file{~/.bashrc} file:
+
+@example
+alias emacs="fbterm -- emacs"
+@end example
+
+@noindent
+or, if you use Emacs both in the Linux console and under X:
+
+@example
+[[ "$(tty)" =~ "/dev/tty" ]] && alias emacs="fbterm -- emacs"
+@end example
+
+The @command{fbterm} terminal emulator may define a number of key
+bindings for its own use, some of which conflict with those that Emacs
+uses. Execute the following two commands as root to ensure that
+@command{fbterm} does not define these key bindings:
+
+@example
+# chmod a-s `which fbterm`
+# setcap cap_sys_tty_config=-ep `which fbterm`
+@end example
+
+If you use Emacs as root, the above is not enough however, because the
+root user has all privileges. You can use the following command to
+start Emacs inside @command{fbterm} as root while ensuring that
+@command{fbterm} does not define any key bindings for its own use:
+
+@example
+# capsh --drop=cap_sys_tty_config -- -c "fbterm -- emacs"
+@end example
+
+Again you may want to add a shortcut for that command in the shell
+configuration file of the root user. In this case however, it is not
+possible to use an alias, because the command line arguments passed to
+Emacs need to be inserted in the string at the end of the command. A
+wrapper script or a function can be used to do that. For example, if
+you use Bash, you can add the following function in the root user
+@file{~/.bashrc} file:
+
+@example
+function emacs ()
+@{
+ CMD="fbterm -- emacs "
+ for ARG in "$@@"
+ do
+ CMD="$CMD '$ARG' "
+ done
+ capsh --drop=cap_sys_tty_config -- -c "$CMD"
+@}
+@end example
+
@c ------------------------------------------------------------
@node Bugs and problems
@chapter Bugs and problems
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 2a82995c994..9e0b0148ba3 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -2108,6 +2108,13 @@ term/xterm.el) for more details.
*** Linux console problems with double-width characters
+If possible, we recommend running Emacs inside fbterm, when in a Linux
+console (see the node "Emacs in a Linux console" in the Emacs FAQ).
+Most Unicode characters should then be displayed correctly.
+
+If that is not possible, the following may be useful to alleviate the
+problem of displaying Unicode characters in a raw console.
+
The Linux console declares UTF-8 encoding, but supports only a limited
number of Unicode characters, and can cause Emacs produce corrupted or
garbled display with some unusual characters and sequences. Emacs 28
From f9250c5ebc1730bf3bed4382549433f52f7ef9ca Mon Sep 17 00:00:00 2001
From: Jim Porter
Date: Mon, 22 Aug 2022 09:53:24 -0700
Subject: [PATCH 022/915] Handle 'eshell-pipe-broken' when evaluating Lisp
forms in Eshell
* lisp/eshell/esh-cmd.el (eshell-exec-lisp): Handle
'eshell-pipe-broken'.
* lisp/eshell/esh-io.el (eshell-output-object-to-target): Only signal
'eshell-pipe-broken' if the process being written to has finished.
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/pipeline-connection-type/middle)
(esh-proc-test/pipeline-connection-type/last): Remove ':unstable'.
Ref: https://lists.gnu.org/archive/html/emacs-devel/2022-08/msg00524.html
---
lisp/eshell/esh-cmd.el | 9 +++++++++
lisp/eshell/esh-io.el | 12 +++++++++---
test/lisp/eshell/esh-proc-tests.el | 4 ----
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 2f77f3f4974..a43ad77213d 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -1347,6 +1347,15 @@ case."
(apply func-or-form args)))))
(and result (funcall printer result))
result)
+ (eshell-pipe-broken
+ ;; If FUNC-OR-FORM tried and failed to write some output to a
+ ;; process, it will raise an `eshell-pipe-broken' signal (this is
+ ;; analogous to SIGPIPE on POSIX systems). In this case, set the
+ ;; command status to some non-zero value to indicate an error; to
+ ;; match GNU/Linux, we use 141, which the numeric value of
+ ;; SIGPIPE on GNU/Linux (13) with the high bit (2^7) set.
+ (setq eshell-last-command-status 141)
+ nil)
(error
(setq eshell-last-command-status 1)
(let ((msg (error-message-string err)))
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index e5977c95807..d54be55c130 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -498,10 +498,16 @@ Returns what was actually sent, or nil if nothing was sent."
((eshell-processp target)
(unless (stringp object)
(setq object (eshell-stringify object)))
- (condition-case nil
+ (condition-case err
(process-send-string target object)
- ;; If `process-send-string' raises an error, treat it as a broken pipe.
- (error (signal 'eshell-pipe-broken (list target)))))
+ (error
+ ;; If `process-send-string' raises an error and the process has
+ ;; finished, treat it as a broken pipe. Otherwise, just
+ ;; re-throw the signal.
+ (if (memq (process-status target)
+ '(run stop open closed))
+ (signal (car err) (cdr err))
+ (signal 'eshell-pipe-broken (list target))))))
((consp target)
(apply (car target) object (cdr target))))
diff --git a/test/lisp/eshell/esh-proc-tests.el b/test/lisp/eshell/esh-proc-tests.el
index 62e784e8f62..2369bb5cc00 100644
--- a/test/lisp/eshell/esh-proc-tests.el
+++ b/test/lisp/eshell/esh-proc-tests.el
@@ -74,8 +74,6 @@
(ert-deftest esh-proc-test/pipeline-connection-type/middle ()
"Test that all streams are pipes when a command is in the middle of a
pipeline."
- ;; Repeated unreproducible errors.
- :tags '(:unstable)
(skip-unless (and (executable-find "sh")
(executable-find "cat")))
(eshell-command-result-equal
@@ -84,8 +82,6 @@ pipeline."
(ert-deftest esh-proc-test/pipeline-connection-type/last ()
"Test that only output streams are PTYs when a command ends a pipeline."
- ;; Repeated unreproducible errors.
- :tags '(:unstable)
(skip-unless (executable-find "sh"))
(eshell-command-result-equal
(concat "echo | " esh-proc-test--detect-pty-cmd)
From a998591522416c2aebee8daf4ca35a5b4b7177bb Mon Sep 17 00:00:00 2001
From: Juri Linkov
Date: Tue, 30 Aug 2022 10:28:34 +0300
Subject: [PATCH 023/915] * lisp/char-fold.el
(describe-char-fold-equivalences): New command.
(char-fold--no-regexp): New internal variable.
(char-fold--make-table): Use it to skip translation to regexp.
Suggested by Robert Pluim .
https://lists.gnu.org/archive/html/emacs-devel/2022-07/msg00864.html
---
etc/NEWS | 3 +++
lisp/char-fold.el | 66 +++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 64 insertions(+), 5 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index b27f0760d12..a40954a8376 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1518,6 +1518,9 @@ with 'C-s C-s', but also after typing a character.
Non-nil means that the default definitions of equivalent characters
are overridden.
+*** New command 'describe-char-fold-equivalences'.
+It displays character equivalences used by `char-fold-to-regexp'.
+
+++
*** New command 'isearch-emoji-by-name'.
It is bound to 'C-x 8 e RET' during an incremental search. The
diff --git a/lisp/char-fold.el b/lisp/char-fold.el
index 05ae52cae0d..e4c7c3c41e5 100644
--- a/lisp/char-fold.el
+++ b/lisp/char-fold.el
@@ -48,6 +48,7 @@
(eval-and-compile
+ (defvar char-fold--no-regexp nil)
(defun char-fold--make-table ()
(let* ((equiv (make-char-table 'char-fold-table))
(equiv-multi (make-char-table 'char-fold-table))
@@ -201,11 +202,14 @@
symmetric)))
;; Convert the lists of characters we compiled into regexps.
- (map-char-table
- (lambda (char decomp-list)
- (let ((re (regexp-opt (cons (char-to-string char) decomp-list))))
- (aset equiv char re)))
- equiv)
+ (unless char-fold--no-regexp
+ ;; Non-nil `char-fold--no-regexp' unoptimized for regexp
+ ;; is used by `describe-char-fold-equivalences'.
+ (map-char-table
+ (lambda (char decomp-list)
+ (let ((re (regexp-opt (cons (char-to-string char) decomp-list))))
+ (aset equiv char re)))
+ equiv))
equiv)))
(defconst char-fold-table
@@ -421,6 +425,58 @@ BOUND NOERROR COUNT are passed to `re-search-backward'."
(interactive "sSearch: ")
(re-search-backward (char-fold-to-regexp string) bound noerror count))
+
+(defun describe-char-fold-equivalences (char &optional lax)
+ "Display characters equivalent to CHAR.
+Prompt for CHAR. With no input, i.e. when CHAR is nil, by default
+describe all available character equivalences of `char-fold-to-regexp'.
+Interactively, a prefix arg means also include partially matching
+ligatures."
+ (interactive (list (ignore-errors
+ (read-char-by-name
+ "Character (Unicode name or hex, default all): "))
+ current-prefix-arg))
+ (require 'help-fns)
+ (let ((help-buffer-under-preparation t))
+ (help-setup-xref (list #'describe-char-fold-equivalences)
+ (called-interactively-p 'interactive))
+ (let* ((equivalences nil)
+ (char-fold--no-regexp t)
+ (table (char-fold--make-table))
+ (extra (char-table-extra-slot table 0)))
+ (if (not char)
+ (map-char-table
+ (lambda (char list)
+ (when lax
+ (setq list (append list (mapcar (lambda (entry)
+ (cdr entry))
+ (aref extra char)))))
+ (setq equivalences (cons (cons char list)
+ equivalences)))
+ table)
+ (setq equivalences (aref table char))
+ (when lax
+ (setq equivalences (append equivalences
+ (mapcar (lambda (entry)
+ (cdr entry))
+ (aref extra char)))))
+ (setq equivalences (cons (char-to-string char) equivalences)))
+ (with-help-window (help-buffer)
+ (with-current-buffer standard-output
+ (if char
+ (insert (mapconcat
+ (lambda (c)
+ (format "%s: \?\\N{%s}\n"
+ c
+ (or (get-char-code-property (string-to-char c) 'name)
+ (get-char-code-property (string-to-char c) 'old-name))))
+ equivalences))
+ (insert "A list of char-fold equivalences for `char-fold-to-regexp':\n\n")
+ (setq-local bidi-paragraph-direction 'left-to-right)
+ (dolist (equiv (nreverse equivalences))
+ (insert (format "%c: %s\n" (car equiv)
+ (string-join (cdr equiv) " "))))))))))
+
(provide 'char-fold)
;;; char-fold.el ends here
From 57ba65e047de2495500ba375070a896913cce267 Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Tue, 30 Aug 2022 10:53:11 +0200
Subject: [PATCH 024/915] Fix char-fold compilation warning
* lisp/char-fold.el (require): Get string-join definition.
---
lisp/char-fold.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/char-fold.el b/lisp/char-fold.el
index e4c7c3c41e5..ce395ddaab0 100644
--- a/lisp/char-fold.el
+++ b/lisp/char-fold.el
@@ -24,6 +24,8 @@
;;; Code:
+(eval-when-compile (require 'subr-x))
+
(eval-and-compile
(put 'char-fold-table 'char-table-extra-slots 1)
(defconst char-fold--default-override nil)
From 8954fcb93bb271f5147b19671d1bf87d88d8047a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?=
Date: Tue, 30 Aug 2022 11:20:42 +0200
Subject: [PATCH 025/915] ; * src/lread.c (read0): Fix specpdl off-by-one bug
in last change.
---
src/lread.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/lread.c b/src/lread.c
index 15bbf46f78f..bb376064811 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3702,11 +3702,13 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
char *read_buffer = stackbuf;
ptrdiff_t read_buffer_size = sizeof stackbuf;
char *heapbuf = NULL;
- specpdl_ref count = SPECPDL_INDEX ();
+ specpdl_ref base_pdl = SPECPDL_INDEX ();
ptrdiff_t base_sp = rdstack.sp;
record_unwind_protect_intmax (read_stack_reset, base_sp);
+ specpdl_ref count = SPECPDL_INDEX ();
+
bool uninterned_symbol;
bool skip_shorthand;
@@ -4354,7 +4356,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
}
}
- return unbind_to (count, obj);
+ return unbind_to (base_pdl, obj);
}
From db6e574567350f8cf2eec698ea82e62dcd9d27a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?=
Date: Tue, 30 Aug 2022 12:54:29 +0200
Subject: [PATCH 026/915] ; Ignore test/gmo.h in .gitignore
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 0ecbcd061fb..eb77b2388f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -330,3 +330,4 @@ manual/
# Ignore a directory used by dap-mode.
.vscode
+/test/gmp.h
From 0bf5463f8147ea9143d286d5a9df7c8421a1ac4b Mon Sep 17 00:00:00 2001
From: Po Lu
Date: Tue, 30 Aug 2022 19:27:39 +0800
Subject: [PATCH 027/915] Fix junk data being returned with incremental
selection transfers
* src/xselect.c (receive_incremental_selection): New arg
REAL_BYTES_RET. Set it to the actual size instead of using the
size of the array after it was grown by xpalloc.
(x_get_window_property_as_lisp_data): Adjust call to
receive_incremental_selection.
---
src/xselect.c | 34 +++++++++++++++++++++++++++++-----
1 file changed, 29 insertions(+), 5 deletions(-)
diff --git a/src/xselect.c b/src/xselect.c
index bab0400540e..74d762f3055 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1567,7 +1567,8 @@ receive_incremental_selection (struct x_display_info *dpyinfo,
unsigned char **data_ret,
ptrdiff_t *size_bytes_ret,
Atom *type_ret, int *format_ret,
- unsigned long *size_ret)
+ unsigned long *size_ret,
+ ptrdiff_t *real_bytes_ret)
{
ptrdiff_t offset = 0;
struct prop_location *wait_object;
@@ -1622,7 +1623,8 @@ receive_incremental_selection (struct x_display_info *dpyinfo,
if (tmp_size_bytes == 0) /* we're done */
{
- TRACE0 ("Done reading incrementally");
+ TRACE1 ("Done reading incrementally; total bytes: %"pD"d",
+ *size_bytes_ret);
if (! waiting_for_other_props_on_window (display, window))
XSelectInput (display, window, STANDARD_EVENT_SET);
@@ -1652,6 +1654,19 @@ receive_incremental_selection (struct x_display_info *dpyinfo,
memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes);
offset += tmp_size_bytes;
+ /* *size_bytes_ret is not really the size of the data inside the
+ buffer; it is the size of the buffer allocated by xpalloc.
+
+ This matters when the cardinal specified in the INCR property
+ (a _lower bound_ on the size of the selection data) is
+ smaller than the actual selection contents, which can happen
+ when programs are streaming selection data from a file
+ descriptor. In that case, we used to return junk if xpalloc
+ decided to grow the buffer by more than the provided
+ increment; to avoid that, store the actual size of the
+ selection data in *real_bytes_ret. */
+ *real_bytes_ret += tmp_size_bytes;
+
/* Use xfree, not XFree, because x_get_window_property
calls xmalloc itself. */
xfree (tmp_data);
@@ -1674,10 +1689,14 @@ x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo,
int actual_format;
unsigned long actual_size;
unsigned char *data = 0;
- ptrdiff_t bytes = 0;
+ ptrdiff_t bytes = 0, array_bytes;
Lisp_Object val;
Display *display = dpyinfo->display;
+ /* array_bytes is only used as an argument to xpalloc. The actual
+ size of the data inside the buffer is inside bytes. */
+ array_bytes = 0;
+
TRACE0 ("Reading selection data");
x_get_window_property (display, window, property, &data, &bytes,
@@ -1718,10 +1737,15 @@ x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo,
calls xmalloc itself. */
xfree (data);
unblock_input ();
+
+ /* Clear bytes again. Previously, receive_incremental_selection
+ would set this to min_size_bytes, but that is now done to
+ array_bytes instead. */
+ bytes = 0;
receive_incremental_selection (dpyinfo, window, property, target_type,
- min_size_bytes, &data, &bytes,
+ min_size_bytes, &data, &array_bytes,
&actual_type, &actual_format,
- &actual_size);
+ &actual_size, &bytes);
}
if (!for_multiple)
From 0cbcaf5119d36093882f0c414c4c586186ef77b2 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Tue, 30 Aug 2022 15:42:34 +0300
Subject: [PATCH 028/915] ; Yet another doc fix for 'ff-other-file-alist'
(bug#57325)
---
lisp/find-file.el | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/lisp/find-file.el b/lisp/find-file.el
index e9aba883ae1..aaabec11e83 100644
--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -193,17 +193,26 @@ The value could be an alist or a symbol whose value is an alist.
Each element of the alist has the form
(REGEXP (EXTENSION...))
-or
- (REGEXP FUNCTION)
where REGEXP is the regular expression matching a file's extension,
-EXTENSIONs is the list of literal file-name extensions to search for,
-and FUNCTION is a function of one argument, the current file's name,
-that returns the list of extensions to search for.
-The list of extensions should contain the most used extensions before the
-others, since the search algorithm searches sequentially through each
-directory specified in `ff-search-directories'. If a file is not found,
-a new one is created with the first matching extension (`.cc' yields `.hh').
+and EXTENSIONs is the list of literal file-name extensions to search
+for. The list of extensions should contain the most used extensions
+before the others, since the search algorithm searches sequentially
+through each directory specified in `ff-search-directories'.
+
+Alist elements can also be of the form
+
+ (REGEXP FUNCTION)
+
+where FUNCTION is a function of one argument, the current file's name,
+that returns the list of possible names of the corresponding files, with
+or without leading directories. Note the difference: FUNCTION returns
+the list of file names, not their extensions. This is for the case when
+REGEXP is not enough to determine the file name of the other file.
+
+If a file is not found, a new one is created with the first
+matching extension or name (e.g., `.cc' yields `.hh').
+
This alist should be set by the major mode.
Note: if an element of the alist names a FUNCTION as its cdr, that
From 3e5716dba3ea203a4dc8be794a6b2dee13d5ecc4 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Tue, 30 Aug 2022 16:12:37 +0300
Subject: [PATCH 029/915] ; * etc/NEWS: Clarify wording of "C-x v v" entry.
---
etc/NEWS | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index a40954a8376..8d251448d35 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1583,11 +1583,16 @@ info node. This command only works for the Emacs and Emacs Lisp manuals.
This command marks files based on a regexp. If given a prefix
argument, unmark instead.
-*** 'C-x v v' on a diff buffer commits it as a patch.
-You can create a diff buffer by e.g. 'C-x v D' ('vc-root-diff'),
-then remove unnecessary hunks, and commit only part of your changes
-by typing 'C-x v v' in that diff buffer. Currently this works only
-with Git.
+---
+*** 'C-x v v' in a diffs buffer allows to commit only some of the changes.
+This command is intended to allow you to commit only some of the
+changes you have in your working tree. Begin by creating a buffer
+with the changes against the last commit, e.g. with 'C-x v D'
+('vc-root-diff'). Then edit the diffs to remove the hunks you don't
+want to commit. Finally, type 'C-x v v' in that diff buffer to commit
+only part of your changes, those whose hunks were left in the buffer.
+
+Currently this feature works only with the Git as 'vc-backend'.
---
*** 'C-x v v' on an unregistered file will now use the most specific backend.
From 5cf7b1ada96c2e209580d086d15b1bbe5b345657 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?=
Date: Tue, 30 Aug 2022 11:57:29 +0200
Subject: [PATCH 030/915] ; * src/lread.c (invalid_radix_integer): Use a local
buffer.
---
src/lread.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/lread.c b/src/lread.c
index bb376064811..d64a4fad3af 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2905,20 +2905,18 @@ digit_to_number (int character, int base)
return digit < base ? digit : -1;
}
-/* Size of the fixed-size buffer used during reading.
- It should be at least big enough for `invalid_radix_integer' but
- can usefully be much bigger than that. */
-enum { stackbufsize = 1024 };
-
static void
-invalid_radix_integer (EMACS_INT radix, char stackbuf[VLA_ELEMS (stackbufsize)],
- Lisp_Object readcharfun)
+invalid_radix_integer (EMACS_INT radix, Lisp_Object readcharfun)
{
- int n = snprintf (stackbuf, stackbufsize, "integer, radix %"pI"d", radix);
- eassert (n < stackbufsize);
- invalid_syntax (stackbuf, readcharfun);
+ char buf[64];
+ int n = snprintf (buf, sizeof buf, "integer, radix %"pI"d", radix);
+ eassert (n < sizeof buf);
+ invalid_syntax (buf, readcharfun);
}
+/* Size of the fixed-size buffer used during reading. */
+enum { stackbufsize = 1024 };
+
/* Read an integer in radix RADIX using READCHARFUN to read
characters. RADIX must be in the interval [2..36]. Use STACKBUF
for temporary storage as needed. Value is the integer read.
@@ -2976,7 +2974,7 @@ read_integer (Lisp_Object readcharfun, int radix,
UNREAD (c);
if (valid != 1)
- invalid_radix_integer (radix, stackbuf, readcharfun);
+ invalid_radix_integer (radix, readcharfun);
*p = '\0';
return unbind_to (count, string_to_number (read_buffer, radix, NULL));
@@ -3989,7 +3987,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
{
/* #NrDIGITS -- radix-N number */
if (n < 0 || n > 36)
- invalid_radix_integer (n, stackbuf, readcharfun);
+ invalid_radix_integer (n, readcharfun);
obj = read_integer (readcharfun, n, stackbuf);
break;
}
From e1e60e51bf324aaa2137075827c4d08a331a7bef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?=
Date: Tue, 30 Aug 2022 16:44:51 +0200
Subject: [PATCH 031/915] Accept bignum arguments in `take` and `ntake`
* src/fns.c (Ftake, Fntake): Accept any integer as first argument, for
completeness.
* test/src/fns-tests.el (fns--take-ntake): Add test cases.
---
src/fns.c | 20 ++++++++++++++++++--
test/src/fns-tests.el | 10 +++++++++-
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/src/fns.c b/src/fns.c
index 7e78bba3a04..07102256fed 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1563,7 +1563,15 @@ If N is zero or negative, return nil.
If N is greater or equal to the length of LIST, return LIST (or a copy). */)
(Lisp_Object n, Lisp_Object list)
{
- CHECK_FIXNUM (n);
+ if (BIGNUMP (n))
+ {
+ if (mpz_sgn (*xbignum_val (n)) < 0)
+ return Qnil;
+ CHECK_LIST (list);
+ return list;
+ }
+ if (!FIXNUMP (n))
+ wrong_type_argument (Qintegerp, n);
EMACS_INT m = XFIXNUM (n);
if (m <= 0)
return Qnil;
@@ -1594,7 +1602,15 @@ If N is greater or equal to the length of LIST, return LIST unmodified.
Otherwise, return LIST after truncating it. */)
(Lisp_Object n, Lisp_Object list)
{
- CHECK_FIXNUM (n);
+ if (BIGNUMP (n))
+ {
+ if (mpz_sgn (*xbignum_val (n)) < 0)
+ return Qnil;
+ CHECK_LIST (list);
+ return list;
+ }
+ if (!FIXNUMP (n))
+ wrong_type_argument (Qintegerp, n);
EMACS_INT m = XFIXNUM (n);
if (m <= 0)
return Qnil;
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index a84cce3ad4e..4ef428af03e 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -1412,6 +1412,14 @@
(should (equal (take 5 list) '(a b c b c)))
(should (equal (take 10 list) '(a b c b c b c b c b)))
- (should (equal (ntake 10 list) '(a b)))))
+ (should (equal (ntake 10 list) '(a b))))
+
+ ;; Bignum N argument.
+ (let ((list (list 'a 'b 'c)))
+ (should (equal (take (+ most-positive-fixnum 1) list) '(a b c)))
+ (should (equal (take (- most-negative-fixnum 1) list) nil))
+ (should (equal (ntake (+ most-positive-fixnum 1) list) '(a b c)))
+ (should (equal (ntake (- most-negative-fixnum 1) list) nil))
+ (should (equal list '(a b c)))))
;;; fns-tests.el ends here
From bbc23ca8ab42d7a45bcbadd5ffd911868eb6f99d Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Tue, 30 Aug 2022 19:09:00 +0300
Subject: [PATCH 032/915] One more fix for find-file.el
* lisp/find-file.el (ff-get-file-name): Use 'expand-file-name'
instead of 'concat', which doesn't DTRT with absolute file names.
(ff-other-file-alist): Yet another doc fix. (Bug#57325)
---
lisp/find-file.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lisp/find-file.el b/lisp/find-file.el
index aaabec11e83..646779fc919 100644
--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -216,9 +216,9 @@ matching extension or name (e.g., `.cc' yields `.hh').
This alist should be set by the major mode.
Note: if an element of the alist names a FUNCTION as its cdr, that
-function must return a non-nil list of file-name extensions. It cannot
+function must return a non-nil list of file-names. It cannot
return nil, nor can it signal in any way a failure to find a suitable
-list of extensions."
+list of file names."
:type '(choice (repeat (list regexp (choice (repeat string) function)))
symbol))
@@ -629,7 +629,7 @@ name of the first file found."
(while (and suffixes (not found))
(setq filename (concat fname-stub this-suffix))
- (setq file (concat dir "/" filename))
+ (setq file (expand-file-name filename dir))
(if (not ff-quiet-mode)
(message "Finding %s..." file))
From 7804536e4e6dd7fa57d38b9b6c6835ae316bff50 Mon Sep 17 00:00:00 2001
From: Juri Linkov
Date: Tue, 30 Aug 2022 20:09:20 +0300
Subject: [PATCH 033/915] Fix 744ed0ceeed7472a160fea7154939cf641205577 from
bug#57082 (bug#57176)
* lisp/outline.el (outline-minor-mode-highlight-buffer): Handle 'append'.
(outline-minor-mode): Call outline--fix-up-all-buttons when font-lock is used.
* lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Fix regexp.
---
lisp/outline.el | 21 +++++++++++----------
lisp/textmodes/emacs-news-mode.el | 6 ++++--
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/lisp/outline.el b/lisp/outline.el
index 3250b62f1e7..857ac9562fd 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -427,15 +427,14 @@ outline font-lock faces to those of major mode."
(goto-char (point-min))
(let ((regexp (concat "^\\(?:" outline-regexp "\\).*$")))
(while (re-search-forward regexp nil t)
- (let ((overlay (make-overlay (match-beginning 0)
- (match-end 0))))
+ (let ((overlay (make-overlay (match-beginning 0) (match-end 0))))
(overlay-put overlay 'outline-overlay t)
- (when (or (eq outline-minor-mode-highlight 'override)
+ ;; FIXME: Is it possible to override all underlying face attributes?
+ (when (or (memq outline-minor-mode-highlight '(append override))
(and (eq outline-minor-mode-highlight t)
- (goto-char (match-beginning 0))
- (not (get-text-property (point) 'face))))
+ (not (get-text-property (match-beginning 0) 'face))))
(overlay-put overlay 'face (outline-font-lock-face)))
- (when (and (outline--use-buttons-p) (outline-on-heading-p))
+ (when (outline--use-buttons-p)
(outline--insert-open-button)))
(goto-char (match-end 0))))))
@@ -452,10 +451,12 @@ See the command `outline-mode' for more information on this mode."
(if outline-minor-mode
(progn
(when outline-minor-mode-highlight
- (when (and global-font-lock-mode (font-lock-specified-p major-mode))
- (font-lock-add-keywords nil outline-font-lock-keywords t)
- (font-lock-flush))
- (outline-minor-mode-highlight-buffer))
+ (if (and global-font-lock-mode (font-lock-specified-p major-mode))
+ (progn
+ (font-lock-add-keywords nil outline-font-lock-keywords t)
+ (font-lock-flush)
+ (outline--fix-up-all-buttons))
+ (outline-minor-mode-highlight-buffer)))
;; Turn off this mode if we change major modes.
(add-hook 'change-major-mode-hook
(lambda () (outline-minor-mode -1))
diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el
index 022e17c9343..6bf96deaccb 100644
--- a/lisp/textmodes/emacs-news-mode.el
+++ b/lisp/textmodes/emacs-news-mode.el
@@ -73,9 +73,11 @@
(defun emacs-news--mode-common ()
(setq-local font-lock-defaults '(emacs-news-mode-font-lock-keywords t))
- (setq-local outline-regexp "\\(:? +\\)?\\(\\*+\\) "
+ ;; This `outline-regexp' matches leading spaces inserted
+ ;; by the current implementation of `outline-minor-mode-use-buttons'.
+ (setq-local outline-regexp "\\(?: +\\)?\\(\\*+\\) "
+ outline-level (lambda () (length (match-string 1)))
outline-minor-mode-cycle t
- outline-level (lambda () (length (match-string 2)))
outline-minor-mode-highlight 'append)
(outline-minor-mode)
(emacs-etc--hide-local-variables))
From e1c4ed9a3e70d4ed7162a77103d034deef428452 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Tue, 30 Aug 2022 20:20:40 +0300
Subject: [PATCH 034/915] ; Improve doc string of
'describe-char-fold-equivalences'
* lisp/char-fold.el (describe-char-fold-equivalences): Autoload
it. Doc fix.
---
lisp/char-fold.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lisp/char-fold.el b/lisp/char-fold.el
index ce395ddaab0..4e3aa058fcb 100644
--- a/lisp/char-fold.el
+++ b/lisp/char-fold.el
@@ -428,12 +428,15 @@ BOUND NOERROR COUNT are passed to `re-search-backward'."
(re-search-backward (char-fold-to-regexp string) bound noerror count))
+;;;###autoload
(defun describe-char-fold-equivalences (char &optional lax)
- "Display characters equivalent to CHAR.
-Prompt for CHAR. With no input, i.e. when CHAR is nil, by default
+ "Display characters equivalent to CHAR under character-folding.
+Prompt for CHAR (using `read-char-by-name', which see for how can
+you specify the character). With no input, i.e. when CHAR is nil,
describe all available character equivalences of `char-fold-to-regexp'.
-Interactively, a prefix arg means also include partially matching
-ligatures."
+Optional argument LAX (interactively, the prefix argument), if
+non-nil, means also include partially matching ligatures and
+non-canonical equivalences."
(interactive (list (ignore-errors
(read-char-by-name
"Character (Unicode name or hex, default all): "))
From 292703d64b95156881a5a4d0ba59902a84d4734c Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Tue, 30 Aug 2022 19:35:14 +0200
Subject: [PATCH 035/915] ; * lisp/doc-view.el (doc-view): Fix punctuation.
---
lisp/doc-view.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 29da3b42977..aa0f9fd3838 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -153,7 +153,7 @@
"In-buffer document viewer.
The viewer handles PDF, PostScript, DVI, DJVU, ODF, EPUB, CBZ,
FB2, XPS and OXPS files, if the appropriate converter programs
-are available (see Info node `(emacs)Document View')"
+are available (see Info node `(emacs)Document View')."
:link '(function-link doc-view)
:version "22.2"
:group 'applications
From 1feec84b0f9f100547d428315c74a542228667e4 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Tue, 30 Aug 2022 21:31:17 +0200
Subject: [PATCH 036/915] ; Minor doc fix in Viper
* lisp/emulation/viper-macs.el (viper-repeat-from-history-key):
Minor doc fix.
---
lisp/emulation/viper-macs.el | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el
index 06130afa7da..9c2aae1fe9f 100644
--- a/lisp/emulation/viper-macs.el
+++ b/lisp/emulation/viper-macs.el
@@ -66,9 +66,8 @@
The previous command is accessible, as usual, via `.'. The command before this
can be invoked as ` 1', and the command before that, and the command
before that one is accessible as ` 2'.
-The notation for these keys is borrowed from XEmacs. Basically,
-a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
-`(meta control f1)'."
+Basically, a key is a symbol, e.g., `a', `\\1', `f2', etc., or a
+list, e.g., `(meta control f1)'."
:type 'sexp
:group 'viper)
From 8807a4f53204674a796cb2db73716e09736b548e Mon Sep 17 00:00:00 2001
From: Gregory Heytings
Date: Tue, 30 Aug 2022 21:03:01 +0000
Subject: [PATCH 037/915] Enable 256 colors in fbterm.
* lisp/term/fbterm.el: New file.
* doc/misc/efaq.texi (Emacs in a Linux console): Document the TERM
environment variable with which the new file is used.
---
doc/misc/efaq.texi | 20 ++++++++++++++++----
lisp/term/fbterm.el | 27 +++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 4 deletions(-)
create mode 100644 lisp/term/fbterm.el
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 2da37a1d215..32fdcb80586 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -3047,23 +3047,35 @@ $ fc-list :spacing=mono family | sed 's/ /\\ /g'
You can now start Emacs inside @command{fbterm} with the command
+@example
+$ fbterm -- env TERM=fbterm emacs
+@end example
+
+In some versions of @command{fbterm}, setting @env{TERM} to
+@samp{fbterm} can be omitted. To check whether it is needed, start
+Emacs inside @command{fbterm} with the command
+
@example
$ fbterm -- emacs
@end example
+@noindent
+and type @kbd{M-x list-colors-display}. If only 8 colors are
+displayed, it is necessary; if 256 colors are displayed, it isn't.
+
You may want to add an alias for that command in your shell
configuration file. For example, if you use Bash, you can add the
following line to your @file{~/.bashrc} file:
@example
-alias emacs="fbterm -- emacs"
+alias emacs="fbterm -- env TERM=fbterm emacs"
@end example
@noindent
or, if you use Emacs both in the Linux console and under X:
@example
-[[ "$(tty)" =~ "/dev/tty" ]] && alias emacs="fbterm -- emacs"
+[[ "$(tty)" =~ "/dev/tty" ]] && alias emacs="fbterm -- env TERM=fbterm emacs"
@end example
The @command{fbterm} terminal emulator may define a number of key
@@ -3082,7 +3094,7 @@ start Emacs inside @command{fbterm} as root while ensuring that
@command{fbterm} does not define any key bindings for its own use:
@example
-# capsh --drop=cap_sys_tty_config -- -c "fbterm -- emacs"
+# capsh --drop=cap_sys_tty_config -- -c "fbterm -- env TERM=fbterm emacs"
@end example
Again you may want to add a shortcut for that command in the shell
@@ -3096,7 +3108,7 @@ you use Bash, you can add the following function in the root user
@example
function emacs ()
@{
- CMD="fbterm -- emacs "
+ CMD="fbterm -- env TERM=fbterm emacs "
for ARG in "$@@"
do
CMD="$CMD '$ARG' "
diff --git a/lisp/term/fbterm.el b/lisp/term/fbterm.el
new file mode 100644
index 00000000000..ad7150c1a1f
--- /dev/null
+++ b/lisp/term/fbterm.el
@@ -0,0 +1,27 @@
+;;; fbterm.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Note that, in some versions of fbterm, the TERM environment
+;; variable is set to "linux". When that's the case, the code below
+;; will not be executed, and only 8 colors will be available. It is
+;; therefore necessary, with these versions of fbterm, to set that
+;; environment variable to "fbterm" to enable its 256 color mode
+;; extension. See also the node "Emacs in a Linux console" of the
+;; Emacs FAQ.
+
+(require 'term/xterm)
+
+(defun terminal-init-fbterm ()
+ "Terminal initialization function for fbterm."
+
+ ;; fbterm can't display underlines, even though its terminfo data
+ ;; says it can.
+ (tty-no-underline)
+
+ ;; fbterm supports xterm's 256 color mode extension.
+ (xterm-register-default-colors xterm-standard-colors))
+
+(provide 'term/fbterm)
+
+;;; fbterm.el ends here
From a28ede3a61a70cf83dfcba6c9d314fbb051a3a94 Mon Sep 17 00:00:00 2001
From: Stefan Monnier
Date: Tue, 30 Aug 2022 17:55:03 -0400
Subject: [PATCH 038/915] t-mouse.el: Make sure we apply the setting to new
terminals
* lisp/t-mouse.el (gpm-mouse-tty-setup): New function.
(gpm-mouse-mode): Use it as well as `tty-setup-hook`.
* lisp/term/linux.el (terminal-init-linux): Remove gpm-specific code,
not neded any more.
---
lisp/t-mouse.el | 7 ++++++-
lisp/term/linux.el | 2 --
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el
index cdfc30c8793..7a4e7f330ea 100644
--- a/lisp/t-mouse.el
+++ b/lisp/t-mouse.el
@@ -62,6 +62,9 @@
(gpm-mouse-stop))
(set-terminal-parameter nil 'gpm-mouse-active nil))
+(defun gpm-mouse-tty-setup ()
+ (if gpm-mouse-mode (gpm-mouse-enable) (gpm-mouse-disable)))
+
;;;###autoload
(define-minor-mode gpm-mouse-mode
"Toggle mouse support in GNU/Linux consoles (GPM Mouse mode).
@@ -80,7 +83,9 @@ GPM. This is due to limitations in GPM and the Linux kernel."
(terminal-parameter terminal 'gpm-mouse-active))))
;; Simulate selecting a terminal by selecting one of its frames ;-(
(with-selected-frame (car (frames-on-display-list terminal))
- (if gpm-mouse-mode (gpm-mouse-enable) (gpm-mouse-disable))))))
+ (gpm-mouse-tty-setup))))
+ (when gpm-mouse-mode
+ (add-hook 'tty-setup-hook #'gpm-mouse-tty-setup)))
(provide 't-mouse)
diff --git a/lisp/term/linux.el b/lisp/term/linux.el
index ab5a6d8698f..60bf91fcf52 100644
--- a/lisp/term/linux.el
+++ b/lisp/term/linux.el
@@ -15,8 +15,6 @@
;; Compositions confuse cursor movement.
(setq-default auto-composition-mode "linux")
- (ignore-errors (when gpm-mouse-mode (require 't-mouse) (gpm-mouse-enable)))
-
;; Don't translate ESC TAB to backtab as directed
;; by ncurses-6.3.
(define-key input-decode-map "\e\t" nil)
From 5bedef8f87d2103e21342a06c4c1c9d7efe06621 Mon Sep 17 00:00:00 2001
From: Po Lu
Date: Wed, 31 Aug 2022 09:44:13 +0800
Subject: [PATCH 039/915] Fix bug#57476
* src/xterm.c (handle_one_xevent): Don't reset valuators on certain
crossing events, for the benefit of xfwm4. (bug#57476)
---
src/xterm.c | 31 ++++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index e0a8e13b24e..3c05bc7807d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -20771,8 +20771,20 @@ handle_one_xevent (struct x_display_info *dpyinfo,
any = x_any_window_to_frame (dpyinfo, enter->event);
#ifdef HAVE_XINPUT2_1
- xi_reset_scroll_valuators_for_device_id (dpyinfo, enter->deviceid,
- true);
+ /* xfwm4 selects for button events on the frame window,
+ resulting in passive grabs being generated along with
+ the delivery of emulated button events; this then
+ interferes with scrolling, since device valuators
+ will constantly be reset as the crossing events
+ related to those grabs arrive. The only way to
+ remedy this is to never reset scroll valuators on a
+ grab-related crossing event. (bug#57476) */
+ if (enter->mode != XINotifyUngrab
+ && enter->mode != XINotifyGrab
+ && enter->mode != XINotifyPassiveGrab
+ && enter->mode != XINotifyPassiveUngrab)
+ xi_reset_scroll_valuators_for_device_id (dpyinfo, enter->deviceid,
+ true);
#endif
{
@@ -20888,7 +20900,20 @@ handle_one_xevent (struct x_display_info *dpyinfo,
moves out of a frame (and not into one of its
children, which we know about). */
#ifdef HAVE_XINPUT2_1
- if (leave->detail != XINotifyInferior && any)
+ if (leave->detail != XINotifyInferior && any
+ /* xfwm4 selects for button events on the frame
+ window, resulting in passive grabs being
+ generated along with the delivery of emulated
+ button events; this then interferes with
+ scrolling, since device valuators will constantly
+ be reset as the crossing events related to those
+ grabs arrive. The only way to remedy this is to
+ never reset scroll valuators on a grab-related
+ crossing event. (bug#57476) */
+ && leave->mode != XINotifyUngrab
+ && leave->mode != XINotifyGrab
+ && leave->mode != XINotifyPassiveUngrab
+ && leave->mode != XINotifyPassiveGrab)
xi_reset_scroll_valuators_for_device_id (dpyinfo,
leave->deviceid, false);
#endif
From 136495f178ccd36b23ffc347fe2b6680fd689e34 Mon Sep 17 00:00:00 2001
From: Po Lu
Date: Wed, 31 Aug 2022 10:17:20 +0800
Subject: [PATCH 040/915] Gently nudge Xt into always setting size hints
* src/widget.c (update_wm_hints): Force a resource to change
every time this function is called. (bug#57475)
(EmacsFrameInitialize): Initialize new field.
* src/widgetprv.h (EmacsFramePart): New field `size_switch'.
* src/xterm.c (x_wm_set_size_hint): Don't change flags if flags
is 0.
---
src/widget.c | 16 ++++++++++------
src/widgetprv.h | 2 ++
src/xterm.c | 7 +++++--
3 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/src/widget.c b/src/widget.c
index b125b4caeed..5a75cdaca8e 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -292,18 +292,20 @@ update_wm_hints (Widget wmshell, EmacsFrame ew)
base_height = (wmshell->core.height - ew->core.height
+ (rounded_height - (char_height * ch)));
- /* This is kind of sleazy, but I can't see how else to tell it to
- make it mark the WM_SIZE_HINTS size as user specified.
- */
-/* ((WMShellWidget) wmshell)->wm.size_hints.flags |= USSize;*/
+ /* Ensure that Xt actually sets window manager hint flags specified
+ by the caller by making sure XtNminWidth (a relatively harmless
+ resource) always changes each time this function is invoked. */
+ ew->emacs_frame.size_switch = !ew->emacs_frame.size_switch;
XtVaSetValues (wmshell,
XtNbaseWidth, (XtArgVal) base_width,
XtNbaseHeight, (XtArgVal) base_height,
XtNwidthInc, (XtArgVal) (frame_resize_pixelwise ? 1 : cw),
XtNheightInc, (XtArgVal) (frame_resize_pixelwise ? 1 : ch),
- XtNminWidth, (XtArgVal) base_width,
- XtNminHeight, (XtArgVal) base_height,
+ XtNminWidth, (XtArgVal) (base_width
+ + ew->emacs_frame.size_switch),
+ XtNminHeight, (XtArgVal) (base_height
+ + ew->emacs_frame.size_switch),
NULL);
}
@@ -355,6 +357,8 @@ EmacsFrameInitialize (Widget request, Widget new,
exit (1);
}
+ ew->emacs_frame.size_switch = 1;
+
update_from_various_frame_slots (ew);
set_frame_size (ew);
}
diff --git a/src/widgetprv.h b/src/widgetprv.h
index 960f814e16f..fe960326b03 100644
--- a/src/widgetprv.h
+++ b/src/widgetprv.h
@@ -49,6 +49,8 @@ typedef struct {
Boolean visual_bell; /* flash instead of beep */
int bell_volume; /* how loud is beep */
+ int size_switch; /* hack to make setting size
+ hints work correctly */
/* private state */
diff --git a/src/xterm.c b/src/xterm.c
index 3c05bc7807d..e8c56d68ea8 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -27484,8 +27484,11 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
eassert (XtIsWMShell (f->output_data.x->widget));
shell = (WMShellWidget) f->output_data.x->widget;
- shell->wm.size_hints.flags &= ~(PPosition | USPosition);
- shell->wm.size_hints.flags |= flags & (PPosition | USPosition);
+ if (flags)
+ {
+ shell->wm.size_hints.flags &= ~(PPosition | USPosition);
+ shell->wm.size_hints.flags |= flags & (PPosition | USPosition);
+ }
if (user_position)
{
From bdcc61247a540699851eb73ea9d4ef3d0a06a92a Mon Sep 17 00:00:00 2001
From: ookami
Date: Wed, 31 Aug 2022 12:10:42 +0200
Subject: [PATCH 041/915] Fix semantic-find-file-noselect binding of
recentf-exclude
* lisp/cedet/semantic/fw.el (semantic-find-file-noselect):
recentf-exclude should be a list (bug#57489).
Copyright-paperwork-exempt: yes
---
lisp/cedet/semantic/fw.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el
index 113323cb339..9917c4c5be6 100644
--- a/lisp/cedet/semantic/fw.el
+++ b/lisp/cedet/semantic/fw.el
@@ -339,7 +339,7 @@ calling this one."
"Call `find-file-noselect' with various features turned off.
Use this when referencing a file that will be soon deleted.
FILE, NOWARN, RAWFILE, and WILDCARDS are passed into `find-file-noselect'."
- (let* ((recentf-exclude #'always)
+ (let* ((recentf-exclude '(always))
;; This is a brave statement. Don't waste time loading in
;; lots of modes. Especially decoration mode can waste a lot
;; of time for a buffer we intend to kill.
From e90d0ea6a9c08e789283e29a7e2505491c8ff80c Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Wed, 31 Aug 2022 19:15:16 +0300
Subject: [PATCH 042/915] ; Fix the lispref manual about seq.el
* doc/lispref/sequences.texi (Sequence Functions): seq.el is
preloaded, so no need to load it manually. (Bug#57505)
---
doc/lispref/sequences.texi | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 39230d0adc4..1f6f80521c0 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -446,8 +446,7 @@ useful example of @code{sort}.
@cindex seq library
@cindex sequences, generalized
The @file{seq.el} library provides the following additional sequence
-manipulation macros and functions, prefixed with @code{seq-}. To use
-them, you must first load the @file{seq} library.
+manipulation macros and functions, prefixed with @code{seq-}.
All functions defined in this library are free of side-effects;
i.e., they do not modify any sequence (list, vector, or string) that
From dbfe57472e4b56c8e9b72b1714492bfb0c005213 Mon Sep 17 00:00:00 2001
From: Robert Pluim
Date: Wed, 31 Aug 2022 18:08:49 +0200
Subject: [PATCH 043/915] Fix describe-char-fold-equivalences for composed
characters
* lisp/char-fold.el (describe-char-fold-equivalences): Map
`get-char-code-property' across all the component codepoints of the
equivalent character rather than just the first one.
---
lisp/char-fold.el | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/lisp/char-fold.el b/lisp/char-fold.el
index 4e3aa058fcb..b2002826f73 100644
--- a/lisp/char-fold.el
+++ b/lisp/char-fold.el
@@ -469,13 +469,18 @@ non-canonical equivalences."
(with-help-window (help-buffer)
(with-current-buffer standard-output
(if char
- (insert (mapconcat
- (lambda (c)
- (format "%s: \?\\N{%s}\n"
- c
- (or (get-char-code-property (string-to-char c) 'name)
- (get-char-code-property (string-to-char c) 'old-name))))
- equivalences))
+ (insert
+ (mapconcat
+ (lambda (c)
+ (format "%s: %s\n"
+ c
+ (mapconcat
+ (lambda (ch)
+ (format "?\\N{%s}"
+ (or (get-char-code-property ch 'name)
+ (get-char-code-property ch 'old-name))))
+ c)))
+ equivalences))
(insert "A list of char-fold equivalences for `char-fold-to-regexp':\n\n")
(setq-local bidi-paragraph-direction 'left-to-right)
(dolist (equiv (nreverse equivalences))
From 71b7ad0cf7dc85b786ba225ff84f842459ba4581 Mon Sep 17 00:00:00 2001
From: Alan Mackenzie
Date: Wed, 31 Aug 2022 18:46:06 +0000
Subject: [PATCH 044/915] C++ Mode: Fontify functions correctly with commas in
template expressions
This fixes bug #57318.
Also apply an optimization which marks generic expressions as already
analyzed, thus avoiding repeating this analysis when not needed. This
optimization prevents the fix slowing down scrolling when the C++ source has
lots of template structures.
* lisp/progmodes/cc-engine.el (top-level) Near the beginning of the file, add
a comment describing the new text property c-<>-c-types-set.
(c-update-brace-stack): Bind c-restricted-<>-arglists to nil rather than t
around the call to c-forward-<>-arglist.
(c-forward-<>-arglist-recur): Allow the abbreviated analysis of a generic
expression also when the opening < is marked with a c-<>-c-types-set text
property. Set this property at the same time as the c-type properties are set
on the commas inside the template structure.
* lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare): Clear the
c-<>-c-types-set text property, along with c-type, from the region being
fontified.
---
lisp/progmodes/cc-engine.el | 14 ++++++++++----
lisp/progmodes/cc-fonts.el | 21 ++++++++++-----------
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index b2d1f15d398..94225d6e3e9 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -142,6 +142,11 @@
;; Put on the brace which introduces a brace list and on the commas
;; which separate the elements within it.
;;
+;; 'c-<>-c-types-set
+;; This property is set on an opening angle bracket, and indicates that
+;; any "," separators within the template/generic expression have been
+;; marked with a 'c-type property value 'c-<>-arg-sep (see above).
+;;
;; 'c-awk-NL-prop
;; Used in AWK mode to mark the various kinds of newlines. See
;; cc-awk.el.
@@ -6137,7 +6142,7 @@ comment at the start of cc-engine.el for more info."
(forward-char))))
(backward-char)
(if (let ((c-parse-and-markup-<>-arglists t)
- (c-restricted-<>-arglists t))
+ c-restricted-<>-arglists)
(c-forward-<>-arglist nil)) ; Should always work.
(when (> (point) to)
(setq bound-<> (point)))
@@ -8505,9 +8510,9 @@ multi-line strings (but not C++, for example)."
arg-start-pos)
;; If the '<' has paren open syntax then we've marked it as an angle
;; bracket arglist before, so skip to the end.
- (if (and (not c-parse-and-markup-<>-arglists)
- syntax-table-prop-on-<)
-
+ (if (and syntax-table-prop-on-<
+ (or (not c-parse-and-markup-<>-arglists)
+ (c-get-char-property (point) 'c-<>-c-types-set)))
(progn
(forward-char)
(if (and (c-go-up-list-forward)
@@ -8604,6 +8609,7 @@ multi-line strings (but not C++, for example)."
(c-unmark-<->-as-paren (point)))))
(c-mark-<-as-paren start)
(c-mark->-as-paren (1- (point)))
+ (c-put-char-property start 'c-<>-c-types-set t)
(c-truncate-lit-pos-cache start))
(setq res t)
nil)) ; Exit the loop.
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 12bb3d37513..f34f7f177db 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -934,17 +934,16 @@ casts and declarations are fontified. Used on level 2 and higher."
(save-excursion
(let ((pos (point)))
(c-backward-syntactic-ws (max (- (point) 500) (point-min)))
- (c-clear-char-properties
- (if (and (not (bobp))
- (memq (c-get-char-property (1- (point)) 'c-type)
- '(c-decl-arg-start
- c-decl-end
- c-decl-id-start
- c-decl-type-start
- c-not-decl)))
- (1- (point))
- pos)
- limit 'c-type)))
+ (when (and (not (bobp))
+ (memq (c-get-char-property (1- (point)) 'c-type)
+ '(c-decl-arg-start
+ c-decl-end
+ c-decl-id-start
+ c-decl-type-start
+ c-not-decl)))
+ (setq pos (1- (point))))
+ (c-clear-char-properties pos limit 'c-type)
+ (c-clear-char-properties pos limit 'c-<>-c-types-set)))
;; Update `c-state-cache' to the beginning of the region. This will
;; make `c-beginning-of-syntax' go faster when it's used later on,
From 612ff133b7720de3a551b433eb8705a6a2bbc037 Mon Sep 17 00:00:00 2001
From: Jim Porter
Date: Wed, 31 Aug 2022 09:47:43 -0700
Subject: [PATCH 045/915] Don't fail Eshell ERT tests when an internal signal
gets raised
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/pipeline-connection-type/middle)
(esh-proc-test/pipeline-connection-type/last): Set 'debug-on-error' to
nil.
Ref: https://lists.gnu.org/archive/html/emacs-devel/2022-08/msg01452.html
---
test/lisp/eshell/esh-proc-tests.el | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/test/lisp/eshell/esh-proc-tests.el b/test/lisp/eshell/esh-proc-tests.el
index 2369bb5cc00..b9f4470be6b 100644
--- a/test/lisp/eshell/esh-proc-tests.el
+++ b/test/lisp/eshell/esh-proc-tests.el
@@ -76,17 +76,23 @@
pipeline."
(skip-unless (and (executable-find "sh")
(executable-find "cat")))
- (eshell-command-result-equal
- (concat "echo | " esh-proc-test--detect-pty-cmd " | cat")
- nil))
+ ;; An `eshell-pipe-broken' signal might occur internally; let Eshell
+ ;; handle it!
+ (let ((debug-on-error nil))
+ (eshell-command-result-equal
+ (concat "echo hi | " esh-proc-test--detect-pty-cmd " | cat")
+ nil)))
(ert-deftest esh-proc-test/pipeline-connection-type/last ()
"Test that only output streams are PTYs when a command ends a pipeline."
(skip-unless (executable-find "sh"))
- (eshell-command-result-equal
- (concat "echo | " esh-proc-test--detect-pty-cmd)
- (unless (eq system-type 'windows-nt)
- "stdout\nstderr\n")))
+ ;; An `eshell-pipe-broken' signal might occur internally; let Eshell
+ ;; handle it!
+ (let ((debug-on-error nil))
+ (eshell-command-result-equal
+ (concat "echo hi | " esh-proc-test--detect-pty-cmd)
+ (unless (eq system-type 'windows-nt)
+ "stdout\nstderr\n"))))
(ert-deftest esh-proc-test/kill-pipeline ()
"Test that killing a pipeline of processes only emits a single
From 2862891387bdb77d8eb514c94587e3b976b03995 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 1 Sep 2022 05:07:06 +0200
Subject: [PATCH 046/915] ; Auto-commit of loaddefs files.
---
lisp/ldefs-boot.el | 84 ++++++++++++++++++++++++++++++++++++----------
1 file changed, 67 insertions(+), 17 deletions(-)
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index 07dfc23a092..b870494477c 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -4004,6 +4004,16 @@ FROM is for internal use. It specifies an index in the STRING
from which to start.
(fn STRING &optional LAX FROM)")
+(autoload 'describe-char-fold-equivalences "char-fold" "\
+Display characters equivalent to CHAR under character-folding.
+Prompt for CHAR (using `read-char-by-name', which see for how can
+you specify the character). With no input, i.e. when CHAR is nil,
+describe all available character equivalences of `char-fold-to-regexp'.
+Optional argument LAX (interactively, the prefix argument), if
+non-nil, means also include partially matching ligatures and
+non-canonical equivalences.
+
+(fn CHAR &optional LAX)" t)
(register-definition-prefixes "char-fold" '("char-fold-"))
@@ -5020,6 +5030,8 @@ evaluate `compilation-shell-minor-mode'.
The mode's hook is called both when the mode is enabled and when
it is disabled.
+\\{compilation-shell-minor-mode-map}
+
(fn &optional ARG)" t)
(autoload 'compilation-minor-mode "compile" "\
Toggle Compilation minor mode.
@@ -5043,6 +5055,8 @@ evaluate `compilation-minor-mode'.
The mode's hook is called both when the mode is enabled and when
it is disabled.
+\\{compilation-minor-mode-map}
+
(fn &optional ARG)" t)
(autoload 'compilation-next-error-function "compile" "\
Advance to the next error message and visit the file where the error was.
@@ -7242,6 +7256,7 @@ The mode's hook is called both when the mode is enabled and when
it is disabled.
(fn &optional ARG)" t)
+(autoload 'diff-vc-deduce-fileset "diff-mode")
(register-definition-prefixes "diff-mode" '("diff-"))
@@ -8389,7 +8404,7 @@ A second call of this function without changing point inserts the next match.
A call with prefix PREFIX reads the symbol to insert from the minibuffer with
completion.
-(fn PREFIX)" '("P"))
+(fn PREFIX)" t)
(autoload 'ebrowse-tags-loop-continue "ebrowse" "\
Repeat last operation on files in tree.
FIRST-TIME non-nil means this is not a repetition, but the first time.
@@ -9172,8 +9187,7 @@ the mode if ARG is nil, omitted, or is a positive number.
Disable the mode if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
-evaluate `(buffer-local-value \\='electric-pair-mode
-(current-buffer))'.
+evaluate `electric-pair-mode'.
The mode's hook is called both when the mode is enabled and when
it is disabled.
@@ -9937,7 +9951,7 @@ When present, ID should be an opaque object used to identify the
connection unequivocally. This is rarely needed and not available
interactively.
-(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) ID)" '((erc-select-read-args)))
+(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) ID)" t)
(defalias 'erc-select #'erc)
(autoload 'erc-tls "erc" "\
ERC is a powerful, modular, and extensible IRC client.
@@ -9984,7 +9998,7 @@ symbol composed of letters from the Latin alphabet.) This option is
generally unneeded, however. See info node `(erc) Connecting' for use
cases. Not available interactively.
-(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) CLIENT-CERTIFICATE ID)" '((let ((erc-default-port erc-default-port-tls)) (erc-select-read-args))))
+(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) CLIENT-CERTIFICATE ID)" t)
(autoload 'erc-handle-irc-url "erc" "\
Use ERC to IRC on HOST:PORT in CHANNEL as USER with PASSWORD.
If ERC is already connected to HOST:PORT, simply /join CHANNEL.
@@ -10200,7 +10214,9 @@ it has to be wrapped in `(eval (quote ...))'.
If NAME is already defined as a test and Emacs is running
in batch mode, an error is signalled.
-(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil 'macro)
+(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil t)
+(function-put 'ert-deftest 'doc-string-elt 3)
+(function-put 'ert-deftest 'lisp-indent-function 2)
(autoload 'ert-run-tests-batch "ert" "\
Run the tests specified by SELECTOR, printing results to the terminal.
@@ -12271,6 +12287,8 @@ evaluate `flymake-mode'.
The mode's hook is called both when the mode is enabled and when
it is disabled.
+\\{flymake-mode-map}
+
(fn &optional ARG)" t)
(autoload 'flymake-mode-on "flymake" "\
Turn Flymake mode on.")
@@ -14186,7 +14204,9 @@ include it when specifying `grep-command'.
In interactive usage, the actual value of this variable is set up
by `grep-compute-defaults'; to change the default value, use
-\\[customize] or call the function `grep-apply-setting'.")
+\\[customize] or call the function `grep-apply-setting'.
+
+Also see `grep-command-position'.")
(custom-autoload 'grep-command "grep" nil)
(defvar grep-find-command nil "\
The default find command for \\[grep-find].
@@ -15394,7 +15414,9 @@ it is disabled.
(defvar hs-special-modes-alist (mapcar 'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil) (mhtml-mode "{\\|<[^/>]*?" "}\\|[^/>]*[^/]>" "
+
+
+Updated:
+
+$Date: %s $
+
+
+
+"
+ copyright-years
+ ;; e.g. "2022/09/13 09:13:13"
+ (format-time-string "%Y/%M/%y %H:%m:%S"))))
+ ;; Actually export.
+ (org-html-export-to-html)
+ ;; Kill the .org buffer.
+ (kill-buffer (current-buffer))
+ ;; Move file into place.
+ (let ((old (expand-file-name html-file dir))
+ (new (expand-file-name html-file (expand-file-name "etc" root))))
+ (delete-file new)
+ (copy-file old new)
+ (find-file new))))
+ (delete-directory dir t))))
+
;; Stuff to check new `defcustom's got :version tags.
;; Adapted from check-declare.el.
From b525f201ba9f4f8862059a49947874a2bfa0d2f1 Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Wed, 14 Sep 2022 20:21:54 +0200
Subject: [PATCH 364/915] Allow specifying the color to use in image-elide
* lisp/image/image-crop.el (image-crop-elide-command): Adjust to
allow specifying the color.
(image-elide): Prompt for a color.
(image-crop--crop-image-update): Pass the color along.
---
lisp/image/image-crop.el | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el
index a88b8ed842e..64db226d50e 100644
--- a/lisp/image/image-crop.el
+++ b/lisp/image/image-crop.el
@@ -48,7 +48,8 @@ The following `format-spec' elements are allowed:
:version "29.1")
(defcustom image-crop-elide-command '("convert" "-draw" "rectangle %l,%t %r,%b"
- "-" "%f:-")
+ "-fill" "%c"
+ "-" "%f:-")
"Command to make a rectangle inside an image.
The following `format-spec' elements are allowed:
@@ -56,12 +57,13 @@ The following `format-spec' elements are allowed:
%t: Top.
%r: Right.
%b: Bottom.
+%c: Color.
%f: Result file type."
:type '(repeat string)
:version "29.1")
(defcustom image-crop-crop-command '("convert" "+repage" "-crop" "%wx%h+%l+%t"
- "-" "%f:-")
+ "-" "%f:-")
"Command to crop an image.
The following `format-spec' elements are allowed:
@@ -97,12 +99,17 @@ original buffer text, and the second parameter is the cropped
image data.")
;;;###autoload
-(defun image-elide (&optional square)
+(defun image-elide (color &optional square)
"Elide a square from the image under point.
If SQUARE (interactively, the prefix), elide a square instead of a
-rectangle from the image."
- (interactive "P")
- (image-crop square t))
+rectangle from the image.
+
+Interatively, the user will be prompted for the color to use, and
+defaults to black."
+ (interactive (list (read-color "Use color: ")
+ current-prefix-arg))
+ (image-crop square (if (string-empty-p color)
+ "black" color)))
;;;###autoload
(defun image-crop (&optional square elide)
@@ -111,7 +118,8 @@ If SQUARE (interactively, the prefix), crop a square instead of a
rectangle from the image.
If ELIDE, remove a rectangle from the image instead of cropping
-the image.
+the image. In that case ELIDE, should be the name of a color to
+use.
After cropping an image, it can be saved by `M-x image-save' or
\\\\[image-save] when point is over the image."
@@ -217,6 +225,7 @@ After cropping an image, it can be saved by `M-x image-save' or
(?t . ,top)
(?r . ,(+ left width))
(?b . ,(+ top height))
+ (?c . ,elide)
(?f . ,(cadr (split-string type "/")))))
(image-crop--process image-crop-crop-command
`((?l . ,left)
From 7e6923017163561d1b8cedf15aac42e01e493aee Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Wed, 14 Sep 2022 21:37:50 +0300
Subject: [PATCH 365/915] ; * lisp/image/image-crop.el (image-elide,
image-crop): Doc fixes.
---
lisp/image/image-crop.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el
index 64db226d50e..7716efcd543 100644
--- a/lisp/image/image-crop.el
+++ b/lisp/image/image-crop.el
@@ -100,12 +100,11 @@ image data.")
;;;###autoload
(defun image-elide (color &optional square)
- "Elide a square from the image under point.
-If SQUARE (interactively, the prefix), elide a square instead of a
-rectangle from the image.
+ "Elide a rectangle from the image under point, filling it with COLOR.
+If SQUARE is non-nil (interactively, prefix arg), elide a square
+instead of a rectangle from the image.
-Interatively, the user will be prompted for the color to use, and
-defaults to black."
+Interactively, prompt for COLOR to use, defaulting to black."
(interactive (list (read-color "Use color: ")
current-prefix-arg))
(image-crop square (if (string-empty-p color)
@@ -114,14 +113,14 @@ defaults to black."
;;;###autoload
(defun image-crop (&optional square elide)
"Crop the image under point.
-If SQUARE (interactively, the prefix), crop a square instead of a
-rectangle from the image.
+If SQUARE is non-nil (interactively, prefix arg), crop a square
+instead of a rectangle from the image.
-If ELIDE, remove a rectangle from the image instead of cropping
-the image. In that case ELIDE, should be the name of a color to
-use.
+If ELIDE is non-nil, remove a rectangle/square from the image
+instead of cropping the image. In that case ELIDE should be
+the name of a color to fill the rectangle.
-After cropping an image, it can be saved by `M-x image-save' or
+After cropping an image, you can save it by `M-x image-save' or
\\\\[image-save] when point is over the image."
(interactive "P")
(unless (image-type-available-p 'svg)
From 05971d2b8d47e69e9585d0d6066b8a607555aa48 Mon Sep 17 00:00:00 2001
From: Augusto Stoffel
Date: Wed, 14 Sep 2022 20:11:28 +0200
Subject: [PATCH 366/915] ; * src/emacs.c (usage_message): Remove stray tabs.
---
src/emacs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/emacs.c b/src/emacs.c
index 3c768412818..91bf0a9b59e 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -299,7 +299,7 @@ Initialization options:\n\
-x to be used in #!/usr/bin/emacs -x\n\
and has approximately the same meaning\n\
as -Q --script\n\
---terminal, -t DEVICE use DEVICE for terminal I/O\n \
+--terminal, -t DEVICE use DEVICE for terminal I/O\n\
--user, -u USER load ~USER/.emacs instead of your own\n\
\n\
",
From a9941269683fe50673d0aa81feefb7a9d3d8a6b9 Mon Sep 17 00:00:00 2001
From: Augusto Stoffel
Date: Thu, 8 Sep 2022 11:09:42 +0200
Subject: [PATCH 367/915] pcomplete: Generate completions from --help messages
* lisp/pcomplete.el (pcomplete-from-help): New function (and hash
table) to get pcomplete candidates from help messages.
(pcomplete-here-using-help): Helper function to define pcomplete for
simple commands
(pcomplete-completions-at-point): Provide annotation-function and
company-docsig properties.
* lisp/pcmpl-git.el: New file, provides pcomplete for Git.
* lisp/pcmpl-gnu.el: Add pcomplete for awk, gpg and gdb, emacs and
emacsclient.
* lisp/pcmpl-linux.el: Add pcomplete for systemctl and journalctl.
* lisp/pcmpl-rpm.el: Add pcomplete for dnf.
* lisp/pcmpl-unix.el: Add pcomplete for sudo and most commands found
in GNU Coreutils.
* lisp/pcmpl-x.el: Add pcomplete for tex, pdftex, latex, pdflatex,
rigrep and rclone.
* test/lisp/pcomplete-tests.el (pcomplete-test-parse-gpg-help,
pcomplete-test-parse-git-help): Tests for the new functions.
---
lisp/pcmpl-git.el | 110 ++++++++
lisp/pcmpl-gnu.el | 36 ++-
lisp/pcmpl-linux.el | 68 +++++
lisp/pcmpl-rpm.el | 43 ++-
lisp/pcmpl-unix.el | 490 +++++++++++++++++++++++++++++++++--
lisp/pcmpl-x.el | 43 +++
lisp/pcomplete.el | 138 ++++++++++
test/lisp/pcomplete-tests.el | 100 +++++++
8 files changed, 1004 insertions(+), 24 deletions(-)
create mode 100644 lisp/pcmpl-git.el
create mode 100644 test/lisp/pcomplete-tests.el
diff --git a/lisp/pcmpl-git.el b/lisp/pcmpl-git.el
new file mode 100644
index 00000000000..3584fa06732
--- /dev/null
+++ b/lisp/pcmpl-git.el
@@ -0,0 +1,110 @@
+;;; pcmpl-git.el --- Completions for Git -*- lexical-binding: t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Package: pcomplete
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see .
+
+;;; Commentary:
+
+;; This library provides completion rules for the Git program.
+
+;;; Code:
+
+(require 'pcomplete)
+(require 'vc-git)
+
+(defun pcmpl-git--expand-flags (args)
+ "In the list of ARGS, expand arguments of the form --[no-]flag."
+ (mapcan (lambda (arg) (if (string-search "[no-]" arg)
+ (list (string-replace "[no-]" "" arg)
+ (string-replace "[no-]" "no-" arg))
+ (list arg)))
+ args))
+
+(defun pcmpl-git--tracked-file-predicate (&rest args)
+ "Return a predicate function determining the Git status of a file.
+Files listed by `git ls-files ARGS' satisfy the predicate."
+ (when-let ((files (mapcar #'expand-file-name
+ (ignore-errors
+ (apply #'process-lines
+ vc-git-program "ls-files" args)))))
+ (lambda (file)
+ (setq file (expand-file-name file))
+ (if (string-suffix-p "/" file)
+ (seq-some (lambda (f) (string-prefix-p file f))
+ files)
+ (member file files)))))
+
+(defun pcmpl-git--remote-refs (remote)
+ "List the locally known Git revisions from REMOTE."
+ (delq nil
+ (mapcar
+ (let ((re (concat "\\`" (regexp-quote remote) "/\\(.*\\)")))
+ (lambda (s) (when (string-match re s) (match-string 1 s))))
+ (vc-git-revision-table nil))))
+
+;;;###autoload
+(defun pcomplete/git ()
+ "Completion for the `git' command."
+ (let ((subcommands (pcomplete-from-help `(,vc-git-program "help" "-a")
+ :margin "^\\( +\\)[a-z]"
+ :argument "[[:alnum:]-]+")))
+ (while (not (member (pcomplete-arg 1) subcommands))
+ (if (string-prefix-p "-" (pcomplete-arg))
+ (pcomplete-here (pcomplete-from-help `(,vc-git-program "help")
+ :margin "\\(\\[\\)-"
+ :separator " | "
+ :description "\\`"))
+ (pcomplete-here (completion-table-merge
+ subcommands
+ (when (string-prefix-p "-" (pcomplete-arg 1))
+ (pcomplete-entries))))))
+ (let ((subcmd (pcomplete-arg 1)))
+ (while (pcase subcmd
+ ((guard (string-prefix-p "-" (pcomplete-arg)))
+ (pcomplete-here
+ (pcmpl-git--expand-flags
+ (pcomplete-from-help `(,vc-git-program "help" ,subcmd)
+ :argument
+ "-+\\(?:\\[no-\\]\\)?[a-z-]+=?"))))
+ ;; Complete modified tracked files
+ ((or "add" "commit" "restore")
+ (pcomplete-here
+ (pcomplete-entries
+ nil (pcmpl-git--tracked-file-predicate "-m"))))
+ ;; Complete all tracked files
+ ((or "mv" "rm" "grep" "status")
+ (pcomplete-here
+ (pcomplete-entries nil (pcmpl-git--tracked-file-predicate))))
+ ;; Complete revisions
+ ((or "branch" "merge" "rebase" "switch")
+ (pcomplete-here (vc-git-revision-table nil)))
+ ;; Complete revisions and tracked files
+ ;; TODO: diff and log accept revision ranges
+ ((or "checkout" "reset" "show" "diff" "log")
+ (pcomplete-here
+ (completion-table-in-turn
+ (vc-git-revision-table nil)
+ (pcomplete-entries nil (pcmpl-git--tracked-file-predicate)))))
+ ;; Complete remotes and their revisions
+ ((or "fetch" "pull" "push")
+ (pcomplete-here (process-lines vc-git-program "remote"))
+ (pcomplete-here (pcmpl-git--remote-refs (pcomplete-arg 1)))))))))
+
+(provide 'pcmpl-git)
+;;; pcmpl-git.el ends here
diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el
index 3c9bf1ec9d2..cdfde5640a7 100644
--- a/lisp/pcmpl-gnu.el
+++ b/lisp/pcmpl-gnu.el
@@ -394,6 +394,40 @@ Return the new list."
(while (pcomplete-here (pcomplete-dirs) nil #'identity))))
;;;###autoload
-(defalias 'pcomplete/gdb 'pcomplete/xargs)
+(defun pcomplete/awk ()
+ "Completion for the `awk' command."
+ (pcomplete-here-using-help "awk --help"
+ :margin "\t"
+ :separator " +"
+ :description "\0"
+ :metavar "[=a-z]+"))
+
+;;;###autoload
+(defun pcomplete/gpg ()
+ "Completion for the `gpg` command."
+ (pcomplete-here-using-help "gpg --help" :narrow-end "^ -se"))
+
+;;;###autoload
+(defun pcomplete/gdb ()
+ "Completion for the `gdb' command."
+ (while
+ (cond
+ ((string= "--args" (pcomplete-arg 1))
+ (funcall pcomplete-command-completion-function)
+ (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
+ pcomplete-default-completion-function)))
+ ((string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "gdb --help")))
+ (t (pcomplete-here (pcomplete-entries))))))
+
+;;;###autoload
+(defun pcomplete/emacs ()
+ "Completion for the `emacs' command."
+ (pcomplete-here-using-help "emacs --help" :margin "^\\(\\)-"))
+
+;;;###autoload
+(defun pcomplete/emacsclient ()
+ "Completion for the `emacsclient' command."
+ (pcomplete-here-using-help "emacsclient --help" :margin "^\\(\\)-"))
;;; pcmpl-gnu.el ends here
diff --git a/lisp/pcmpl-linux.el b/lisp/pcmpl-linux.el
index 7c072f3d40c..023c655a2a8 100644
--- a/lisp/pcmpl-linux.el
+++ b/lisp/pcmpl-linux.el
@@ -30,6 +30,7 @@
(provide 'pcmpl-linux)
(require 'pcomplete)
+(eval-when-compile (require 'rx))
;; Functions:
@@ -111,4 +112,71 @@ Test is done using `equal'."
(pcomplete-uniquify-list points)
(cons "swap" (pcmpl-linux-mounted-directories))))))
+;;; systemd
+
+(defun pcmpl-linux--systemd-units (&rest args)
+ "Run `systemd list-units ARGS' and return the output as a list."
+ (with-temp-buffer
+ (apply #'call-process
+ "systemctl" nil '(t nil) nil
+ "list-units" "--full" "--legend=no" "--plain" args)
+ (goto-char (point-min))
+ (let (result)
+ (while (re-search-forward (rx bol (group (+ (not space)))
+ (+ space) (+ (not space))
+ (+ space) (group (+ (not space)))
+ (+ space) (+ (not space))
+ (+ space) (group (* nonl)))
+ nil t)
+ (push (match-string 1) result)
+ (put-text-property 0 1 'pcomplete-annotation
+ (concat " " (match-string 2))
+ (car result))
+ (put-text-property 0 1 'pcomplete-description
+ (match-string 3)
+ (car result)))
+ (nreverse result))))
+
+;;;###autoload
+(defun pcomplete/systemctl ()
+ "Completion for the `systemctl' command."
+ (let ((subcmds (pcomplete-from-help
+ "systemctl --help"
+ :margin (rx bol " " (group) alpha)
+ :argument (rx (+ (any alpha ?-)))
+ :metavar (rx (group (+ " " (>= 2 (any upper "[]|."))))))))
+ (while (not (member (pcomplete-arg 1) subcmds))
+ (if (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "systemctl --help"
+ :metavar "[^ ]+"
+ :separator " \\(\\)-"))
+ (pcomplete-here subcmds)))
+ (let ((subcmd (pcomplete-arg 1))
+ (context (if (member "--user" pcomplete-args) "--user" "--system")))
+ (while (pcase subcmd
+ ((guard (string-prefix-p "-" (pcomplete-arg 0)))
+ (pcomplete-here
+ (pcomplete-from-help "systemctl --help")))
+ ;; TODO: suggest only relevant units to each subcommand
+ ("start"
+ (pcomplete-here
+ (pcmpl-linux--systemd-units context "--state" "inactive,failed")))
+ ((or "restart" "stop")
+ (pcomplete-here
+ (pcmpl-linux--systemd-units context "--state" "active")))
+ (_ (pcomplete-here
+ (completion-table-in-turn
+ (pcmpl-linux--systemd-units context "--all")
+ (pcomplete-entries)))))))))
+
+;;;###autoload
+(defun pcomplete/journalctl ()
+ "Completion for the `journalctl' command."
+ (while (if (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "journalctl --help"
+ :metavar "[^ ]+"
+ :separator " \\(\\)-"))
+ (pcomplete-here (mapcar (lambda (s) (concat s "="))
+ (process-lines "journalctl" "--fields"))))))
+
;;; pcmpl-linux.el ends here
diff --git a/lisp/pcmpl-rpm.el b/lisp/pcmpl-rpm.el
index f7925d9d9ec..ebb6b72600c 100644
--- a/lisp/pcmpl-rpm.el
+++ b/lisp/pcmpl-rpm.el
@@ -21,7 +21,8 @@
;;; Commentary:
-;; These functions provide completion rules for the `rpm' command.
+;; These functions provide completion rules for the `rpm' command and
+;; related tools.
;;; Code:
@@ -378,6 +379,46 @@
(t
(error "You must select a mode: -q, -i, -U, --verify, etc"))))))
+;;; DNF
+
+(defvar pcmpl-rpm-dnf-cache-file "/var/cache/dnf/packages.db"
+ "Location of the DNF cache.")
+
+(defun pcmpl-rpm--dnf-packages (status)
+ (when (and (file-exists-p pcmpl-rpm-dnf-cache-file)
+ (executable-find "sqlite3"))
+ (with-temp-message
+ "Getting list of packages..."
+ (process-lines "sqlite3" "-batch" "-init" "/dev/null"
+ pcmpl-rpm-dnf-cache-file
+ (pcase-exhaustive status
+ ('available "select pkg from available")
+ ('installed "select pkg from installed")
+ ('not-installed "\
+select pkg from available where pkg not in (select pkg from installed)"))))))
+
+;;;###autoload
+(defun pcomplete/dnf ()
+ "Completion for the `dnf' command."
+ (let ((subcmds (pcomplete-from-help "dnf help"
+ :margin "^\\(\\)[a-z-]+ "
+ :argument "[a-z-]+")))
+ (while (not (member (pcomplete-arg 1) subcmds))
+ (pcomplete-here (completion-table-merge
+ subcmds
+ (pcomplete-from-help "dnf help"))))
+ (let ((subcmd (pcomplete-arg 1)))
+ (while (pcase subcmd
+ ((guard (pcomplete-match "\\`-" 0))
+ (pcomplete-here
+ (pcomplete-from-help `("dnf" "help" ,subcmd))))
+ ((or "downgrade" "reinstall" "remove")
+ (pcomplete-here (pcmpl-rpm--dnf-packages 'installed)))
+ ((or "install" "mark" "reinstall" "upgrade")
+ (pcomplete-here (pcmpl-rpm--dnf-packages 'not-installed)))
+ ((or "builddep" "changelog" "info" "list" "repoquery" "updateinfo")
+ (pcomplete-here (pcmpl-rpm--dnf-packages 'available))))))))
+
(provide 'pcmpl-rpm)
;;; pcmpl-rpm.el ends here
diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el
index 8774f091c83..0c32f814d0e 100644
--- a/lisp/pcmpl-unix.el
+++ b/lisp/pcmpl-unix.el
@@ -25,7 +25,7 @@
(require 'pcomplete)
-;; User Variables:
+;;; User Variables
(defcustom pcmpl-unix-group-file "/etc/group"
"If non-nil, a string naming the group file on your system."
@@ -56,7 +56,7 @@ being via `pcmpl-ssh-known-hosts-file'."
:group 'pcmpl-unix
:version "24.1")
-;; Functions:
+;;; Shell builtins and core utilities
;;;###autoload
(defun pcomplete/cd ()
@@ -69,34 +69,38 @@ being via `pcmpl-ssh-known-hosts-file'."
;;;###autoload
(defun pcomplete/rmdir ()
"Completion for `rmdir'."
- (while (pcomplete-here (pcomplete-dirs))))
+ (while (if (string-prefix-p "-" (pcomplete-arg))
+ (pcomplete-here (pcomplete-from-help "rmdir --help"))
+ (pcomplete-here (pcomplete-dirs)))))
;;;###autoload
(defun pcomplete/rm ()
- "Completion for `rm'."
- (let ((pcomplete-help "(fileutils)rm invocation"))
- (pcomplete-opt "dfirRv")
- (while (pcomplete-here (pcomplete-all-entries) nil
- #'expand-file-name))))
+ "Completion for the `rm' command."
+ (pcomplete-here-using-help "rm --help"))
;;;###autoload
(defun pcomplete/xargs ()
"Completion for `xargs'."
(while (string-prefix-p "-" (pcomplete-arg 0))
- (pcomplete-here (funcall pcomplete-default-completion-function)))
+ (pcomplete-here (pcomplete-from-help "xargs --help"))
+ (when (pcomplete-match "\\`-[adEIiLnPs]\\'") (pcomplete-here)))
(funcall pcomplete-command-completion-function)
(funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
pcomplete-default-completion-function)))
-;; FIXME: Add completion of sudo-specific arguments.
-(defalias 'pcomplete/sudo #'pcomplete/xargs)
-
;;;###autoload
-(defalias 'pcomplete/time 'pcomplete/xargs)
+(defun pcomplete/time ()
+ "Completion for the `time' command."
+ (pcomplete-opt "p")
+ (funcall pcomplete-command-completion-function)
+ (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
+ pcomplete-default-completion-function)))
;;;###autoload
(defun pcomplete/which ()
"Completion for `which'."
+ (while (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "which --help")))
(while (pcomplete-here (funcall pcomplete-command-completion-function))))
(defun pcmpl-unix-read-passwd-file (file)
@@ -128,25 +132,455 @@ documentation), this function returns nil."
(if pcmpl-unix-passwd-file
(pcmpl-unix-read-passwd-file pcmpl-unix-passwd-file)))
+;;;###autoload
+(defun pcomplete/cat ()
+ "Completion for the `cat' command."
+ (pcomplete-here-using-help "cat --help"))
+
+;;;###autoload
+(defun pcomplete/tac ()
+ "Completion for the `tac' command."
+ (pcomplete-here-using-help "tac --help"))
+
+;;;###autoload
+(defun pcomplete/nl ()
+ "Completion for the `nl' command."
+ (pcomplete-here-using-help "nl --help"))
+
+;;;###autoload
+(defun pcomplete/od ()
+ "Completion for the `od' command."
+ (pcomplete-here-using-help "od --help"))
+
+;;;###autoload
+(defun pcomplete/base32 ()
+ "Completion for the `base32' and `base64' commands."
+ (pcomplete-here-using-help "base32 --help"))
+;;;###autoload
+(defalias 'pcomplete/base64 'pcomplete/base32)
+
+;;;###autoload
+(defun pcomplete/basenc ()
+ "Completion for the `basenc' command."
+ (pcomplete-here-using-help "basenc --help"))
+
+;;;###autoload
+(defun pcomplete/fmt ()
+ "Completion for the `fmt' command."
+ (pcomplete-here-using-help "fmt --help"))
+
+;;;###autoload
+(defun pcomplete/pr ()
+ "Completion for the `pr' command."
+ (pcomplete-here-using-help "pr --help"))
+
+;;;###autoload
+(defun pcomplete/fold ()
+ "Completion for the `fold' command."
+ (pcomplete-here-using-help "fold --help"))
+
+;;;###autoload
+(defun pcomplete/head ()
+ "Completion for the `head' command."
+ (pcomplete-here-using-help "head --help"))
+
+;;;###autoload
+(defun pcomplete/tail ()
+ "Completion for the `tail' command."
+ (pcomplete-here-using-help "tail --help"))
+
+;;;###autoload
+(defun pcomplete/split ()
+ "Completion for the `split' command."
+ (pcomplete-here-using-help "split --help"))
+
+;;;###autoload
+(defun pcomplete/csplit ()
+ "Completion for the `csplit' command."
+ (pcomplete-here-using-help "csplit --help"))
+
+;;;###autoload
+(defun pcomplete/wc ()
+ "Completion for the `wc' command."
+ (pcomplete-here-using-help "wc --help"))
+
+;;;###autoload
+(defun pcomplete/sum ()
+ "Completion for the `sum' command."
+ (pcomplete-here-using-help "sum --help"))
+
+;;;###autoload
+(defun pcomplete/cksum ()
+ "Completion for the `cksum' command."
+ (pcomplete-here-using-help "cksum --help"))
+
+;;;###autoload
+(defun pcomplete/b2sum ()
+ "Completion for the `b2sum' command."
+ (pcomplete-here-using-help "b2sum --help"))
+
+;;;###autoload
+(defun pcomplete/md5sum ()
+ "Completion for checksum commands."
+ (pcomplete-here-using-help "md5sum --help"))
+;;;###autoload(defalias 'pcomplete/sha1sum 'pcomplete/md5sum)
+;;;###autoload(defalias 'pcomplete/sha224sum 'pcomplete/md5sum)
+;;;###autoload(defalias 'pcomplete/sha256sum 'pcomplete/md5sum)
+;;;###autoload(defalias 'pcomplete/sha384sum 'pcomplete/md5sum)
+;;;###autoload(defalias 'pcomplete/sha521sum 'pcomplete/md5sum)
+
+;;;###autoload
+(defun pcomplete/sort ()
+ "Completion for the `sort' command."
+ (pcomplete-here-using-help "sort --help"))
+
+;;;###autoload
+(defun pcomplete/shuf ()
+ "Completion for the `shuf' command."
+ (pcomplete-here-using-help "shuf --help"))
+
+;;;###autoload
+(defun pcomplete/uniq ()
+ "Completion for the `uniq' command."
+ (pcomplete-here-using-help "uniq --help"))
+
+;;;###autoload
+(defun pcomplete/comm ()
+ "Completion for the `comm' command."
+ (pcomplete-here-using-help "comm --help"))
+
+;;;###autoload
+(defun pcomplete/ptx ()
+ "Completion for the `ptx' command."
+ (pcomplete-here-using-help "ptx --help"))
+
+;;;###autoload
+(defun pcomplete/tsort ()
+ "Completion for the `tsort' command."
+ (pcomplete-here-using-help "tsort --help"))
+
+;;;###autoload
+(defun pcomplete/cut ()
+ "Completion for the `cut' command."
+ (pcomplete-here-using-help "cut --help"))
+
+;;;###autoload
+(defun pcomplete/paste ()
+ "Completion for the `paste' command."
+ (pcomplete-here-using-help "paste --help"))
+
+;;;###autoload
+(defun pcomplete/join ()
+ "Completion for the `join' command."
+ (pcomplete-here-using-help "join --help"))
+
+;;;###autoload
+(defun pcomplete/tr ()
+ "Completion for the `tr' command."
+ (pcomplete-here-using-help "tr --help"))
+
+;;;###autoload
+(defun pcomplete/expand ()
+ "Completion for the `expand' command."
+ (pcomplete-here-using-help "expand --help"))
+
+;;;###autoload
+(defun pcomplete/unexpand ()
+ "Completion for the `unexpand' command."
+ (pcomplete-here-using-help "unexpand --help"))
+
+;;;###autoload
+(defun pcomplete/ls ()
+ "Completion for the `ls' command."
+ (pcomplete-here-using-help "ls --help"))
+;;;###autoload(defalias 'pcomplete/dir 'pcomplete/ls)
+;;;###autoload(defalias 'pcomplete/vdir 'pcomplete/ls)
+
+;;;###autoload
+(defun pcomplete/cp ()
+ "Completion for the `cp' command."
+ (pcomplete-here-using-help "cp --help"))
+
+;;;###autoload
+(defun pcomplete/dd ()
+ "Completion for the `dd' command."
+ (let ((operands (pcomplete-from-help "dd --help"
+ :argument "[a-z]+="
+ :narrow-start "\n\n"
+ :narrow-end "\n\n")))
+ (while
+ (cond ((pcomplete-match "\\`[io]f=\\(.*\\)" 0)
+ (pcomplete-here (pcomplete-entries)
+ (pcomplete-match-string 1 0)))
+ (t (pcomplete-here operands))))))
+
+;;;###autoload
+(defun pcomplete/install ()
+ "Completion for the `install' command."
+ (pcomplete-here-using-help "install --help"))
+
+;;;###autoload
+(defun pcomplete/mv ()
+ "Completion for the `mv' command."
+ (pcomplete-here-using-help "mv --help"))
+
+;;;###autoload
+(defun pcomplete/shred ()
+ "Completion for the `shred' command."
+ (pcomplete-here-using-help "shred --help"))
+
+;;;###autoload
+(defun pcomplete/ln ()
+ "Completion for the `ln' command."
+ (pcomplete-here-using-help "ln --help"))
+
+;;;###autoload
+(defun pcomplete/mkdir ()
+ "Completion for the `mkdir' command."
+ (pcomplete-here-using-help "mkdir --help"))
+
+;;;###autoload
+(defun pcomplete/mkfifo ()
+ "Completion for the `mkfifo' command."
+ (pcomplete-here-using-help "mkfifo --help"))
+
+;;;###autoload
+(defun pcomplete/mknod ()
+ "Completion for the `mknod' command."
+ (pcomplete-here-using-help "mknod --help"))
+
+;;;###autoload
+(defun pcomplete/readlink ()
+ "Completion for the `readlink' command."
+ (pcomplete-here-using-help "readlink --help"))
+
;;;###autoload
(defun pcomplete/chown ()
"Completion for the `chown' command."
- (unless (pcomplete-match "\\`-")
- (if (pcomplete-match "\\`[^.]*\\'" 0)
- (pcomplete-here* (pcmpl-unix-user-names))
- (if (pcomplete-match "\\.\\([^.]*\\)\\'" 0)
- (pcomplete-here* (pcmpl-unix-group-names)
- (pcomplete-match-string 1 0))
- (pcomplete-here*))))
+ (while (pcomplete-match "\\`-" 0)
+ (pcomplete-here (pcomplete-from-help "chown --help")))
+ (if (pcomplete-match "\\`[^.]*\\'" 0)
+ (pcomplete-here* (pcmpl-unix-user-names))
+ (if (pcomplete-match "\\.\\([^.]*\\)\\'" 0)
+ (pcomplete-here* (pcmpl-unix-group-names)
+ (pcomplete-match-string 1 0))
+ (pcomplete-here*)))
(while (pcomplete-here (pcomplete-entries))))
;;;###autoload
(defun pcomplete/chgrp ()
"Completion for the `chgrp' command."
- (unless (pcomplete-match "\\`-")
- (pcomplete-here* (pcmpl-unix-group-names)))
+ (while (pcomplete-match "\\`-" 0)
+ (pcomplete-here (pcomplete-from-help "chgrp --help")))
+ (pcomplete-here* (pcmpl-unix-group-names))
(while (pcomplete-here (pcomplete-entries))))
+;;;###autoload
+(defun pcomplete/chmod ()
+ "Completion for the `chmod' command."
+ (pcomplete-here-using-help "chmod --help"))
+
+;;;###autoload
+(defun pcomplete/touch ()
+ "Completion for the `touch' command."
+ (pcomplete-here-using-help "touch --help"))
+
+;;;###autoload
+(defun pcomplete/df ()
+ "Completion for the `df' command."
+ (pcomplete-here-using-help "df --help"))
+
+;;;###autoload
+(defun pcomplete/du ()
+ "Completion for the `du' command."
+ (pcomplete-here-using-help "du --help"))
+
+;;;###autoload
+(defun pcomplete/stat ()
+ "Completion for the `stat' command."
+ (pcomplete-here-using-help "stat --help"))
+
+;;;###autoload
+(defun pcomplete/sync ()
+ "Completion for the `sync' command."
+ (pcomplete-here-using-help "sync --help"))
+
+;;;###autoload
+(defun pcomplete/truncate ()
+ "Completion for the `truncate' command."
+ (pcomplete-here-using-help "truncate --help"))
+
+;;;###autoload
+(defun pcomplete/echo ()
+ "Completion for the `echo' command."
+ (pcomplete-here-using-help '("echo" "--help")))
+
+;;;###autoload
+(defun pcomplete/test ()
+ "Completion for the `test' command."
+ (pcomplete-here-using-help '("[" "--help")
+ :margin "^ +\\([A-Z]+1 \\)?"))
+;;;###autoload(defalias (intern "pcomplete/[") 'pcomplete/test)
+
+;;;###autoload
+(defun pcomplete/tee ()
+ "Completion for the `tee' command."
+ (pcomplete-here-using-help "tee --help"))
+
+;;;###autoload
+(defun pcomplete/basename ()
+ "Completion for the `basename' command."
+ (pcomplete-here-using-help "basename --help"))
+
+;;;###autoload
+(defun pcomplete/dirname ()
+ "Completion for the `dirname' command."
+ (pcomplete-here-using-help "dirname --help"))
+
+;;;###autoload
+(defun pcomplete/pathchk ()
+ "Completion for the `pathchk' command."
+ (pcomplete-here-using-help "pathchk --help"))
+
+;;;###autoload
+(defun pcomplete/mktemp ()
+ "Completion for the `mktemp' command."
+ (pcomplete-here-using-help "mktemp --help"))
+
+;;;###autoload
+(defun pcomplete/realpath ()
+ "Completion for the `realpath' command."
+ (pcomplete-here-using-help "realpath --help"))
+
+;;;###autoload
+(defun pcomplete/id ()
+ "Completion for the `id' command."
+ (while (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "id --help")))
+ (while (pcomplete-here (pcmpl-unix-user-names))))
+
+;;;###autoload
+(defun pcomplete/groups ()
+ "Completion for the `groups' command."
+ (while (pcomplete-here (pcmpl-unix-user-names))))
+
+;;;###autoload
+(defun pcomplete/who ()
+ "Completion for the `who' command."
+ (pcomplete-here-using-help "who --help"))
+
+;;;###autoload
+(defun pcomplete/date ()
+ "Completion for the `date' command."
+ (pcomplete-here-using-help "date --help"))
+
+;;;###autoload
+(defun pcomplete/nproc ()
+ "Completion for the `nproc' command."
+ (pcomplete-here-using-help "nproc --help"))
+
+;;;###autoload
+(defun pcomplete/uname ()
+ "Completion for the `uname' command."
+ (pcomplete-here-using-help "uname --help"))
+
+;;;###autoload
+(defun pcomplete/hostname ()
+ "Completion for the `hostname' command."
+ (pcomplete-here-using-help "hostname --help"))
+
+;;;###autoload
+(defun pcomplete/uptime ()
+ "Completion for the `uptime' command."
+ (pcomplete-here-using-help "uptime --help"))
+
+;;;###autoload
+(defun pcomplete/chcon ()
+ "Completion for the `chcon' command."
+ (pcomplete-here-using-help "chcon --help"))
+
+;;;###autoload
+(defun pcomplete/runcon ()
+ "Completion for the `runcon' command."
+ (while (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "runcon --help"))
+ (when (pcomplete-match "\\`-[turl]\\'" 0) (pcomplete-here)))
+ (funcall pcomplete-command-completion-function)
+ (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
+ pcomplete-default-completion-function)))
+
+;;;###autoload
+(defun pcomplete/chroot ()
+ "Completion for the `chroot' command."
+ (while (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "chroot --help")))
+ (pcomplete-here (pcomplete-dirs))
+ (funcall pcomplete-command-completion-function)
+ (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
+ pcomplete-default-completion-function)))
+
+;;;###autoload
+(defun pcomplete/env ()
+ "Completion for the `env' command."
+ (while (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "env --help"))
+ (when (pcomplete-match "\\`-[uCS]\\'") (pcomplete-here)))
+ (while (pcomplete-match "=" 0) (pcomplete-here)) ; FIXME: Complete env vars
+ (funcall pcomplete-command-completion-function)
+ (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
+ pcomplete-default-completion-function)))
+
+;;;###autoload
+(defun pcomplete/nice ()
+ "Completion for the `nice' command."
+ (while (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "nice --help"))
+ (pcomplete-here))
+ (funcall pcomplete-command-completion-function)
+ (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
+ pcomplete-default-completion-function)))
+
+;;;###autoload
+(defun pcomplete/nohup ()
+ "Completion for the `nohup' command."
+ (while (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "nohup --help")))
+ (funcall pcomplete-command-completion-function)
+ (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
+ pcomplete-default-completion-function)))
+
+;;;###autoload
+(defun pcomplete/stdbuf ()
+ "Completion for the `stdbuf' command."
+ (while (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "stdbuf --help"))
+ (when (pcomplete-match "\\`-[ioe]\\'") (pcomplete-here)))
+ (funcall pcomplete-command-completion-function)
+ (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
+ pcomplete-default-completion-function)))
+
+;;;###autoload
+(defun pcomplete/timeout ()
+ "Completion for the `timeout' command."
+ (while (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "timeout --help"))
+ (when (pcomplete-match "\\`-[ks]\\'") (pcomplete-here)))
+ (pcomplete-here) ; eat DURATION argument
+ (funcall pcomplete-command-completion-function)
+ (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
+ pcomplete-default-completion-function)))
+
+;;;###autoload
+(defun pcomplete/numfmt ()
+ "Completion for the `numfmt' command."
+ (pcomplete-here-using-help "numfmt --help"))
+
+;;;###autoload
+(defun pcomplete/seq ()
+ "Completion for the `seq' command."
+ (pcomplete-here-using-help "seq --help"))
+
+;;; Network commands
;; ssh support by Phil Hagelberg.
;; https://www.emacswiki.org/cgi-bin/wiki/pcmpl-ssh.el
@@ -239,6 +673,18 @@ Includes files as well as host names followed by a colon."
(pcomplete-opt "xl(pcmpl-unix-user-names)")
(pcmpl-unix-complete-hostname))
+;;; Miscellaneous
+
+;;;###autoload
+(defun pcomplete/sudo ()
+ "Completion for the `sudo' command."
+ (while (string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (pcomplete-from-help "sudo --help"))
+ (when (pcomplete-match "\\`-[CDghpRtTUu]\\'") (pcomplete-here)))
+ (funcall pcomplete-command-completion-function)
+ (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
+ pcomplete-default-completion-function)))
+
(provide 'pcmpl-unix)
;;; pcmpl-unix.el ends here
diff --git a/lisp/pcmpl-x.el b/lisp/pcmpl-x.el
index 261a3d4e27b..1ede867c5fb 100644
--- a/lisp/pcmpl-x.el
+++ b/lisp/pcmpl-x.el
@@ -28,6 +28,22 @@
(eval-when-compile (require 'cl-lib))
(require 'pcomplete)
+;;; TeX
+
+;;;###autoload
+(defun pcomplete/tex ()
+ "Completion for the `tex' command."
+ (pcomplete-here-using-help "tex --help"
+ :margin "^\\(?:\\[-no\\]\\)?\\(\\)-"))
+;;;###autoload(defalias 'pcomplete/pdftex 'pcomplete/tex)
+;;;###autoload(defalias 'pcomplete/latex 'pcomplete/tex)
+;;;###autoload(defalias 'pcomplete/pdflatex 'pcomplete/tex)
+
+;;;###autoload
+(defun pcomplete/luatex ()
+ "Completion for the `luatex' command."
+ (pcomplete-here-using-help "luatex --help"))
+;;;###autoload(defalias 'pcomplete/lualatex 'pcomplete/luatex)
;;;; tlmgr - https://www.tug.org/texlive/tlmgr.html
@@ -142,6 +158,12 @@
(unless (pcomplete-match "^--" 0)
(pcomplete-here* (pcomplete-dirs-or-entries)))))))
+;;; Grep-like tools
+
+;;;###autoload
+(defun pcomplete/rg ()
+ "Completion for the `rg' command."
+ (pcomplete-here-using-help "rg --help"))
;;;; ack - https://betterthangrep.com
@@ -288,6 +310,8 @@ long options."
(pcmpl-x-ag-options))))
(pcomplete-here* (pcomplete-dirs-or-entries)))))
+;;; Borland
+
;;;###autoload
(defun pcomplete/bcc32 ()
"Completion function for Borland's C++ compiler."
@@ -321,5 +345,24 @@ long options."
;;;###autoload
(defalias 'pcomplete/bcc 'pcomplete/bcc32)
+;;; Network tools
+
+;;;###autoload
+(defun pcomplete/rclone ()
+ "Completion for the `rclone' command."
+ (let ((subcmds (pcomplete-from-help "rclone help"
+ :margin "^ "
+ :argument "[a-z]+"
+ :narrow-start "\n\n")))
+ (while (not (member (pcomplete-arg 1) subcmds))
+ (pcomplete-here (completion-table-merge
+ subcmds
+ (pcomplete-from-help "rclone help flags"))))
+ (let ((subcmd (pcomplete-arg 1)))
+ (while (if (pcomplete-match "\\`-" 0)
+ (pcomplete-here (pcomplete-from-help
+ `("rclone" ,subcmd "--help")))
+ (pcomplete-here (pcomplete-entries)))))))
+
(provide 'pcmpl-x)
;;; pcmpl-x.el ends here
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 0e3d1df7814..6fe29d9dcfb 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -119,6 +119,9 @@
;;; Code:
(require 'comint)
+(eval-when-compile
+ (require 'cl-lib)
+ (require 'rx))
(defgroup pcomplete nil
"Programmable completion."
@@ -481,6 +484,14 @@ Same as `pcomplete' but using the standard completion UI."
(when completion-ignore-case
(setq table (completion-table-case-fold table)))
(list beg (point) table
+ :annotation-function
+ (lambda (cand)
+ (when (stringp cand)
+ (get-text-property 0 'pcomplete-annotation cand)))
+ :company-docsig
+ (lambda (cand)
+ (when (stringp cand)
+ (get-text-property 0 'pcomplete-help cand)))
:predicate pred
:exit-function
;; If completion is finished, add a terminating space.
@@ -1325,6 +1336,133 @@ If specific documentation can't be given, be generic."
(pcomplete-read-hosts pcomplete-hosts-file 'pcomplete--host-name-cache
'pcomplete--host-name-cache-timestamp)))
+;;; Parsing help messages
+
+(defvar pcomplete-from-help (make-hash-table :test #'equal)
+ "Memoization table for function `pcomplete-from-help'.")
+
+(cl-defun pcomplete-from-help (command
+ &rest args
+ &key
+ (margin (rx bol (+ " ")))
+ (argument (rx "-" (+ (any "-" alnum)) (? "=")))
+ (metavar (rx (? " ")
+ (or (+ (any alnum "_-"))
+ (seq "[" (+? nonl) "]")
+ (seq "<" (+? nonl) ">")
+ (seq "{" (+? nonl) "}"))))
+ (separator (rx ", " symbol-start))
+ (description (rx (* nonl)
+ (* "\n" (>= 9 " ") (* nonl))))
+ narrow-start
+ narrow-end)
+ "Parse output of COMMAND into a list of completion candidates.
+
+COMMAND can be a string to be executed in a shell or a list of
+strings (program name and arguments). It should print a help
+message.
+
+A list of arguments is collected after each match of MARGIN.
+Each argument should match ARGUMENT, possibly followed by a match
+of METAVAR. If a match of SEPARATOR follows, then more
+argument-metavar pairs are collected. Finally, a match of
+DESCRIPTION is collected.
+
+Keyword ARGS:
+
+MARGIN: regular expression after which argument descriptions are
+ to be found. Parsing continues at the end of the first match
+ group or, failing that, the entire match.
+
+ARGUMENT: regular expression matching an argument name. The
+ first match group (failing that, the entire match) is collected
+ as the argument name. Parsing continues at the end of the
+ second matching group (failing that, the first group or entire
+ match).
+
+METAVAR: regular expression matching an argument parameter name.
+ The first match group (failing that, the entire match) is
+ collected as the parameter name and used as completion
+ annotation. Parsing continues at the end of the second
+ matching group (failing that, the first group or entire match).
+
+SEPARATOR: regular expression matching the separator between
+ arguments. Parsing continues at the end of the first match
+ group (failing that, the entire match).
+
+DESCRIPTION: regular expression matching the description of an
+ argument. The first match group (failing that, the entire
+ match) is collected as the parameter name and used as
+ completion help. Parsing continues at the end of the first
+ matching group (failing that, the entire match).
+
+NARROW-START, NARROW-END: if non-nil, parsing of the help message
+ is narrowed to the region between the end of the first match
+ group (failing that, the entire match) of these regular
+ expressions."
+ (with-memoization (gethash (cons command args) pcomplete-from-help)
+ (with-temp-buffer
+ (let ((case-fold-search nil)
+ (default-directory (expand-file-name "~/"))
+ (command (if (stringp command)
+ (list shell-file-name
+ shell-command-switch
+ command)
+ command))
+ i result)
+ (apply #'call-process (car command) nil t nil (cdr command))
+ (goto-char (point-min))
+ (narrow-to-region (or (and narrow-start
+ (re-search-forward narrow-start nil t)
+ (or (match-beginning 1) (match-beginning 0)))
+ (point-min))
+ (or (and narrow-end
+ (re-search-forward narrow-end nil t)
+ (or (match-beginning 1) (match-beginning 0)))
+ (point-max)))
+ (goto-char (point-min))
+ (while (re-search-forward margin nil t)
+ (goto-char (or (match-end 1) (match-end 0)))
+ (setq i 0)
+ (while (and (or (zerop i)
+ (and (looking-at separator)
+ (goto-char (or (match-end 1)
+ (match-end 0)))))
+ (looking-at argument))
+ (setq i (1+ i))
+ (goto-char (seq-some #'match-end '(2 1 0)))
+ (push (or (match-string 1) (match-string 0)) result)
+ (when (looking-at metavar)
+ (goto-char (seq-some #'match-end '(2 1 0)))
+ (put-text-property 0 1
+ 'pcomplete-annotation
+ (or (match-string 1) (match-string 0))
+ (car result))))
+ (when (looking-at description)
+ (goto-char (seq-some #'match-end '(2 1 0)))
+ (let ((help (string-clean-whitespace
+ (or (match-string 1) (match-string 0))))
+ (items (take i result)))
+ (while items
+ (put-text-property 0 1 'pcomplete-help help
+ (pop items))))))
+ (nreverse result)))))
+
+(defun pcomplete-here-using-help (command &rest args)
+ "Perform completion for a simple command.
+Offer switches and directory entries as completion candidates.
+The switches are obtained by calling `pcomplete-from-help' with
+COMMAND and ARGS as arguments."
+ (while (cond
+ ((string= "--" (pcomplete-arg 1))
+ (while (pcomplete-here (pcomplete-entries))))
+ ((pcomplete-match "\\`--[^=]+=\\(.*\\)" 0)
+ (pcomplete-here (pcomplete-entries)
+ (pcomplete-match-string 1 0)))
+ ((string-prefix-p "-" (pcomplete-arg 0))
+ (pcomplete-here (apply #'pcomplete-from-help command args)))
+ (t (pcomplete-here (pcomplete-entries))))))
+
(provide 'pcomplete)
;;; pcomplete.el ends here
diff --git a/test/lisp/pcomplete-tests.el b/test/lisp/pcomplete-tests.el
new file mode 100644
index 00000000000..00a82502f30
--- /dev/null
+++ b/test/lisp/pcomplete-tests.el
@@ -0,0 +1,100 @@
+;;; pcomplete-tests.el --- Tests for pcomplete.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see .
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'pcomplete)
+
+(ert-deftest pcomplete-test-parse-gpg-help ()
+ (cl-letf ((pcomplete-from-help (make-hash-table :test #'equal))
+ ((symbol-function 'call-process)
+ (lambda (&rest _) (insert "\
+gpg (GnuPG) 2.3.7
+
+Commands:
+
+ -s, --sign make a signature
+ --clear-sign make a clear text signature
+ -b, --detach-sign make a detached signature
+ --tofu-policy VALUE set the TOFU policy for a key
+
+Options to specify keys:
+ -r, --recipient USER-ID encrypt for USER-ID
+ -u, --local-user USER-ID use USER-ID to sign or decrypt
+
+(See the man page for a complete listing of all commands and options)
+
+Examples:
+
+ -se -r Bob [file] sign and encrypt for user Bob
+ --clear-sign [file] make a clear text signature
+"))))
+ (should
+ (equal-including-properties
+ (pcomplete-from-help "gpg --help" :narrow-end "^ -se")
+ '(#("-s" 0 1 (pcomplete-help "make a signature"))
+ #("--sign" 0 1 (pcomplete-help "make a signature"))
+ #("--clear-sign" 0 1 (pcomplete-help "make a clear text signature"))
+ #("-b" 0 1 (pcomplete-help "make a detached signature"))
+ #("--detach-sign" 0 1 (pcomplete-help "make a detached signature"))
+ #("--tofu-policy" 0 1
+ (pcomplete-help "set the TOFU policy for a key" pcomplete-annotation " VALUE"))
+ #("-r" 0 1 (pcomplete-help "encrypt for USER-ID"))
+ #("--recipient" 0 1
+ (pcomplete-help "encrypt for USER-ID" pcomplete-annotation " USER-ID"))
+ #("-u" 0 1
+ (pcomplete-help "use USER-ID to sign or decrypt"))
+ #("--local-user" 0 1
+ (pcomplete-help "use USER-ID to sign or decrypt" pcomplete-annotation " USER-ID")))))))
+
+(ert-deftest pcomplete-test-parse-git-help ()
+ (cl-letf ((pcomplete-from-help (make-hash-table :test #'equal))
+ ((symbol-function 'call-process)
+ (lambda (&rest _) (insert "\
+usage: git [-v | --version] [-h | --help] [-C ] [-c =]
+ [--exec-path[=]] [--html-path] [--man-path] [--info-path]
+ [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
+ [--git-dir=] [--work-tree=] [--namespace=]
+ [--super-prefix=] [--config-env==]
+ []
+"))))
+ (should
+ (equal-including-properties
+ (pcomplete-from-help "git help"
+ :margin "\\(\\[\\)-"
+ :separator " | "
+ :description "\\`")
+ '("-v" "--version" "-h" "--help"
+ #("-C" 0 1 (pcomplete-annotation " "))
+ #("-c" 0 1 (pcomplete-annotation " "))
+ #("--exec-path" 0 1 (pcomplete-annotation "[=]"))
+ "--html-path" "--man-path" "--info-path"
+ "-p" "--paginate" "-P" "--no-pager"
+ "--no-replace-objects" "--bare"
+ #("--git-dir=" 0 1 (pcomplete-annotation ""))
+ #("--work-tree=" 0 1 (pcomplete-annotation ""))
+ #("--namespace=" 0 1 (pcomplete-annotation ""))
+ #("--super-prefix=" 0 1 (pcomplete-annotation ""))
+ #("--config-env=" 0 1 (pcomplete-annotation "")))))))
+
+(provide 'pcomplete-tests)
+;;; pcomplete-tests.el ends here
From 5798c4aa2a7b3e7337234e8122d8243ecf54b402 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 00:53:00 +0200
Subject: [PATCH 368/915] Support fbsetbg in wallpaper.el
* lisp/image/wallpaper.el (wallpaper--default-commands)
(wallpaper-command): Add "fbsetbg".
---
lisp/image/wallpaper.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index 6d57691ff0c..2ebe5be0330 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -61,6 +61,7 @@
("gm" "display" "-size" "%wx%h" "-window" "root" "%f")
("display" "-resize" "%wx%h" "-window" "root" "%f")
("feh" "--bg-max" "%f")
+ ("fbsetbg" "-a" "%f")
("xwallpaper" "--zoom" "%f")
("hsetroot" "-full" "%f")
("xloadimage" "-onroot" "-fullscreen" "%f")
@@ -152,6 +153,7 @@ native API will be used instead (see `haiku-set-wallpaper')."
(const :tag "gm (X Window System)" "gm")
(const :tag "display (X Window System)" "display")
(const :tag "feh (X Window System)" "feh")
+ (const :tag "fbsetbg (X Window System)" "fbsetbg")
(const :tag "xwallpaper (X Window System)" "xwallpaper")
(const :tag "hsetroot (X Window System)" "hsetroot")
(const :tag "xloadimage (X Window System)" "xloadimage")
From 8c73ed0ec3328d4108e3084fc0dabdae8bb782a7 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 00:53:12 +0200
Subject: [PATCH 369/915] Add image-transform-reset-to-original to manual
* doc/emacs/files.texi (Image Mode):
Add 'image-transform-reset-to-original'.
Suggested by Juri Linkov .
---
doc/emacs/files.texi | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 744b848335e..1717c5c25bc 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -2273,6 +2273,7 @@ behavior by using the options @code{image-auto-resize} and
@findex image-transform-set-percent
@findex image-transform-set-scale
@findex image-transform-reset-to-initial
+@findex image-transform-reset-to-original
To resize the image manually you can use the command
@code{image-transform-fit-to-window} bound to @kbd{s w} that fits the
image to both the window height and width. To scale the image to a
@@ -2281,7 +2282,8 @@ percentage of its original size, use the command
image specifying a scale factor, use the command
@code{image-transform-set-scale} bound to @kbd{s s}. To reset all
transformations to the initial state, use
-@code{image-transform-reset-to-initial} bound to @kbd{s 0}.
+@code{image-transform-reset-to-initial} bound to @kbd{s 0}, or
+@code{image-transform-reset-to-original} bound to @kbd{s o}.
@findex image-next-file
@findex image-previous-file
From 30ca49c8f64b73f991d94b10afcfc0e2d592fe6a Mon Sep 17 00:00:00 2001
From: Sean Whitton
Date: Wed, 14 Sep 2022 09:49:27 -0700
Subject: [PATCH 370/915] Use '^' key for detach command bindings
* lisp/tab-bar.el (tab-prefix-map): Move tear-off-window to C-x w ^ f.
Bind tab-window-detach to C-x w ^ t.
* lisp/window.el (window-prefix-map): Bind tab-detach to C-x t ^ f.
---
lisp/tab-bar.el | 1 +
lisp/window.el | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index cf5ae09a247..abefd996a8a 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -2411,6 +2411,7 @@ When `switch-to-buffer-obey-display-actions' is non-nil,
(keymap-set tab-prefix-map "M" #'tab-move-to)
(keymap-set tab-prefix-map "G" #'tab-group)
(keymap-set tab-prefix-map "r" #'tab-rename)
+(keymap-set tab-prefix-map "^ f" #'tab-detach)
(keymap-set tab-prefix-map "RET" #'tab-switch)
(keymap-set tab-prefix-map "b" #'switch-to-buffer-other-tab)
(keymap-set tab-prefix-map "f" #'find-file-other-tab)
diff --git a/lisp/window.el b/lisp/window.el
index d5f42dd10b4..905803b19e6 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -10593,7 +10593,8 @@ displaying that processes's buffer."
"2" #'split-root-window-below
"3" #'split-root-window-right
"s" #'window-toggle-side-windows
- "f" #'tear-off-window
+ "^ f" #'tear-off-window
+ "^ t" #'tab-window-detach
"-" #'fit-window-to-buffer
"0" #'delete-windows-on)
(define-key ctl-x-map "w" window-prefix-map)
From b8e9239b47391c6628d94a4e2e91320c5366d27b Mon Sep 17 00:00:00 2001
From: Jim Porter
Date: Tue, 13 Sep 2022 16:14:00 -0700
Subject: [PATCH 371/915] Allow using a symbol as an index into an alist in
Eshell
* lisp/eshell/esh-var.el (eshell-index-value): If INDEX is a symbol,
use 'assoc' for indexing.
* test/lisp/eshell/esh-var-tests.el (esh-var-test/interp-var-assoc)
(esh-var-test/quoted-interp-var-assoc): Add checks for indexing via
symbol (bug#57787).
---
lisp/eshell/esh-var.el | 35 ++++++++++++++++---------------
test/lisp/eshell/esh-var-tests.el | 12 +++++++----
2 files changed, 26 insertions(+), 21 deletions(-)
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index a9df172e88e..36e59cd5a41 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -646,23 +646,24 @@ For example, to retrieve the second element of a user's record in
"Reference VALUE using the given INDEX."
(when (and (stringp index) (get-text-property 0 'number index))
(setq index (string-to-number index)))
- (if (stringp index)
- (cdr (assoc index value))
- (cond
- ((ring-p value)
- (if (> index (ring-length value))
- (error "Index exceeds length of ring")
- (ring-ref value index)))
- ((listp value)
- (if (> index (length value))
- (error "Index exceeds length of list")
- (nth index value)))
- ((vectorp value)
- (if (> index (length value))
- (error "Index exceeds length of vector")
- (aref value index)))
- (t
- (error "Invalid data type for indexing")))))
+ (if (integerp index)
+ (cond
+ ((ring-p value)
+ (if (> index (ring-length value))
+ (error "Index exceeds length of ring")
+ (ring-ref value index)))
+ ((listp value)
+ (if (> index (length value))
+ (error "Index exceeds length of list")
+ (nth index value)))
+ ((vectorp value)
+ (if (> index (length value))
+ (error "Index exceeds length of vector")
+ (aref value index)))
+ (t
+ (error "Invalid data type for indexing")))
+ ;; INDEX is some non-integer value, so treat VALUE as an alist.
+ (cdr (assoc index value))))
;;;_* Variable name completion
diff --git a/test/lisp/eshell/esh-var-tests.el b/test/lisp/eshell/esh-var-tests.el
index bebc57d3592..cb5b1766bb5 100644
--- a/test/lisp/eshell/esh-var-tests.el
+++ b/test/lisp/eshell/esh-var-tests.el
@@ -105,9 +105,11 @@
(ert-deftest esh-var-test/interp-var-assoc ()
"Interpolate alist variable with index"
- (let ((eshell-test-value '(("foo" . 1))))
+ (let ((eshell-test-value '(("foo" . 1) (bar . 2))))
(eshell-command-result-equal "echo $eshell-test-value[foo]"
- 1)))
+ 1)
+ (eshell-command-result-equal "echo $eshell-test-value[#'bar]"
+ 2)))
(ert-deftest esh-var-test/interp-var-length-list ()
"Interpolate length of list variable"
@@ -257,9 +259,11 @@ inside double-quotes"
(ert-deftest esh-var-test/quoted-interp-var-assoc ()
"Interpolate alist variable with index inside double-quotes"
- (let ((eshell-test-value '(("foo" . 1))))
+ (let ((eshell-test-value '(("foo" . 1) (bar . 2))))
(eshell-command-result-equal "echo \"$eshell-test-value[foo]\""
- "1")))
+ "1")
+ (eshell-command-result-equal "echo \"$eshell-test-value[#'bar]\""
+ "2")))
(ert-deftest esh-var-test/quoted-interp-var-length-list ()
"Interpolate length of list variable inside double-quotes"
From 5fe9a1a85ae6d54196031157a735352f6ab655ff Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Thu, 15 Sep 2022 09:12:13 +0300
Subject: [PATCH 372/915] ; Fix doc string of 'loaddefs-generate'
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Doc fix.
(Bug#57815)
---
lisp/emacs-lisp/loaddefs-gen.el | 4 +--
src/w32fns.c | 45 +++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index 005a46c2d75..5819a26eb54 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -512,7 +512,7 @@ If COMPILE, don't include a \"don't compile\" cookie."
(defun loaddefs-generate (dir output-file &optional excluded-files
extra-data include-package-version
generate-full)
- "Generate loaddefs files for Lisp files in the directories DIRS.
+ "Generate loaddefs files for Lisp files in one or more directories given by DIR.
DIR can be either a single directory or a list of directories.
The autoloads will be written to OUTPUT-FILE. If any Lisp file
@@ -520,7 +520,7 @@ binds `generated-autoload-file' as a file-local variable, write
its autoloads into the specified file instead.
The function does NOT recursively descend into subdirectories of the
-directory or directories specified by DIRS.
+directories specified by DIR.
Optional argument EXCLUDED-FILES, if non-nil, should be a list of
files, such as preloaded files, whose autoloads should not be written
diff --git a/src/w32fns.c b/src/w32fns.c
index 745458d0a03..57296bd4e07 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -10447,6 +10447,51 @@ w32_get_resource (const char *key, const char *name, LPDWORD lpdwtype)
return (NULL);
}
+#ifdef WINDOWSNT
+
+/***********************************************************************
+ Wallpaper
+ ***********************************************************************/
+
+#if 0
+
+typedef BOOL (WINAPI * SystemParametersInfoW_Proc) (UINT,UINT,PVOID,UINT);
+static SystemParametersInfoW_Proc system_parameters_info_w_fn;
+
+DEFUN ("w32-set-wallpaper", Fw32_set_wallpaper, Sw32_set_wallpaper, 1, 1, 0,
+ doc: /* Set the desktop wallpaper image to IMAGE-FILE. */)
+ (Lisp_Object image_file)
+{
+ Lisp_Object encoded = ENCODE_FILE (Fexpand_file_name (image_file, Qnil));
+ char *fname = SSDATA (encoded);
+
+ if (w32_unicode_filenames)
+ {
+ }
+ else
+ {
+ char fname_a[MAX_PATH];
+
+ if (filename_to_ansi (fname, fname_a) != 0)
+ error ("Wallpaper file %s does not exist or cannot be accessed", fname);
+
+ BOOL result = SystemParametersInfoA (SPI_SETDESKWALLPAPER, 0, fname_a,
+ SPIF_SENDCHANGE);
+ if (!result)
+ {
+ DWORD err = GetLastError ();
+ if (err)
+ error ("Could not set wallpaper: %s", w32_strerror (err));
+ else
+ error ("Could not set wallpaper");
+ }
+ }
+ return Qnil;
+}
+#endif
+
+#endif
+
/***********************************************************************
Initialization
***********************************************************************/
From 52a3ba102c0bcfda1b69e33be2a93a245a4c3a84 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Thu, 15 Sep 2022 09:14:59 +0300
Subject: [PATCH 373/915] Revert "; Fix doc string of 'loaddefs-generate'"
This reverts commit 5fe9a1a85ae6d54196031157a735352f6ab655ff.
It included unrelated changes.
---
lisp/emacs-lisp/loaddefs-gen.el | 4 +--
src/w32fns.c | 45 ---------------------------------
2 files changed, 2 insertions(+), 47 deletions(-)
diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index 5819a26eb54..005a46c2d75 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -512,7 +512,7 @@ If COMPILE, don't include a \"don't compile\" cookie."
(defun loaddefs-generate (dir output-file &optional excluded-files
extra-data include-package-version
generate-full)
- "Generate loaddefs files for Lisp files in one or more directories given by DIR.
+ "Generate loaddefs files for Lisp files in the directories DIRS.
DIR can be either a single directory or a list of directories.
The autoloads will be written to OUTPUT-FILE. If any Lisp file
@@ -520,7 +520,7 @@ binds `generated-autoload-file' as a file-local variable, write
its autoloads into the specified file instead.
The function does NOT recursively descend into subdirectories of the
-directories specified by DIR.
+directory or directories specified by DIRS.
Optional argument EXCLUDED-FILES, if non-nil, should be a list of
files, such as preloaded files, whose autoloads should not be written
diff --git a/src/w32fns.c b/src/w32fns.c
index 57296bd4e07..745458d0a03 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -10447,51 +10447,6 @@ w32_get_resource (const char *key, const char *name, LPDWORD lpdwtype)
return (NULL);
}
-#ifdef WINDOWSNT
-
-/***********************************************************************
- Wallpaper
- ***********************************************************************/
-
-#if 0
-
-typedef BOOL (WINAPI * SystemParametersInfoW_Proc) (UINT,UINT,PVOID,UINT);
-static SystemParametersInfoW_Proc system_parameters_info_w_fn;
-
-DEFUN ("w32-set-wallpaper", Fw32_set_wallpaper, Sw32_set_wallpaper, 1, 1, 0,
- doc: /* Set the desktop wallpaper image to IMAGE-FILE. */)
- (Lisp_Object image_file)
-{
- Lisp_Object encoded = ENCODE_FILE (Fexpand_file_name (image_file, Qnil));
- char *fname = SSDATA (encoded);
-
- if (w32_unicode_filenames)
- {
- }
- else
- {
- char fname_a[MAX_PATH];
-
- if (filename_to_ansi (fname, fname_a) != 0)
- error ("Wallpaper file %s does not exist or cannot be accessed", fname);
-
- BOOL result = SystemParametersInfoA (SPI_SETDESKWALLPAPER, 0, fname_a,
- SPIF_SENDCHANGE);
- if (!result)
- {
- DWORD err = GetLastError ();
- if (err)
- error ("Could not set wallpaper: %s", w32_strerror (err));
- else
- error ("Could not set wallpaper");
- }
- }
- return Qnil;
-}
-#endif
-
-#endif
-
/***********************************************************************
Initialization
***********************************************************************/
From 48d8543ff134e08332bf35d96409cb8e3c2cbfb9 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Thu, 15 Sep 2022 09:16:41 +0300
Subject: [PATCH 374/915] ; Fix doc string of 'loaddefs-generate'
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Doc fix.
(Bug#57815)
---
lisp/emacs-lisp/loaddefs-gen.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index 005a46c2d75..5819a26eb54 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -512,7 +512,7 @@ If COMPILE, don't include a \"don't compile\" cookie."
(defun loaddefs-generate (dir output-file &optional excluded-files
extra-data include-package-version
generate-full)
- "Generate loaddefs files for Lisp files in the directories DIRS.
+ "Generate loaddefs files for Lisp files in one or more directories given by DIR.
DIR can be either a single directory or a list of directories.
The autoloads will be written to OUTPUT-FILE. If any Lisp file
@@ -520,7 +520,7 @@ binds `generated-autoload-file' as a file-local variable, write
its autoloads into the specified file instead.
The function does NOT recursively descend into subdirectories of the
-directory or directories specified by DIRS.
+directories specified by DIR.
Optional argument EXCLUDED-FILES, if non-nil, should be a list of
files, such as preloaded files, whose autoloads should not be written
From 1ccfd3bae2dffe5cf33202eb4479f4daf722b265 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 09:17:30 +0200
Subject: [PATCH 375/915] Use substitute-command-keys in proced-help
* lisp/proced.el (proced-help-string, proced-help): Use
substitute-command-keys.
---
lisp/proced.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/lisp/proced.el b/lisp/proced.el
index c278cce9dc7..0f0937cac81 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -426,7 +426,14 @@ Important: the match ends just after the marker.")
"Name of Proced Log buffer.")
(defconst proced-help-string
- "(n)ext, (p)revious, (m)ark, (u)nmark, (k)ill, (q)uit (type ? for more help)"
+ (concat "\\ "
+ "\\[next-line] next, "
+ "\\[previous-line] previous, "
+ "\\[proced-mark] mark, "
+ "\\[proced-unmark] unmark, "
+ "\\[proced-send-signal] kill, "
+ "\\[quit-window] quit "
+ "(type \\[proced-help] for more help)")
"Help string for Proced.")
(defconst proced-header-help-echo
@@ -1978,7 +1985,7 @@ STRING is an overall summary of the failures."
(proced-why)
(if (eq last-command 'proced-help)
(describe-mode)
- (message proced-help-string)))
+ (message (substitute-command-keys proced-help-string))))
(defun proced-undo ()
"Undo in a Proced buffer.
From 429e61b130232e69531f7d44b2bc610d43c8217d Mon Sep 17 00:00:00 2001
From: Po Lu
Date: Thu, 15 Sep 2022 15:30:32 +0800
Subject: [PATCH 376/915] More fixes for XDND proxy support
* src/xterm.c (handle_one_xevent): Check replies against
toplevel, not proxy.
---
src/xterm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index 96d25b26434..4c3b8128175 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -17676,7 +17676,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (x_dnd_last_protocol_version != -1
&& x_dnd_in_progress
- && target == x_dnd_last_seen_window
+ && target == x_dnd_last_seen_toplevel
/* The XDND documentation is not very clearly worded.
But this should be the correct behavior, since
"kDNDStatusSendHereFlag" in the reference
@@ -20377,7 +20377,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
else if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1)
{
- x_dnd_pending_finish_target = x_dnd_last_seen_window;
+ x_dnd_pending_finish_target = x_dnd_last_seen_toplevel;
x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version;
x_dnd_waiting_for_finish
@@ -21914,7 +21914,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
else if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1)
{
- x_dnd_pending_finish_target = x_dnd_last_seen_window;
+ x_dnd_pending_finish_target = x_dnd_last_seen_toplevel;
x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version;
x_dnd_waiting_for_finish
From f941cc76df7476a055350b3b1b7e9e61d1ddb246 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?=
Date: Wed, 14 Sep 2022 18:46:40 +0200
Subject: [PATCH 377/915] mapconcat fast path with `identity` function argument
This makes (mapconcat #'identity SEQ) slightly faster than
(apply #'concat SEQ), which used to be much faster.
Notably, `string-join` benefits from this change as it uses mapconcat.
* src/fns.c (Fmapconcat): Speed up execution when the function
argument is `identity`.
---
src/fns.c | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/src/fns.c b/src/fns.c
index 2f4808be3d0..9dd10fe4438 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2930,15 +2930,37 @@ FUNCTION must be a function of one argument, and must return a value
return empty_unibyte_string;
Lisp_Object *args;
SAFE_ALLOCA_LISP (args, args_alloc);
+ if (EQ (function, Qidentity))
+ {
+ /* Fast path when no function call is necessary. */
+ if (CONSP (sequence))
+ {
+ Lisp_Object src = sequence;
+ Lisp_Object *dst = args;
+ do
+ {
+ *dst++ = XCAR (src);
+ src = XCDR (src);
+ }
+ while (!NILP (src));
+ goto concat;
+ }
+ else if (VECTORP (sequence))
+ {
+ memcpy (args, XVECTOR (sequence)->contents, leni * sizeof *args);
+ goto concat;
+ }
+ }
ptrdiff_t nmapped = mapcar1 (leni, args, function, sequence);
- ptrdiff_t nargs = 2 * nmapped - 1;
eassert (nmapped == leni);
+ concat: ;
+ ptrdiff_t nargs = args_alloc;
if (NILP (separator) || (STRINGP (separator) && SCHARS (separator) == 0))
- nargs = nmapped;
+ nargs = leni;
else
{
- for (ptrdiff_t i = nmapped - 1; i > 0; i--)
+ for (ptrdiff_t i = leni - 1; i > 0; i--)
args[i + i] = args[i];
for (ptrdiff_t i = 1; i < nargs; i += 2)
From 3ad2adc48c700a8c15459f623081c32420f0b726 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?=
Date: Wed, 14 Sep 2022 19:19:08 +0200
Subject: [PATCH 378/915] Simplify and shrink reader buffers
A big on-stack buffer in a potentially long-running function can
interact badly with the GC's conservative scanning of the C stack.
It may make the scanning slower (since the stack frame is big) and
risks accidental retention of objects from stack detritus
(because the buffer isn't cleaned on entry).
* src/lread.c (stackbufsize): Remove.
(read_integer, read_string_literal, read_bool_vector): Use a local
buffer instead of piggy-backing on that in read0.
(read0): Reduce buffer to something suitable for most identifiers and
numbers.
---
src/lread.c | 38 +++++++++++++++++---------------------
1 file changed, 17 insertions(+), 21 deletions(-)
diff --git a/src/lread.c b/src/lread.c
index d64a4fad3af..51cbf811bab 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2914,20 +2914,17 @@ invalid_radix_integer (EMACS_INT radix, Lisp_Object readcharfun)
invalid_syntax (buf, readcharfun);
}
-/* Size of the fixed-size buffer used during reading. */
-enum { stackbufsize = 1024 };
-
/* Read an integer in radix RADIX using READCHARFUN to read
- characters. RADIX must be in the interval [2..36]. Use STACKBUF
- for temporary storage as needed. Value is the integer read.
+ characters. RADIX must be in the interval [2..36].
+ Value is the integer read.
Signal an error if encountering invalid read syntax. */
static Lisp_Object
-read_integer (Lisp_Object readcharfun, int radix,
- char stackbuf[VLA_ELEMS (stackbufsize)])
+read_integer (Lisp_Object readcharfun, int radix)
{
+ char stackbuf[20];
char *read_buffer = stackbuf;
- ptrdiff_t read_buffer_size = stackbufsize;
+ ptrdiff_t read_buffer_size = sizeof stackbuf;
char *p = read_buffer;
char *heapbuf = NULL;
int valid = -1; /* 1 if valid, 0 if not, -1 if incomplete. */
@@ -3028,11 +3025,11 @@ read_char_literal (Lisp_Object readcharfun)
/* Read a string literal (preceded by '"'). */
static Lisp_Object
-read_string_literal (char stackbuf[VLA_ELEMS (stackbufsize)],
- Lisp_Object readcharfun)
+read_string_literal (Lisp_Object readcharfun)
{
+ char stackbuf[1024];
char *read_buffer = stackbuf;
- ptrdiff_t read_buffer_size = stackbufsize;
+ ptrdiff_t read_buffer_size = sizeof stackbuf;
specpdl_ref count = SPECPDL_INDEX ();
char *heapbuf = NULL;
char *p = read_buffer;
@@ -3355,8 +3352,7 @@ string_props_from_rev_list (Lisp_Object elems, Lisp_Object readcharfun)
/* Read a bool vector (preceded by "#&"). */
static Lisp_Object
-read_bool_vector (char stackbuf[VLA_ELEMS (stackbufsize)],
- Lisp_Object readcharfun)
+read_bool_vector (Lisp_Object readcharfun)
{
ptrdiff_t length = 0;
for (;;)
@@ -3374,7 +3370,7 @@ read_bool_vector (char stackbuf[VLA_ELEMS (stackbufsize)],
}
ptrdiff_t size_in_chars = bool_vector_bytes (length);
- Lisp_Object str = read_string_literal (stackbuf, readcharfun);
+ Lisp_Object str = read_string_literal (readcharfun);
if (STRING_MULTIBYTE (str)
|| !(size_in_chars == SCHARS (str)
/* We used to print 1 char too many when the number of bits
@@ -3696,7 +3692,7 @@ read_stack_reset (intmax_t sp)
static Lisp_Object
read0 (Lisp_Object readcharfun, bool locate_syms)
{
- char stackbuf[stackbufsize];
+ char stackbuf[64];
char *read_buffer = stackbuf;
ptrdiff_t read_buffer_size = sizeof stackbuf;
char *heapbuf = NULL;
@@ -3893,7 +3889,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
case '&':
/* #&N"..." -- bool-vector */
- obj = read_bool_vector (stackbuf, readcharfun);
+ obj = read_bool_vector (readcharfun);
break;
case '!':
@@ -3909,17 +3905,17 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
case 'x':
case 'X':
- obj = read_integer (readcharfun, 16, stackbuf);
+ obj = read_integer (readcharfun, 16);
break;
case 'o':
case 'O':
- obj = read_integer (readcharfun, 8, stackbuf);
+ obj = read_integer (readcharfun, 8);
break;
case 'b':
case 'B':
- obj = read_integer (readcharfun, 2, stackbuf);
+ obj = read_integer (readcharfun, 2);
break;
case '@':
@@ -3988,7 +3984,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
/* #NrDIGITS -- radix-N number */
if (n < 0 || n > 36)
invalid_radix_integer (n, readcharfun);
- obj = read_integer (readcharfun, n, stackbuf);
+ obj = read_integer (readcharfun, n);
break;
}
else if (n <= MOST_POSITIVE_FIXNUM && !NILP (Vread_circle))
@@ -4043,7 +4039,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
break;
case '"':
- obj = read_string_literal (stackbuf, readcharfun);
+ obj = read_string_literal (readcharfun);
break;
case '\'':
From 824ae5faeec9cfa5e14e750030d55800b08ad7f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?=
Date: Sat, 27 Aug 2022 14:20:38 +0200
Subject: [PATCH 379/915] Use `eql` or `eq` instead of `=` in some places
For a switch op to be generated, comparisons must be made using `eq`,
`eql` or `equal`, not `=`.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
* lisp/files.el (file-modes-char-to-who, file-modes-char-to-right):
* lisp/international/titdic-cnv.el (tit-process-header):
* lisp/language/ethio-util.el (ethio-input-special-character)
(ethio-fidel-to-tex-buffer):
* lisp/language/lao.el (consonant):
Use `eq` or `eql` instead of `=`.
In these cases either `eq` or `eql` would do and the choice does not
affect the resulting code. We compare numbers with `eql` and
characters with `eq` as a matter of style.
---
lisp/emacs-lisp/byte-opt.el | 8 +++---
lisp/files.el | 38 ++++++++++++++--------------
lisp/international/titdic-cnv.el | 10 ++++----
lisp/language/ethio-util.el | 43 ++++++++++++++++----------------
lisp/language/lao.el | 6 ++---
5 files changed, 53 insertions(+), 52 deletions(-)
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 27b0d33d3ef..0d5f8c26eb2 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1999,20 +1999,20 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance."
(setq keep-going t)
(setq tmp (aref byte-stack+-info (symbol-value (car lap0))))
(setq rest (cdr rest))
- (cond ((= tmp 1)
+ (cond ((eql tmp 1)
(byte-compile-log-lap
" %s discard\t-->\t" lap0)
(setq lap (delq lap0 (delq lap1 lap))))
- ((= tmp 0)
+ ((eql tmp 0)
(byte-compile-log-lap
" %s discard\t-->\t discard" lap0)
(setq lap (delq lap0 lap)))
- ((= tmp -1)
+ ((eql tmp -1)
(byte-compile-log-lap
" %s discard\t-->\tdiscard discard" lap0)
(setcar lap0 'byte-discard)
(setcdr lap0 0))
- ((error "Optimizer error: too much on the stack"))))
+ (t (error "Optimizer error: too much on the stack"))))
;;
;; goto*-X X: --> X:
;;
diff --git a/lisp/files.el b/lisp/files.el
index 540bc2a6a85..0f2d3ca4b9a 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -8271,10 +8271,10 @@ CHAR is in [ugoa] and represents the category of users (Owner, Group,
Others, or All) for whom to produce the mask.
The bit-mask that is returned extracts from mode bits the access rights
for the specified category of users."
- (cond ((= char ?u) #o4700)
- ((= char ?g) #o2070)
- ((= char ?o) #o1007)
- ((= char ?a) #o7777)
+ (cond ((eq char ?u) #o4700)
+ ((eq char ?g) #o2070)
+ ((eq char ?o) #o1007)
+ ((eq char ?a) #o7777)
(t (error "%c: Bad `who' character" char))))
(defun file-modes-char-to-right (char &optional from)
@@ -8282,22 +8282,22 @@ for the specified category of users."
CHAR is in [rwxXstugo] and represents symbolic access permissions.
If CHAR is in [Xugo], the value is taken from FROM (or 0 if omitted)."
(or from (setq from 0))
- (cond ((= char ?r) #o0444)
- ((= char ?w) #o0222)
- ((= char ?x) #o0111)
- ((= char ?s) #o6000)
- ((= char ?t) #o1000)
+ (cond ((eq char ?r) #o0444)
+ ((eq char ?w) #o0222)
+ ((eq char ?x) #o0111)
+ ((eq char ?s) #o6000)
+ ((eq char ?t) #o1000)
;; Rights relative to the previous file modes.
- ((= char ?X) (if (= (logand from #o111) 0) 0 #o0111))
- ((= char ?u) (let ((uright (logand #o4700 from)))
- ;; FIXME: These divisions/shifts seem to be right
- ;; for the `7' part of the #o4700 mask, but not
- ;; for the `4' part. Same below for `g' and `o'.
- (+ uright (/ uright #o10) (/ uright #o100))))
- ((= char ?g) (let ((gright (logand #o2070 from)))
- (+ gright (/ gright #o10) (* gright #o10))))
- ((= char ?o) (let ((oright (logand #o1007 from)))
- (+ oright (* oright #o10) (* oright #o100))))
+ ((eq char ?X) (if (= (logand from #o111) 0) 0 #o0111))
+ ((eq char ?u) (let ((uright (logand #o4700 from)))
+ ;; FIXME: These divisions/shifts seem to be right
+ ;; for the `7' part of the #o4700 mask, but not
+ ;; for the `4' part. Same below for `g' and `o'.
+ (+ uright (/ uright #o10) (/ uright #o100))))
+ ((eq char ?g) (let ((gright (logand #o2070 from)))
+ (+ gright (/ gright #o10) (* gright #o10))))
+ ((eq char ?o) (let ((oright (logand #o1007 from)))
+ (+ oright (* oright #o10) (* oright #o100))))
(t (error "%c: Bad right character" char))))
(defun file-modes-rights-to-number (rights who-mask &optional from)
diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index 080045e7520..d2a6ee1e9d1 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -281,7 +281,7 @@ SPC, 6, 3, 4, or 7 specifying a tone (SPC:陰平, 6:陽平, 3:上聲, 4:去聲,
(while (not (eobp))
(let ((ch (following-char))
(pos (point)))
- (cond ((= ch ?C) ; COMMENT
+ (cond ((eq ch ?C) ; COMMENT
(cond ((looking-at "COMMENT")
(let ((pos (match-end 0))
(to (progn (end-of-line) (point))))
@@ -295,7 +295,7 @@ SPC, 6, 3, 4, or 7 specifying a tone (SPC:陰平, 6:陽平, 3:上聲, 4:去聲,
(setq tit-comments
(cons (buffer-substring-no-properties pos (point))
tit-comments))))))
- ((= ch ?M) ; MULTICHOICE, MOVERIGHT, MOVELEFT
+ ((eq ch ?M) ; MULTICHOICE, MOVERIGHT, MOVELEFT
(cond ((looking-at "MULTICHOICE:[ \t]*")
(goto-char (match-end 0))
(setq tit-multichoice (looking-at "YES")))
@@ -305,7 +305,7 @@ SPC, 6, 3, 4, or 7 specifying a tone (SPC:陰平, 6:陽平, 3:上聲, 4:去聲,
((looking-at "MOVELEFT:[ \t]*")
(goto-char (match-end 0))
(setq tit-moveleft (tit-read-key-value)))))
- ((= ch ?P) ; PROMPT
+ ((eq ch ?P) ; PROMPT
(cond ((looking-at "PROMPT:[ \t]*")
(goto-char (match-end 0))
(setq tit-prompt (tit-read-key-value))
@@ -316,7 +316,7 @@ SPC, 6, 3, 4, or 7 specifying a tone (SPC:陰平, 6:陽平, 3:上聲, 4:去聲,
(if (or (eq (nth 1 split) 32)
(eq (nth 2 split) 32))
(setq tit-prompt (substring tit-prompt 0 -1)))))))
- ((= ch ?B) ; BACKSPACE, BEGINDICTIONARY,
+ ((eq ch ?B) ; BACKSPACE, BEGINDICTIONARY,
; BEGINPHRASE
(cond ((looking-at "BACKSPACE:[ \t]*")
(goto-char (match-end 0))
@@ -325,7 +325,7 @@ SPC, 6, 3, 4, or 7 specifying a tone (SPC:陰平, 6:陽平, 3:上聲, 4:去聲,
(setq tit-dictionary t))
((looking-at "BEGINPHRASE")
(setq tit-dictionary nil))))
- ((= ch ?K) ; KEYPROMPT
+ ((eq ch ?K) ; KEYPROMPT
(cond ((looking-at "KEYPROMPT(\\(.*\\)):[ \t]*")
(let ((key-char (match-string 1)))
(goto-char (match-end 0))
diff --git a/lisp/language/ethio-util.el b/lisp/language/ethio-util.el
index a0159679da2..2f76acfe7cb 100644
--- a/lisp/language/ethio-util.el
+++ b/lisp/language/ethio-util.el
@@ -794,15 +794,15 @@ The 2nd and 3rd arguments BEGIN and END specify the region."
"This function is deprecated."
(interactive "*cInput number: 1. 2. 3. 4. 5.")
(cond
- ((= arg ?1)
+ ((eq arg ?1)
(insert ""))
- ((= arg ?2)
+ ((eq arg ?2)
(insert ""))
- ((= arg ?3)
+ ((eq arg ?3)
(insert ""))
- ((= arg ?4)
+ ((eq arg ?4)
(insert ""))
- ((= arg ?5)
+ ((eq arg ?5)
(insert ""))
(t
(error ""))))
@@ -816,7 +816,7 @@ The 2nd and 3rd arguments BEGIN and END specify the region."
"Convert each fidel characters in the current buffer into a fidel-tex command."
(interactive)
(let ((buffer-read-only nil)
- comp ch)
+ comp)
;; Special treatment for geminated characters.
;; Geminated characters la", etc. change into \geminateG{\laG}, etc.
@@ -835,21 +835,22 @@ The 2nd and 3rd arguments BEGIN and END specify the region."
;; Special Ethiopic punctuation.
(goto-char (point-min))
(while (re-search-forward "\\ce[».?]\\|«\\ce" nil t)
- (cond
- ((= (setq ch (preceding-char)) ?\»)
- (delete-char -1)
- (insert "\\rquoteG"))
- ((= ch ?.)
- (delete-char -1)
- (insert "\\dotG"))
- ((= ch ??)
- (delete-char -1)
- (insert "\\qmarkG"))
- (t
- (forward-char -1)
- (delete-char -1)
- (insert "\\lquoteG")
- (forward-char 1))))
+ (let ((ch (preceding-char)))
+ (cond
+ ((eq ch ?\»)
+ (delete-char -1)
+ (insert "\\rquoteG"))
+ ((eq ch ?.)
+ (delete-char -1)
+ (insert "\\dotG"))
+ ((eq ch ??)
+ (delete-char -1)
+ (insert "\\qmarkG"))
+ (t
+ (forward-char -1)
+ (delete-char -1)
+ (insert "\\lquoteG")
+ (forward-char 1)))))
;; Ethiopic characters to TeX macros
(robin-invert-region (point-min) (point-max) "ethiopic-tex")
diff --git a/lisp/language/lao.el b/lisp/language/lao.el
index 1861eff15eb..0ad5b9f84e3 100644
--- a/lisp/language/lao.el
+++ b/lisp/language/lao.el
@@ -60,9 +60,9 @@
(len (length chars))
;; Replace `c', `t', `v' to consonant, tone, and vowel.
(regexp (mapconcat (lambda (c)
- (cond ((= c ?c) consonant)
- ((= c ?t) tone)
- ((= c ?v) vowel-upper-lower)
+ (cond ((eq c ?c) consonant)
+ ((eq c ?t) tone)
+ ((eq c ?v) vowel-upper-lower)
(t (string c))))
(cdr l) ""))
;; Element of composition-function-table.
From 6d61d6018c00fd952937966a8cadfd1e7c102efa Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 11:27:57 +0200
Subject: [PATCH 380/915] Add rudimentary font-locking to edit-abbrevs-mode
* lisp/abbrev.el (abbrev-table-name): New face.
(edit-abbrevs-mode-font-lock-keywords): New defvar.
(edit-abbrevs-mode): Support font-locking.
---
etc/NEWS | 5 +++++
lisp/abbrev.el | 20 +++++++++++++++++---
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index decaff7fe6f..c88af4e90cf 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2444,6 +2444,11 @@ remote host are shown. Alternatively, the user option
*** 'outlineify-sticky' command is renamed to 'allout-outlinify-sticky'.
The old name is still available as an obsolete function alias.
+---
+*** 'edit-abbrevs' now uses font-locking.
+The new face 'abbrev-table-name' is used to display the abbrev table
+name.
+
* New Modes and Packages in Emacs 29.1
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 718938df0cb..a4f0196a789 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -1,7 +1,6 @@
;;; abbrev.el --- abbrev mode commands for Emacs -*- lexical-binding: t -*-
-;; Copyright (C) 1985-1987, 1992, 2001-2022 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1985-2022 Free Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Keywords: abbrev convenience
@@ -1220,13 +1219,28 @@ SORTFUN is passed to `sort' to change the default ordering."
(sort entries (lambda (x y)
(funcall sortfun (nth 2 x) (nth 2 y)))))))
+(defface abbrev-table-name
+ '((t :inherit font-lock-function-name-face))
+ "Face used for displaying the abbrev table name in `edit-abbrev-mode'."
+ :version "29.1")
+
+(defvar edit-abbrevs-mode-font-lock-keywords
+ `((,(rx bol "("
+ ;; lisp-mode-symbol-regexp
+ (regexp "\\(?:\\sw\\|\\s_\\|\\\\.\\)+")
+ ")" eol)
+ 0 'abbrev-table-name)))
+
;; Keep it after define-abbrev-table, since define-derived-mode uses
;; define-abbrev-table.
(define-derived-mode edit-abbrevs-mode fundamental-mode "Edit-Abbrevs"
"Major mode for editing the list of abbrev definitions.
This mode is for editing abbrevs in a buffer prepared by `edit-abbrevs',
which see."
- :interactive nil)
+ :interactive nil
+ (setq-local font-lock-defaults
+ '(edit-abbrevs-mode-font-lock-keywords nil nil ((?_ . "w"))))
+ (setq font-lock-multiline nil))
(defun abbrev--possibly-save (query &optional arg)
;; Query mode.
From 09e93c4dafc6ffa3e556429757348adfa49a5a83 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Thu, 15 Sep 2022 14:51:31 +0300
Subject: [PATCH 381/915] Implement support for 'wallpaper-set' on MS-Windows
* src/w32fns.c (Fw32_set_wallpaper): New primitive.
(syms_of_w32fns): Defsubr it.
(globals_of_w32fns): Attempt to load SystemParametersInfoW from
its DLL at run time.
* lisp/image/wallpaper.el (wallpaper-set): Support MS-Windows by
calling 'w32-set-wallpaper'.
* etc/NEWS: Update and simplify wording of the 'wallpaper-set'
entry.
---
etc/NEWS | 18 +++++-------
lisp/image/wallpaper.el | 4 ++-
src/w32fns.c | 63 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 73 insertions(+), 12 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index c88af4e90cf..cc68cd82b86 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2463,17 +2463,13 @@ to optionally rotate images which have the :rotation property.
---
** New package 'wallpaper'.
-This package provides the command `wallpaper-set', which sets the
-desktop background.
-
-On GNU/Linux and other Unix-like systems, it uses an external command
-(such as "swaybg", "gm", "display" or "xloadimage"). A suitable
-command should be detected automatically in most cases, but can also
-be customized manually with the new user options 'wallpaper-command'
-and 'wallpaper-command-args' if needed.
-
-On Haiku, it uses the new function `haiku-set-wallpaper', which does
-not rely on any external command.
+This package provides the command 'wallpaper-set', which sets the
+desktop background image. Depending on the system and the desktop,
+this may require an external program (such as 'swaybg', 'gm',
+'display' or 'xloadimage'). If so, a suitable command should be
+detected automatically in most cases, and can also be customized
+manually if needed using the new user options 'wallpaper-command' and
+'wallpaper-command-args'.
+++
** New package 'oclosure'.
diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index 2ebe5be0330..ef2ad31eba7 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -240,7 +240,9 @@ On Haiku, no external command is needed, so the value of
(error "No such file: %s" file))
(unless (file-readable-p file)
(error "File is not readable: %s" file))
- (cond ((featurep 'haiku)
+ (cond ((eq system-type 'windows-nt)
+ (w32-set-wallpaper file))
+ ((featurep 'haiku)
(haiku-set-wallpaper file))
(t
(let* ((fmt-spec `((?f . ,(expand-file-name file))
diff --git a/src/w32fns.c b/src/w32fns.c
index 745458d0a03..d9070675a28 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -10447,6 +10447,66 @@ w32_get_resource (const char *key, const char *name, LPDWORD lpdwtype)
return (NULL);
}
+#ifdef WINDOWSNT
+
+/***********************************************************************
+ Wallpaper
+ ***********************************************************************/
+
+typedef BOOL (WINAPI * SystemParametersInfoW_Proc) (UINT,UINT,PVOID,UINT);
+SystemParametersInfoW_Proc system_parameters_info_w_fn = NULL;
+
+DEFUN ("w32-set-wallpaper", Fw32_set_wallpaper, Sw32_set_wallpaper, 1, 1, 0,
+ doc: /* Set the desktop wallpaper image to IMAGE-FILE. */)
+ (Lisp_Object image_file)
+{
+ Lisp_Object encoded = ENCODE_FILE (Fexpand_file_name (image_file, Qnil));
+ char *fname = SSDATA (encoded);
+ BOOL result = false;
+ DWORD err = 0;
+
+ /* UNICOWS.DLL seems to have SystemParametersInfoW, but it doesn't
+ seem to be worth the hassle to support that on Windows 9X for the
+ benefit of this minor feature. Let them use on Windows 9X only
+ image file names that can be encoded by the system codepage. */
+ if (w32_unicode_filenames && system_parameters_info_w_fn)
+ {
+ wchar_t fname_w[MAX_PATH];
+
+ if (filename_to_utf16 (fname, fname_w) != 0)
+ err = ERROR_FILE_NOT_FOUND;
+ else
+ result = SystemParametersInfoW (SPI_SETDESKWALLPAPER, 0, fname_w,
+ SPIF_SENDCHANGE);
+ }
+ else
+ {
+ char fname_a[MAX_PATH];
+
+ if (filename_to_ansi (fname, fname_a) != 0)
+ err = ERROR_FILE_NOT_FOUND;
+ else
+ result = SystemParametersInfoA (SPI_SETDESKWALLPAPER, 0, fname_a,
+ SPIF_SENDCHANGE);
+ }
+ if (!result)
+ {
+ if (err == ERROR_FILE_NOT_FOUND)
+ error ("Wallpaper file %s does not exist or cannot be accessed", fname);
+ else
+ {
+ err = GetLastError ();
+ if (err)
+ error ("Could not set desktop wallpaper: %s", w32_strerror (err));
+ else
+ error ("Could not set desktop wallpaper (wrong image type?)");
+ }
+ }
+
+ return Qnil;
+}
+#endif
+
/***********************************************************************
Initialization
***********************************************************************/
@@ -10926,6 +10986,7 @@ keys when IME input is received. */);
defsubr (&Sx_file_dialog);
#ifdef WINDOWSNT
defsubr (&Ssystem_move_file_to_trash);
+ defsubr (&Sw32_set_wallpaper);
#endif
}
@@ -11179,6 +11240,8 @@ globals_of_w32fns (void)
get_proc_addr (user32_lib, "EnumDisplayMonitors");
get_title_bar_info_fn = (GetTitleBarInfo_Proc)
get_proc_addr (user32_lib, "GetTitleBarInfo");
+ system_parameters_info_w_fn = (SystemParametersInfoW_Proc)
+ get_proc_addr (user32_lib, "SystemParametersInfoW");
{
HMODULE imm32_lib = GetModuleHandle ("imm32.dll");
From 6bcc7a2df733f86925780aed448dd38aa933507b Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Thu, 15 Sep 2022 14:59:50 +0300
Subject: [PATCH 382/915] ; Fix last change in w32fns.c.
---
src/w32fns.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/w32fns.c b/src/w32fns.c
index d9070675a28..5f652ae9e46 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -11240,8 +11240,10 @@ globals_of_w32fns (void)
get_proc_addr (user32_lib, "EnumDisplayMonitors");
get_title_bar_info_fn = (GetTitleBarInfo_Proc)
get_proc_addr (user32_lib, "GetTitleBarInfo");
+#ifndef CYGWIN
system_parameters_info_w_fn = (SystemParametersInfoW_Proc)
get_proc_addr (user32_lib, "SystemParametersInfoW");
+#endif
{
HMODULE imm32_lib = GetModuleHandle ("imm32.dll");
From 99bb6de7e17286a97caa2716b1c301bcd838d371 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 15:44:06 +0200
Subject: [PATCH 383/915] ; Silence byte-compiler in wallpaper.el
* lisp/image/wallpaper.el (w32-set-wallpaper): Declare.
---
lisp/image/wallpaper.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index ef2ad31eba7..b5ce7355cd0 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -215,6 +215,7 @@ See also `wallpaper-default-width'.")
(funcall fun)
(read-number (format "Wallpaper %s in pixels: " desc) default)))
+(declare-function w32-set-wallpaper "w32fns.c")
(declare-function haiku-set-wallpaper "term/haiku-win.el")
(defun wallpaper-set (file)
From 471414fe6ba8e9c9d755a83e7feddcdd5a45456a Mon Sep 17 00:00:00 2001
From: Juri Linkov
Date: Thu, 15 Sep 2022 19:30:17 +0300
Subject: [PATCH 384/915] Fix outline image icon display (bug#57813)
* lisp/outline.el (outline--make-button-overlay): Don't overwrite
image display with string display when image exists.
(outline--fix-up-all-buttons): Optimize.
---
lisp/outline.el | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/lisp/outline.el b/lisp/outline.el
index b19e0cf8119..c9d1a4ac64b 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -1003,11 +1003,11 @@ If non-nil, EVENT should be a mouse event."
;; movement commands work more logically.
(when (derived-mode-p 'special-mode)
(put-text-property (point) (1+ (point)) 'face (plist-get icon 'face)))
- (when-let ((image (plist-get icon 'image)))
- (overlay-put o 'display image))
- (overlay-put o 'display (concat (plist-get icon 'string)
- (string (char-after (point)))))
- (overlay-put o 'face (plist-get icon 'face)))
+ (if-let ((image (plist-get icon 'image)))
+ (overlay-put o 'display image)
+ (overlay-put o 'display (concat (plist-get icon 'string)
+ (string (char-after (point)))))
+ (overlay-put o 'face (plist-get icon 'face))))
o))
(defun outline--insert-open-button ()
@@ -1041,11 +1041,11 @@ If non-nil, EVENT should be a mouse event."
"" #'outline-show-subtree))))))
(defun outline--fix-up-all-buttons (&optional from to)
- (when from
- (save-excursion
- (goto-char from)
- (setq from (line-beginning-position))))
(when (outline--use-buttons-p)
+ (when from
+ (save-excursion
+ (goto-char from)
+ (setq from (line-beginning-position))))
(outline-map-region
(lambda ()
;; `outline--cycle-state' will fail if we're in a totally
From 2e0cde244a99b83b221dc5ecce24167bf4bc1a5d Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 18:27:48 +0200
Subject: [PATCH 385/915] Support macOS in wallpaper.el
* lisp/image/wallpaper.el (wallpaper--default-commands)
(wallpaper-command): Support macOS using "osascript".
(wallpaper-set): Display image name when wallpaper-debug is t.
---
lisp/image/wallpaper.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index b5ce7355cd0..d024d6238cb 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -31,6 +31,10 @@
;; On Haiku, it uses the `haiku-set-wallpaper' function, which does
;; not rely on any external commands.
;;
+;; On macOS, the "osascript" command is used. You might need to
+;; disable the option "Change picture" in the "Desktop & Screensaver"
+;; preferences for this to work (this was seen with macOS 10.13).
+;;
;; Finding an external command to use is obviously a bit tricky to get
;; right, as there is no lack of platforms, window managers, desktop
;; environments and tools. However, it should be detected
@@ -57,6 +61,8 @@
("gsettings" "set" "org.gnome.desktop.background" "picture-uri" "file://%f")
;; KDE Plasma
("plasma-apply-wallpaperimage" "%f")
+ ;; macOS
+ ("osascript" "-e" "tell application \"Finder\" to set desktop picture to POSIX file \"%f\"")
;; Other / General X
("gm" "display" "-size" "%wx%h" "-window" "root" "%f")
("display" "-resize" "%wx%h" "-window" "root" "%f")
@@ -157,7 +163,8 @@ native API will be used instead (see `haiku-set-wallpaper')."
(const :tag "xwallpaper (X Window System)" "xwallpaper")
(const :tag "hsetroot (X Window System)" "hsetroot")
(const :tag "xloadimage (X Window System)" "xloadimage")
- (const :tag "xsetbg (X Window System)" "xsetbg"))
+ (const :tag "xsetbg (X Window System)" "xsetbg")
+ (const :tag "osascript (macOS)" "osascript"))
(const :tag "Other (specify)" string))
:set #'wallpaper--set-wallpaper-command
:group 'image
@@ -241,6 +248,7 @@ On Haiku, no external command is needed, so the value of
(error "No such file: %s" file))
(unless (file-readable-p file)
(error "File is not readable: %s" file))
+ (wallpaper-debug "Using image %S:" file)
(cond ((eq system-type 'windows-nt)
(w32-set-wallpaper file))
((featurep 'haiku)
From 3ba47a0782f7059062ca6743b22c40a410933f13 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 18:48:41 +0200
Subject: [PATCH 386/915] Improve error when wallpaper-command is nil
* lisp/image/wallpaper.el (wallpaper-set): Improve the error message
when 'wallpaper-command' is nil.
---
lisp/image/wallpaper.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index d024d6238cb..fe6882a5880 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -254,6 +254,8 @@ On Haiku, no external command is needed, so the value of
((featurep 'haiku)
(haiku-set-wallpaper file))
(t
+ (unless wallpaper-command
+ (error "Couldn't find a command to set the wallpaper with"))
(let* ((fmt-spec `((?f . ,(expand-file-name file))
(?h . ,(wallpaper--get-height-or-width
"height"
From 4907859ee039f0d707b21050c2dec7d49f571590 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 19:12:10 +0200
Subject: [PATCH 387/915] Document MS-Windows support in wallpaper.el
* lisp/image/wallpaper.el: Add MS-Windows to Commentary.
(wallpaper-command, wallpaper-command-args, wallpaper-set):
Document MS-Windows support.
---
etc/NEWS | 4 ++--
lisp/image/wallpaper.el | 30 ++++++++++++++++--------------
2 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index cc68cd82b86..72c330f5f77 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2467,8 +2467,8 @@ This package provides the command 'wallpaper-set', which sets the
desktop background image. Depending on the system and the desktop,
this may require an external program (such as 'swaybg', 'gm',
'display' or 'xloadimage'). If so, a suitable command should be
-detected automatically in most cases, and can also be customized
-manually if needed using the new user options 'wallpaper-command' and
+detected automatically in most cases. It can also be customized
+manually if needed, using the new user options 'wallpaper-command' and
'wallpaper-command-args'.
+++
diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index fe6882a5880..5622f9b8e8a 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -28,19 +28,21 @@
;; On GNU/Linux and other Unix-like systems, it uses an external
;; command to set the desktop background.
;;
-;; On Haiku, it uses the `haiku-set-wallpaper' function, which does
-;; not rely on any external commands.
-;;
-;; On macOS, the "osascript" command is used. You might need to
-;; disable the option "Change picture" in the "Desktop & Screensaver"
-;; preferences for this to work (this was seen with macOS 10.13).
-;;
;; Finding an external command to use is obviously a bit tricky to get
;; right, as there is no lack of platforms, window managers, desktop
;; environments and tools. However, it should be detected
;; automatically in most cases. If it doesn't work in your
;; environment, customize the user options `wallpaper-command' and
;; `wallpaper-command-args'.
+;;
+;; On MS-Windows, it uses the `w32-set-wallpaper' function, and on
+;; Haiku the `haiku-set-wallpaper' function, neither of which relies
+;; on any external commands. The value of `wallpaper-command' and
+;; `wallpaper-command-args' are ignored on such systems.
+;;
+;; On macOS, the "osascript" command is used. You might need to
+;; disable the option "Change picture" in the "Desktop & Screensaver"
+;; preferences for this to work (this was seen with macOS 10.13).
;;; Code:
@@ -131,7 +133,7 @@ Used to set `wallpaper-command'."
(wallpaper--find-command-arguments))))
(defcustom wallpaper-command (wallpaper--find-command)
- "Executable used for setting the wallpaper.
+ "Executable used by `wallpaper-set' for setting the wallpaper.
A suitable command for your environment should be detected
automatically, so there is usually no need to customize this.
@@ -147,8 +149,8 @@ hear about it! Please send an email to bug-gnu-emacs@gnu.org and
tell us the command (and all options) that worked for you. You
can also use \\[report-emacs-bug].
-The value of this variable is ignored on Haiku systems, where a
-native API will be used instead (see `haiku-set-wallpaper')."
+The value of this variable is ignored on MS-Windows and Haiku
+systems, where a native API is used instead."
:type
'(choice
(radio
@@ -186,8 +188,8 @@ returned by `display-pixel-width').
If `wallpaper-set' is run from a TTY frame, it will prompt for a
height and width for \"%h\" and \"%w\" instead.
-The value of this variable is ignored on Haiku systems, where a
-native API will be used instead (see `haiku-set-wallpaper')."
+The value of this variable is ignored on MS-Windows and Haiku
+systems, where a native API is used instead."
:type '(repeat string)
:group 'image
:version "29.1")
@@ -233,8 +235,8 @@ external command. Which command to use is automatically detected
in most cases, but can be manually customized with the user
options `wallpaper-command' and `wallpaper-command-args'.
-On Haiku, no external command is needed, so the value of
-`wallpaper-commands' is ignored."
+On MS-Windows and Haiku systems, no external command is needed,
+so the value of `wallpaper-commands' is ignored."
(interactive (list (and
(display-graphic-p)
(read-file-name "Set desktop background to: "
From 3c1579697ff03d3991b41ead503211cffac0998f Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 19:21:51 +0200
Subject: [PATCH 388/915] ; Fix wallpaper-set on TTY
* lisp/image/wallpaper.el (wallpaper-set): Don't check for
'display-graphic-p', to allow setting the wallpaper from a TTY.
---
lisp/image/wallpaper.el | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index 5622f9b8e8a..16fc9d23ecb 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -237,13 +237,11 @@ options `wallpaper-command' and `wallpaper-command-args'.
On MS-Windows and Haiku systems, no external command is needed,
so the value of `wallpaper-commands' is ignored."
- (interactive (list (and
- (display-graphic-p)
- (read-file-name "Set desktop background to: "
- default-directory nil t nil
- (lambda (fn)
- (or (file-directory-p fn)
- (string-match (image-file-name-regexp) fn)))))))
+ (interactive (list (read-file-name "Set desktop background to: "
+ default-directory nil t nil
+ (lambda (fn)
+ (or (file-directory-p fn)
+ (string-match (image-file-name-regexp) fn))))))
(when (file-directory-p file)
(error "Can't set wallpaper to a directory: %s" file))
(unless (file-exists-p file)
From a057d41c7577c0e7089dd259fd8edf75f636c7a1 Mon Sep 17 00:00:00 2001
From: Alan Mackenzie
Date: Thu, 15 Sep 2022 19:54:22 +0000
Subject: [PATCH 389/915] CC Mode: Handle C++20 modules
* lisp/progmodes/cc-engine.el (c-before-after-change-check-c++-modules): New
function.
(c-forward-<>-arglist): Add special handling for "import <...>".
* lisp/progmodes/cc-fonts.el (c-preprocessor-face-name): Add extra "fallback"
face after font-lock-reference-face, namely font-lock-constant-face.
(c-cpp-matchers): Don't fontify the <> delimiters for XEmacs in #include <..>.
(c-basic-matchers-before): Add c-font-lock-c++-modules to the C++ value.
(c-forward-c++-module-name, c-forward-c++-module-partition-name)
(c-font-lock-c++-modules): New functions.
* lisp/progmodes/cc-langs.el (c-get-state-before-change-functions)
(c-before-font-lock-functions): Include
c-before-after-change-check-c++-modules in the C++ value of these variables.
(c-module-name-re): New c-lang-const/var.
(c-other-decl-kwds): Add a C++ value "export".
(c-<>-sexp-kwds): Add a new component c-import-<>-kwds.
(c-import-<>-kwds, c-module-kwds): New c-lang-consts.
(c-module-key): New c-lang-const/var.
---
lisp/progmodes/cc-engine.el | 85 ++++++++++++++----
lisp/progmodes/cc-fonts.el | 173 +++++++++++++++++++++++++++++++++++-
lisp/progmodes/cc-langs.el | 35 +++++++-
3 files changed, 270 insertions(+), 23 deletions(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 94225d6e3e9..1127ffe2498 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -8155,6 +8155,40 @@ multi-line strings (but not C++, for example)."
(c-clear-char-property c-neutralize-pos 'syntax-table))
(c-truncate-lit-pos-cache c-neutralize-pos)))
+
+(defun c-before-after-change-check-c++-modules (beg end &optional _old_len)
+ ;; Extend the region (c-new-BEG c-new-END) as needed to enclose complete
+ ;; C++20 module statements. This function is called solely from
+ ;; `c-get-state-before-change-functions' and `c-before-font-lock-functions'
+ ;; as part of the before-change and after-change processing for C++.
+ ;;
+ ;; Point is undefined both on entry and exit, and the return value has no
+ ;; significance.
+ (c-save-buffer-state (res bos lit-start)
+ (goto-char end)
+ (if (setq lit-start (c-literal-start))
+ (goto-char lit-start))
+ (when (>= (point) beg)
+ (setq res (c-beginning-of-statement-1 nil t)) ; t is IGNORE-LABELS
+ (setq bos (point))
+ (when (and (memq res '(same previous))
+ (looking-at c-module-key))
+ (setq c-new-BEG (min c-new-BEG (point)))
+ (if (c-syntactic-re-search-forward
+ ";" (min (+ (point) 500) (point-max)) t)
+ (setq c-new-END (max c-new-END (point))))))
+ (when (or (not bos) (< beg bos))
+ (goto-char beg)
+ (when (not (c-literal-start))
+ (setq res (c-beginning-of-statement-1 nil t))
+ (setq bos (point))
+ (when (and (memq res '(same previous))
+ (looking-at c-module-key))
+ (setq c-new-BEG (min c-new-BEG (point)))
+ (if (c-syntactic-re-search-forward
+ ";" (min (+ (point) 500) (point-max)) t)
+ (setq c-new-END (max c-new-END (point)))))))))
+
;; Handling of small scale constructs like types and names.
@@ -8474,25 +8508,40 @@ multi-line strings (but not C++, for example)."
;; recording of any found types that constitute an argument in
;; the arglist.
(c-record-found-types (if c-record-type-identifiers t)))
- (if (catch 'angle-bracket-arglist-escape
- (setq c-record-found-types
- (c-forward-<>-arglist-recur all-types)))
- (progn
- (when (consp c-record-found-types)
- (let ((cur c-record-found-types))
- (while (consp (car-safe cur))
- (c-fontify-new-found-type
- (buffer-substring-no-properties (caar cur) (cdar cur)))
- (setq cur (cdr cur))))
- (setq c-record-type-identifiers
- ;; `nconc' doesn't mind that the tail of
- ;; `c-record-found-types' is t.
- (nconc c-record-found-types c-record-type-identifiers)))
- t)
+ ;; Special handling for C++20's "import <...>" operator.
+ (if (and (c-major-mode-is 'c++-mode)
+ (save-excursion
+ (and (zerop (c-backward-token-2))
+ (looking-at "import\\>\\(?:[^_$]\\|$\\)"))))
+ (when (looking-at "<\\(?:\\\\.\\|[^\\\n\r\t>]\\)*\\(>\\)?")
+ (if (match-beginning 1) ; A terminated <..>
+ (progn
+ (when c-parse-and-markup-<>-arglists
+ (c-mark-<-as-paren (point))
+ (c-mark->-as-paren (match-beginning 1))
+ (c-truncate-lit-pos-cache (point)))
+ (goto-char (match-end 1))
+ t)
+ nil))
+ (if (catch 'angle-bracket-arglist-escape
+ (setq c-record-found-types
+ (c-forward-<>-arglist-recur all-types)))
+ (progn
+ (when (consp c-record-found-types)
+ (let ((cur c-record-found-types))
+ (while (consp (car-safe cur))
+ (c-fontify-new-found-type
+ (buffer-substring-no-properties (caar cur) (cdar cur)))
+ (setq cur (cdr cur))))
+ (setq c-record-type-identifiers
+ ;; `nconc' doesn't mind that the tail of
+ ;; `c-record-found-types' is t.
+ (nconc c-record-found-types c-record-type-identifiers)))
+ t)
- (setq c-found-types old-found-types)
- (goto-char start)
- nil)))
+ (setq c-found-types old-found-types)
+ (goto-char start)
+ nil))))
(defun c-forward-<>-arglist-recur (all-types)
;; Recursive part of `c-forward-<>-arglist'.
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index f34f7f177db..c52f4a8416b 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -112,8 +112,10 @@
;; In Emacs font-lock-builtin-face has traditionally been
;; used for preprocessor directives.
'font-lock-builtin-face)
- (t
- 'font-lock-reference-face)))
+ ((and (c-face-name-p 'font-lock-reference-face)
+ (eq font-lock-reference-face 'font-lock-reference-face))
+ 'font-lock-reference-face)
+ (t 'font-lock-constant-face)))
(cc-bytecomp-defvar font-lock-constant-face)
@@ -558,8 +560,10 @@ stuff. Used on level 1 and higher."
(c-lang-const c-opt-cpp-prefix)
re
(c-lang-const c-syntactic-ws)
- "\\(<[^>\n\r]*>?\\)")
- `(,(+ ncle-depth re-depth sws-depth 1)
+ "\\(<\\([^>\n\r]*\\)>?\\)")
+ `(,(+ ncle-depth re-depth sws-depth
+ (if (featurep 'xemacs) 2 1)
+ )
font-lock-string-face t)
`((let ((beg (match-beginning
,(+ ncle-depth re-depth sws-depth 1)))
@@ -878,6 +882,10 @@ casts and declarations are fontified. Used on level 2 and higher."
c-reference-face-name))
(goto-char (match-end 1))))))))))
+ ;; Module declarations (e.g. in C++20).
+ ,@(when (c-major-mode-is 'c++-mode)
+ '(c-font-lock-c++-modules))
+
;; Fontify the special declarations in Objective-C.
,@(when (c-major-mode-is 'objc-mode)
`(;; Fontify class names in the beginning of message expressions.
@@ -1909,6 +1917,163 @@ casts and declarations are fontified. Used on level 2 and higher."
(forward-char))))) ; over the terminating "]" or other close paren.
nil)
+(defun c-forward-c++-module-name (limit)
+ ;; Is there a C++20 module name at point? If so, return a cons of the start
+ ;; and end of that name, in which case point will be moved over the name and
+ ;; following whitespace. Otherwise nil will be returned and point will be
+ ;; unmoved. This function doesn't regard a partition as part of the name.
+ ;; The entire construct must end not after LIMIT.
+ (when (and
+ (looking-at c-module-name-re)
+ (<= (match-end 0) limit)
+ (not (looking-at c-keywords-regexp)))
+ (goto-char (match-end 0))
+ (prog1 (cons (match-beginning 0) (match-end 0))
+ (c-forward-syntactic-ws limit))))
+
+(defun c-forward-c++-module-partition-name (limit)
+ ;; Is there a C++20 module partition name (starting with its colon) at
+ ;; point? If so return a cons of the start and end of the name, not
+ ;; including the colon, in which case point will be move to after the name
+ ;; and following whitespace. Otherwise nil will be returned and point not
+ ;; moved. The entire construct must end not after LIMIT.
+ (when (and
+ (eq (char-after) ?:)
+ (progn
+ (forward-char)
+ (c-forward-syntactic-ws limit)
+ (looking-at c-module-name-re))
+ (<= (match-end 0) limit)
+ (not (looking-at c-keywords-regexp)))
+ (goto-char (match-end 0))
+ (prog1 (cons (match-beginning 0) (match-end 0))
+ (c-forward-syntactic-ws limit))))
+
+(defun c-font-lock-c++-modules (limit)
+ ;; Fontify the C++20 module stanzas, characterised by the keywords `module',
+ ;; `export' and `import'. Note that this has to be done by a function (as
+ ;; opposed to regexps) due to the presence of optional C++ attributes.
+ ;;
+ ;; This function will be called from font-lock for a region bounded by POINT
+ ;; and LIMIT, as though it were to identify a keyword for
+ ;; font-lock-keyword-face. It always returns NIL to inhibit this and
+ ;; prevent a repeat invocation. See elisp/lispref page "Search-based
+ ;; Fontification".
+ (while (and (< (point) limit)
+ (re-search-forward
+ "\\<\\(module\\|export\\|import\\)\\>\\(?:[^_$]\\|$\\)"
+ limit t))
+ (goto-char (match-end 1))
+ (let (name-bounds pos beg end
+ module-names) ; A list of conses of start and end
+ ; of pertinent module names
+ (unless (c-skip-comments-and-strings limit)
+ (when
+ (cond
+ ;; module foo...; Note we don't handle module; or module
+ ;; :private; here, since they don't really need handling.
+ ((save-excursion
+ (when (equal (match-string-no-properties 1) "export")
+ (c-forward-syntactic-ws limit)
+ (re-search-forward "\\=\\(module\\)\\>\\(?:[^_$]\\|$\\)"
+ limit t))
+ (and (equal (match-string-no-properties 1) "module")
+ (< (point) limit)
+ (progn (c-forward-syntactic-ws limit)
+ (setq name-bounds (c-forward-c++-module-name
+ limit)))
+ (setq pos (point))))
+ (push name-bounds module-names)
+ (goto-char pos)
+ ;; Is there a partition name?
+ (when (setq name-bounds (c-forward-c++-module-partition-name
+ limit))
+ (push name-bounds module-names))
+ t)
+
+ ;; import
+ ((save-excursion
+ (when (equal (match-string-no-properties 1) "export")
+ (c-forward-syntactic-ws limit)
+ (re-search-forward "\\=\\(import\\)\\>\\(?:[^_$]\\|$\\)"
+ limit t))
+ (and (equal (match-string-no-properties 1) "import")
+ (< (point) limit)
+ (progn (c-forward-syntactic-ws limit)
+ (setq pos (point)))))
+ (goto-char pos)
+ (cond
+ ;; import foo;
+ ((setq name-bounds (c-forward-c++-module-name limit))
+ (push name-bounds module-names)
+ t)
+ ;; import :foo;
+ ((setq name-bounds (c-forward-c++-module-partition-name limit))
+ (push name-bounds module-names)
+ t)
+ ;; import "foo";
+ ((and (eq (char-after) ?\")
+ (setq pos (point))
+ (c-safe (c-forward-sexp) t)) ; Should already have string face.
+ (when (eq (char-before) ?\")
+ (setq beg pos
+ end (point)))
+ (c-forward-syntactic-ws limit)
+ t)
+ ;; import ;
+ ((and (looking-at "<\\(?:\\\\.\\|[^\\\n\r\t>]\\)*\\(>\\)?")
+ (< (match-end 0) limit))
+ (setq beg (point))
+ (goto-char (match-end 0))
+ (when (match-end 1)
+ (setq end (point)))
+ (if (featurep 'xemacs)
+ (c-put-font-lock-face
+ (1+ beg) (if end (1- end) (point)) font-lock-string-face)
+ (c-put-font-lock-face
+ beg (or end (point)) font-lock-string-face))
+ (c-forward-syntactic-ws limit)
+ t)
+ (t nil)))
+
+ ;; export
+ ;; There is no fontification to be done here, but we need to
+ ;; skip over the declaration or declaration sequence.
+ ((save-excursion
+ (when (equal (match-string-no-properties 0) "export")
+ (c-forward-syntactic-ws limit)
+ (setq pos (point))))
+ (goto-char (point))
+ (if (eq (char-after) ?{)
+ ;; Declaration sequence.
+ (unless (and (c-go-list-forward nil limit)
+ (eq (char-before) ?}))
+ (goto-char limit)
+ nil)
+ ;; Single declaration
+ (unless (c-end-of-decl-1)
+ (goto-char limit)
+ nil)))) ; Nothing more to do, here.
+
+ ;; Optional attributes?
+ (while (and (c-looking-at-c++-attribute)
+ (< (match-end 0) limit))
+ (goto-char (match-end 0))
+ (c-forward-syntactic-ws limit))
+ ;; Finally, there must be a semicolon.
+ (if (and (< (point) limit)
+ (eq (char-after) ?\;))
+ (progn
+ (forward-char)
+ ;; Fontify any module names we've encountered.
+ (dolist (name module-names)
+ (c-put-font-lock-face (car name) (cdr name)
+ c-reference-face-name)))
+ ;; No semicolon, so put warning faces on any delimiters.
+ (when beg
+ (c-put-font-lock-face beg (1+ beg) font-lock-warning-face))
+ (when end
+ (c-put-font-lock-face (1- end) end font-lock-warning-face))))))))
(c-lang-defconst c-simple-decl-matchers
"Simple font lock matchers for types and declarations. These are used
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index bf7eee22834..d33ed4bcda5 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -456,6 +456,7 @@ so that all identifiers are recognized as words.")
c-depropertize-CPP
c-before-change-check-ml-strings
c-before-change-check-<>-operators
+ c-before-after-change-check-c++-modules
c-truncate-bs-cache
c-before-change-check-unbalanced-strings
c-parse-quotes-before-change
@@ -516,6 +517,7 @@ parameters \(point-min) and \(point-max).")
c-parse-quotes-after-change
c-after-change-mark-abnormal-strings
c-extend-font-lock-region-for-macros
+ c-before-after-change-check-c++-modules
c-neutralize-syntax-in-CPP
c-restore-<>-properties
c-change-expand-fl-region)
@@ -1018,6 +1020,16 @@ e.g. identifiers with template arguments such as \"A\" in C++."
"")))
(c-lang-defvar c-identifier-key (c-lang-const c-identifier-key))
+(c-lang-defconst c-module-name-re
+ "This regexp matches (a component of) a module name.
+Currently (2022-09) just C++ Mode uses this."
+ t nil
+ c++ (concat (c-lang-const c-symbol-key)
+ "\\(?:\\."
+ (c-lang-const c-symbol-key)
+ "\\)*"))
+(c-lang-defvar c-module-name-re (c-lang-const c-module-name-re))
+
(c-lang-defconst c-identifier-last-sym-match
;; This was a docstring constant in 5.30 but it's no longer used.
;; It's only kept to avoid breaking third party code.
@@ -2624,6 +2636,7 @@ If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
`c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
will be handled."
t nil
+ c++ '("export")
objc '("@class" "@defs" "@end" "@property" "@dynamic" "@synthesize"
"@compatibility_alias")
java '("import" "package")
@@ -2937,7 +2950,8 @@ assumed to be set if this isn't nil."
(c-lang-defconst c-<>-sexp-kwds
;; All keywords that can be followed by an angle bracket sexp.
t (c--delete-duplicates (append (c-lang-const c-<>-type-kwds)
- (c-lang-const c-<>-arglist-kwds))
+ (c-lang-const c-<>-arglist-kwds)
+ (c-lang-const c-import-<>-kwds))
:test 'string-equal))
(c-lang-defconst c-opt-<>-sexp-key
@@ -3099,6 +3113,25 @@ This construct is \" :\"."
idl nil
awk nil)
+(c-lang-defconst c-import-<>-kwds
+ "Keywords which can start an expression like \"import <...>\" in C++20.
+The <, and > operators are like those of #include <...>, they are
+not really template operators."
+ t nil
+ c++ '("import"))
+
+(c-lang-defconst c-module-kwds
+ "The keywords which introduce module constructs in C++20 onwards."
+ t nil
+ c++ '("module" "import" "export"))
+
+(c-lang-defconst c-module-key
+ ;; Adorned regexp matching module declaration keywords, or nil if there are
+ ;; none.
+ t (if (c-lang-const c-module-kwds)
+ (c-make-keywords-re t (c-lang-const c-module-kwds))))
+(c-lang-defvar c-module-key (c-lang-const c-module-key))
+
(c-lang-defconst c-constant-kwds
"Keywords for constants."
t nil
From bfc4393040037a3dd17531e6e9dcfa6990a3c33d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?=
Date: Thu, 15 Sep 2022 21:59:16 +0200
Subject: [PATCH 390/915] Include nil as valid wallpaper-commmand
* lisp/image/wallpaper.el (wallpaper-command):
Include nil in the type since that is a valid value for the variable,
and may be the default value. This should fix test-custom-opts.
---
lisp/image/wallpaper.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index 16fc9d23ecb..9572349c366 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -167,7 +167,8 @@ systems, where a native API is used instead."
(const :tag "xloadimage (X Window System)" "xloadimage")
(const :tag "xsetbg (X Window System)" "xsetbg")
(const :tag "osascript (macOS)" "osascript"))
- (const :tag "Other (specify)" string))
+ (const :tag "Other (specify)" string)
+ (const :tag "None" nil))
:set #'wallpaper--set-wallpaper-command
:group 'image
:version "29.1")
From c6fc00f5d75a28fd4e99050ccc1af9ad82f66b2b Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 22:08:19 +0200
Subject: [PATCH 391/915] Make image-dired-toggle-mark-thumb-original-file
obsolete
* lisp/image/image-dired.el
(image-dired-toggle-mark-thumb-original-file): Make obsolete.
(image-dired-mouse-toggle-mark-1): Don't use above obsolete
function.
---
lisp/image/image-dired.el | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index 75dcdd8cbc2..df4ee071338 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -785,14 +785,6 @@ according to `image-dired-marking-shows-next'."
(image-dired--do-mark-command t
(dired-flag-file-deletion 1)))
-(defun image-dired-toggle-mark-thumb-original-file ()
- "Toggle mark on original image file in associated Dired buffer."
- (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command nil
- (if (image-dired-dired-file-marked-p)
- (dired-unmark 1)
- (dired-mark 1))))
-
(defun image-dired-unmark-all-marks ()
"Remove all marks from all files in associated Dired buffer.
Also update the marks in the thumbnail buffer."
@@ -1261,7 +1253,10 @@ Track this in associated Dired buffer if
`image-dired-track-movement' is non-nil."
(when image-dired-track-movement
(image-dired-track-original-file))
- (image-dired-toggle-mark-thumb-original-file))
+ (image-dired--do-mark-command nil
+ (if (image-dired-dired-file-marked-p)
+ (dired-unmark 1)
+ (dired-mark 1))))
(defun image-dired-mouse-toggle-mark (event)
"Use mouse EVENT to toggle Dired mark for thumbnail.
@@ -1372,6 +1367,15 @@ completely fit)."
(make-obsolete-variable 'image-dired-display-window-height-correction
"no longer used." "29.1")
+(defun image-dired-toggle-mark-thumb-original-file ()
+ "Toggle mark on original image file in associated Dired buffer."
+ (declare (obsolete nil "29.1"))
+ (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
+ (image-dired--do-mark-command nil
+ (if (image-dired-dired-file-marked-p)
+ (dired-unmark 1)
+ (dired-mark 1))))
+
(defun image-dired-display-window-width (window)
"Return width, in pixels, of WINDOW."
(declare (obsolete nil "29.1"))
From bb76ab015a247d2547a9e6778e50ffb38988f47e Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 22:19:00 +0200
Subject: [PATCH 392/915] image-dired: Fix performance bug with mouse click
* lisp/image/image-dired.el
(image-dired--on-file-in-dired-buffer): Move call to
'image-dired-thumb-update-marks' from here...
(image-dired--do-mark-command): ...to here. Add new optional
argument UPDATE to control calling it. Update callers.
(image-dired-mouse-toggle-mark-1): Fix performance bug by setting
above new optional argument to nil. (Bug#53599)
---
lisp/image/image-dired.el | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index df4ee071338..12a94974b1f 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -750,18 +750,20 @@ Should be called from commands in `image-dired-thumbnail-mode'."
(message "No image, or image with correct properties, at point")
(with-current-buffer dired-buf
(when (dired-goto-file file-name)
- ,@body
- (image-dired-thumb-update-marks))))))
+ ,@body)))))
-(defmacro image-dired--do-mark-command (maybe-next &rest body)
+(defmacro image-dired--do-mark-command (maybe-next update &rest body)
"Helper macro for the mark, unmark and flag commands.
Run BODY in Dired buffer.
-If optional argument MAYBE-NEXT is non-nil, show next image
-according to `image-dired-marking-shows-next'."
+If MAYBE-NEXT is non-nil, show next image according to
+`image-dired-marking-shows-next'.
+If UPDATE is non-nil, call `image-dired-thumb-update-marks' too."
(declare (indent defun) (debug t))
`(image-dired--with-thumbnail-buffer
(image-dired--on-file-in-dired-buffer
,@body)
+ ,(when update
+ '(image-dired-thumb-update-marks))
,(when maybe-next
'(if image-dired-marking-shows-next
(image-dired-display-next-thumbnail-original)
@@ -770,26 +772,26 @@ according to `image-dired-marking-shows-next'."
(defun image-dired-mark-thumb-original-file ()
"Mark original image file in associated Dired buffer."
(interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command t
+ (image-dired--do-mark-command t t
(dired-mark 1)))
(defun image-dired-unmark-thumb-original-file ()
"Unmark original image file in associated Dired buffer."
(interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command t
+ (image-dired--do-mark-command t t
(dired-unmark 1)))
(defun image-dired-flag-thumb-original-file ()
"Flag original image file for deletion in associated Dired buffer."
(interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command t
+ (image-dired--do-mark-command t t
(dired-flag-file-deletion 1)))
(defun image-dired-unmark-all-marks ()
"Remove all marks from all files in associated Dired buffer.
Also update the marks in the thumbnail buffer."
(interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command nil
+ (image-dired--do-mark-command nil t
(dired-unmark-all-marks))
(image-dired--with-thumbnail-buffer
(image-dired-thumb-update-marks)))
@@ -1253,7 +1255,7 @@ Track this in associated Dired buffer if
`image-dired-track-movement' is non-nil."
(when image-dired-track-movement
(image-dired-track-original-file))
- (image-dired--do-mark-command nil
+ (image-dired--do-mark-command nil nil
(if (image-dired-dired-file-marked-p)
(dired-unmark 1)
(dired-mark 1))))
@@ -1371,7 +1373,7 @@ completely fit)."
"Toggle mark on original image file in associated Dired buffer."
(declare (obsolete nil "29.1"))
(interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command nil
+ (image-dired--do-mark-command nil t
(if (image-dired-dired-file-marked-p)
(dired-unmark 1)
(dired-mark 1))))
From c99815fffad7a320c35a516548fd67fedaf0e732 Mon Sep 17 00:00:00 2001
From: Stefan Monnier
Date: Thu, 15 Sep 2022 16:31:00 -0400
Subject: [PATCH 393/915] combine-change-calls-1: Fix case where `body` also
changes other bufs
* lisp/subr.el (combine-change-calls-1): Only set the current buffer's part
of the `*-change-functions` hooks.
---
lisp/subr.el | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/lisp/subr.el b/lisp/subr.el
index 8769fec2b95..bfc2e207b2c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4823,16 +4823,26 @@ the function `undo--wrap-and-run-primitive-undo'."
(let ((undo--combining-change-calls t))
(if (not inhibit-modification-hooks)
(run-hook-with-args 'before-change-functions beg end))
- (let (;; (inhibit-modification-hooks t)
- (before-change-functions
- ;; Ugly Hack: if the body uses syntax-ppss/syntax-propertize
- ;; (e.g. via a regexp-search or sexp-movement triggering
- ;; on-the-fly syntax-propertize), make sure that this gets
- ;; properly refreshed after subsequent changes.
- (if (memq #'syntax-ppss-flush-cache before-change-functions)
- '(syntax-ppss-flush-cache)))
- after-change-functions)
- (setq result (funcall body)))
+ (let ((bcf before-change-functions)
+ (acf after-change-functions)
+ (local-bcf (local-variable-p 'before-change-functions))
+ (local-acf (local-variable-p 'after-change-functions)))
+ (unwind-protect
+ ;; FIXME: WIBNI we could just use `inhibit-modification-hooks'?
+ (progn
+ ;; Ugly Hack: if the body uses syntax-ppss/syntax-propertize
+ ;; (e.g. via a regexp-search or sexp-movement triggering
+ ;; on-the-fly syntax-propertize), make sure that this gets
+ ;; properly refreshed after subsequent changes.
+ (setq-local before-change-functions
+ (if (memq #'syntax-ppss-flush-cache bcf)
+ '(syntax-ppss-flush-cache)))
+ (setq-local after-change-functions nil)
+ (setq result (funcall body)))
+ (if local-bcf (setq before-change-functions bcf)
+ (kill-local-variable 'before-change-functions))
+ (if local-acf (setq after-change-functions acf)
+ (kill-local-variable 'after-change-functions))))
(when (not (eq buffer-undo-list t))
(let ((ap-elt
(list 'apply
From c3828d47dd0f97bcb1eaef1a29b614a6ae463e52 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 23:34:41 +0200
Subject: [PATCH 394/915] image-dired: Show header line on start
* lisp/image/image-dired.el (image-dired-show-all-from-dir): Update
header line, to ensure that it is immediately visible on start.
---
lisp/image/image-dired.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index 12a94974b1f..a7ca60dd37c 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -551,6 +551,7 @@ never ask for confirmation."
(image-dired-display-thumbs)
(pop-to-buffer image-dired-thumbnail-buffer)
(setq default-directory dir)
+ (image-dired-update-header-line)
(image-dired-unmark-all-marks))
(t (message "Image-Dired canceled")))))
From 89084a193ef5bef813d9f9f5640a83882371beb9 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Thu, 15 Sep 2022 23:56:11 +0200
Subject: [PATCH 395/915] Improve image-dired-display-properties-format
* lisp/image/image-dired.el
(image-dired-display-properties-format): Change default format,
improve docstring and add :safe property
---
etc/NEWS | 6 ++++++
lisp/image/image-dired.el | 19 ++++++++++++++-----
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index 72c330f5f77..e2b5f5fde37 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2093,6 +2093,12 @@ next image.
This replaces the message most navigation commands in the thumbnail
buffer used to show at the bottom of the screen.
+---
+*** 'image-dired-display-properties-format' default has changed.
+If you prefer the old format, add this to your Init file:
+
+ (setopt image-dired-display-properties-format "%b: %f (%t): %c")
+
+++
*** 'image-dired-show-all-from-dir-max-files' increased to 1000.
This user option controls asking for confirmation when starting
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index a7ca60dd37c..e25241274c1 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -293,12 +293,21 @@ For more information, see the documentation for
`image-dired-toggle-movement-tracking'."
:type 'boolean)
-(defcustom image-dired-display-properties-format "%b: %f (%t): %c"
+(defcustom image-dired-display-properties-format "%-40f %b %t %c"
"Display format for thumbnail properties.
-%b is replaced with associated Dired buffer name, %f with file
-name (without path) of original image file, %t with the list of
-tags and %c with the comment."
- :type 'string)
+This is used for the header line in the Image-Dired buffer.
+
+The following %-specs are replaced by `format-spec' before
+displaying:
+
+ \"%b\" The associated Dired buffer name.
+ \"%f\" The file name (without a directory) of the
+ original image file.
+ \"%t\" The list of tags (from the Image-Dired database).
+ \"%c\" The comment (from the Image-Dired database)."
+ :type 'string
+ :safe #'stringp
+ :version "29.1")
(defcustom image-dired-external-viewer
;; TODO: Use mailcap, dired-guess-shell-alist-default,
From 45459fd73b6546bff9bfa6c840da672c45dc40c5 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Fri, 16 Sep 2022 00:22:27 +0200
Subject: [PATCH 396/915] ; * etc/NEWS: Improve and re-arrange Image-Dired
section.
---
etc/NEWS | 133 +++++++++++++++++++++++++++++--------------------------
1 file changed, 69 insertions(+), 64 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index e2b5f5fde37..dd63efb02d8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2009,55 +2009,22 @@ This is done via 'image-converter-add-handler'.
This avoids converting images in the background, and makes Image-Dired
noticeably faster. New keybindings from 'image-mode' are now
available in the "*image-dired-display-image*" buffer; press '?' or
-'h' in that buffer to see the full list. Finally, some commands and
-user options that are no longer needed are now obsolete:
-'image-dired-cmd-create-temp-image-options',
-'image-dired-cmd-create-temp-image-program',
-'image-dired-display-current-image-full',
-'image-dired-display-current-image-sized',
-'image-dired-display-window-height-correction',
-'image-dired-display-window-width-correction',
-'image-dired-temp-image-file'.
+'h' in that buffer to see the full list.
---
*** Navigation and marking commands now work in image display buffer.
The following new bindings have been added:
-
- n or SPC image-dired-display-next-thumbnail-original
- p or DEL image-dired-display-previous-thumbnail-original
- m image-dired-mark-thumb-original-file
- d image-dired-flag-thumb-original-file
- u image-dired-unmark-thumb-original-file
+- 'n', 'SPC' => 'image-dired-display-next-thumbnail-original'
+- 'p', 'DEL' => 'image-dired-display-previous-thumbnail-original'
+- 'm' => 'image-dired-mark-thumb-original-file'
+- 'd' => 'image-dired-flag-thumb-original-file'
+- 'u' => 'image-dired-unmark-thumb-original-file'
---
-*** Reduce dependency on external "exiftool" command.
-The 'image-dired-copy-with-exif-file-name' no longer requires an
-external "exiftool" command to be available. The user options
-'image-dired-cmd-read-exif-data-program' and
-'image-dired-cmd-read-exif-data-options' are now obsolete.
-
----
-*** New command for the thumbnail buffer.
-The new command 'image-dired-unmark-all-marks' has been added. It is
-bound to 'U' in the thumbnail and display buffer.
-
----
-*** Support Thumbnail Managing Standard v0.9.0 (Dec 2020).
-This standard allows sharing generated thumbnails across different
-programs. Version 0.9.0 adds two larger thumbnail sizes: 512x512 and
-1024x1024 pixels. See the user option 'image-dired-thumbnail-storage'
-to use it; it is not enabled by default.
-
----
-*** Support GraphicsMagick command line tools.
-Support for the GraphicsMagick command line tool ("gm") has been
-added, and is used instead of ImageMagick when it is available.
-
----
-*** New face 'image-dired-thumb-flagged'.
-If 'image-dired-thumb-mark' is non-nil (the default), this face is
-used for images that are flagged for deletion in the Dired buffer
-associated with Image-Dired.
+*** New command 'image-dired-unmark-all-marks'.
+It removes all marks from all files in the thumbnail and the
+associated Dired buffer, and is bound to 'U' in the thumbnail and
+display buffer.
---
*** New command 'image-dired-wallpaper-set'.
@@ -2069,12 +2036,40 @@ thumbnail buffer. It is bound to 'W' by default.
It is bound in both the thumbnail and display buffer.
---
-*** The 'image-dired-slideshow-start' command no longer prompts.
-It no longer inconveniently prompts for a number of images and a
-delay: it runs indefinitely, but stops automatically on any command.
-You can set the delay with a prefix argument, or a negative prefix
-argument to prompt for a delay. Customize the user option
-'image-dired-slideshow-delay' to change the default from 5 seconds.
+*** New user option 'image-dired-marking-shows-next'.
+If this option is non-nil (the default), marking, unmarking or
+flagging an image in either the thumbnail or display buffer shows the
+next image.
+
+---
+*** New face 'image-dired-thumb-flagged'.
+If 'image-dired-thumb-mark' is non-nil (the default), this face is
+used for images that are flagged for deletion in the Dired buffer
+associated with Image-Dired.
+
+---
+*** Image information is now shown in the header line.
+This replaces the message most navigation commands in the thumbnail
+buffer used to show at the bottom of the screen.
+
+---
+*** Support GraphicsMagick command line tools.
+Support for the GraphicsMagick command line tool ("gm") has been
+added, and is used instead of ImageMagick when it is available.
+
+---
+*** Support Thumbnail Managing Standard v0.9.0 (Dec 2020).
+This standard allows sharing generated thumbnails across different
+programs. Version 0.9.0 adds two larger thumbnail sizes: 512x512 and
+1024x1024 pixels. See the user option 'image-dired-thumbnail-storage'
+to use it; it is not enabled by default.
+
+---
+*** Reduce dependency on external "exiftool" command.
+The 'image-dired-copy-with-exif-file-name' no longer requires an
+external "exiftool" command to be available. The user options
+'image-dired-cmd-read-exif-data-program' and
+'image-dired-cmd-read-exif-data-options' are now obsolete.
---
*** Support for bookmark.el.
@@ -2083,15 +2078,12 @@ the thumbnail view, and will create a bookmark that opens the current
directory in Image-Dired.
---
-*** New user option 'image-dired-marking-shows-next'.
-If this option is non-nil (the default), marking, unmarking or
-flagging an image in either the thumbnail or display buffer shows the
-next image.
-
----
-*** Image information is now shown in the header line.
-This replaces the message most navigation commands in the thumbnail
-buffer used to show at the bottom of the screen.
+*** The 'image-dired-slideshow-start' command no longer prompts.
+It no longer inconveniently prompts for a number of images and a
+delay: it runs indefinitely, but stops automatically on any command.
+You can set the delay with a prefix argument, or a negative prefix
+argument to prompt for a delay. Customize the user option
+'image-dired-slideshow-delay' to change the default from 5 seconds.
---
*** 'image-dired-display-properties-format' default has changed.
@@ -2107,12 +2099,6 @@ thumbnails in the background in recent versions, this is not as
important as it used to be. You can now also customize this option to
nil to disable this confirmation completely.
----
-*** 'image-dired-rotate-thumbnail-(left|right)' is now obsolete.
-Instead, use commands 'image-dired-refresh-thumb' to generate a new
-thumbnail, or 'image-rotate' to rotate the thumbnail without updating
-the thumbnail file.
-
---
*** HTML image gallery generation is now obsolete.
The 'image-dired-gallery-generate' command and these user options are
@@ -2120,6 +2106,25 @@ now obsolete: 'image-dired-gallery-thumb-image-root-url',
'image-dired-gallery-hidden-tags', 'image-dired-gallery-dir',
'image-dired-gallery-image-root-url'.
+---
+*** 'image-dired-rotate-thumbnail-(left|right)' is now obsolete.
+Instead, use commands 'image-dired-refresh-thumb' to generate a new
+thumbnail, or 'image-rotate' to rotate the thumbnail without updating
+the thumbnail file.
+
++++
+*** Some commands and user options are now obsolete.
+Since Image-Dired no longer converts images in the background before
+displaying them, some commands and user options that are no longer
+needed are now obsolete:
+'image-dired-cmd-create-temp-image-options',
+'image-dired-cmd-create-temp-image-program',
+'image-dired-display-current-image-full',
+'image-dired-display-current-image-sized',
+'image-dired-display-window-height-correction',
+'image-dired-display-window-width-correction',
+'image-dired-temp-image-file'.
+
** Dired
---
From 7ec31d32222cdad695bc8324414880be5ca20201 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20M=C3=BCnster?=
Date: Fri, 16 Sep 2022 02:21:22 +0200
Subject: [PATCH 397/915] image-dired: Fix thumbnail options for gm
* lisp/image/image-dired-external.el
(image-dired-cmd-create-standard-thumbnail-options): Fix options for
"gm" (GraphicsMagick). (Bug#52200)
---
lisp/image/image-dired-external.el | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/lisp/image/image-dired-external.el b/lisp/image/image-dired-external.el
index 223d881bcfa..3e3a9a44431 100644
--- a/lisp/image/image-dired-external.el
+++ b/lisp/image/image-dired-external.el
@@ -108,8 +108,8 @@ with the information required by the Thumbnail Managing Standard."
"-text" "b" "Thumb::URI" "file://%f"
"%q" "%t")
"Arguments for `image-dired-cmd-pngcrush-program'.
-Available format specifiers are the same as in
-`image-dired-cmd-create-thumbnail-options', with %q for a
+The available %-format specifiers are the same as in
+`image-dired-cmd-create-thumbnail-options', with \"%q\" for a
temporary file name (typically generated by pnqnq)."
:version "26.1"
:type '(repeat (string :tag "Argument")))
@@ -128,20 +128,20 @@ Available format specifiers are described in
:link '(url-link "man:optipng(1)"))
(defcustom image-dired-cmd-create-standard-thumbnail-options
- (append '("-size" "%wx%h" "%f[0]")
- (unless (or image-dired-cmd-pngcrush-program
- image-dired-cmd-pngnq-program)
- (list
- "-set" "Thumb::MTime" "%m"
- "-set" "Thumb::URI" "file://%f"
- "-set" "Description" "Thumbnail of file://%f"
- "-set" "Software" (emacs-version)))
- '("-thumbnail" "%wx%h>" "png:%t"))
+ (let ((opts (list
+ "-size" "%wx%h" "%f[0]"
+ "-set" "Thumb::MTime" "%m"
+ "-set" "Thumb::URI" "file://%f"
+ "-set" "Description" "Thumbnail of file://%f"
+ "-set" "Software" (emacs-version)
+ "-thumbnail" "%wx%h>" "png:%t")))
+ (if (executable-find "gm") (cons "convert" opts) opts))
"Options for creating thumbnails according to the Thumbnail Managing Standard.
-Available format specifiers are the same as in
-`image-dired-cmd-create-thumbnail-options', with %m for file modification time."
- :version "26.1"
- :type '(repeat (string :tag "Argument")))
+The available %-format specifiers are the same as in
+`image-dired-cmd-create-thumbnail-options', with \"%m\" for file
+modification time."
+ :type '(repeat (string :tag "Argument"))
+ :version "29.1")
(defcustom image-dired-cmd-rotate-original-program "jpegtran"
"Executable used to rotate original image.
From e3b79c641e04a9e8681e7e27db3db3e4beec0fa4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?=
Date: Thu, 15 Sep 2022 15:50:12 +0200
Subject: [PATCH 398/915] Fix crash in GC on macOS (bug#57751)
* src/nsterm.m ([EmacsView windowDidMove:]): Initialize input_event.
---
src/nsterm.m | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/nsterm.m b/src/nsterm.m
index b8b4e66cd11..44979c7c04e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7901,7 +7901,6 @@ - (void)windowDidMove: sender
NSRect r = [win frame];
NSArray *screens = [NSScreen screens];
NSScreen *screen = [screens objectAtIndex: 0];
- struct input_event ie;
NSTRACE ("[EmacsView windowDidMove:]");
@@ -7917,6 +7916,8 @@ - (void)windowDidMove: sender
if (emacs_event)
{
+ struct input_event ie;
+ EVENT_INIT (ie);
ie.kind = MOVE_FRAME_EVENT;
XSETFRAME (ie.frame_or_window, emacsframe);
XSETINT (ie.x, emacsframe->left_pos);
From 8b29b296931a20ee9f3b3e19aab07ba71b9a12c1 Mon Sep 17 00:00:00 2001
From: Juri Linkov
Date: Fri, 16 Sep 2022 10:09:20 +0300
Subject: [PATCH 399/915] Add outline open/close images (bug#57813)
* etc/images/outline-open.svg:
* etc/images/outline-close.svg: New files.
* lisp/outline.el (outline-open, outline-close): Use images
outline-open.svg and outline-close.svg.
* lisp/emacs-lisp/icons.el (icons--create): Add :ascent 'center'.
---
etc/images/outline-close.svg | 6 ++++++
etc/images/outline-open.svg | 4 ++++
lisp/emacs-lisp/icons.el | 2 +-
lisp/outline.el | 10 ++++++----
4 files changed, 17 insertions(+), 5 deletions(-)
create mode 100644 etc/images/outline-close.svg
create mode 100644 etc/images/outline-open.svg
diff --git a/etc/images/outline-close.svg b/etc/images/outline-close.svg
new file mode 100644
index 00000000000..ea9157a5fb5
--- /dev/null
+++ b/etc/images/outline-close.svg
@@ -0,0 +1,6 @@
+
diff --git a/etc/images/outline-open.svg b/etc/images/outline-open.svg
new file mode 100644
index 00000000000..75cf6aff9f9
--- /dev/null
+++ b/etc/images/outline-open.svg
@@ -0,0 +1,4 @@
+
diff --git a/lisp/emacs-lisp/icons.el b/lisp/emacs-lisp/icons.el
index 93749a3451e..ff4f20c2071 100644
--- a/lisp/emacs-lisp/icons.el
+++ b/lisp/emacs-lisp/icons.el
@@ -202,7 +202,7 @@ present if the icon is represented by an image."
:height (if (eq height 'line)
(window-default-line-height)
height)
- :scale 1)
+ :scale 1 :ascent 'center)
(create-image file))))))
(cl-defmethod icons--create ((_type (eql 'emoji)) icon _keywords)
diff --git a/lisp/outline.el b/lisp/outline.el
index c9d1a4ac64b..aee6f696b5b 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -292,16 +292,18 @@ buffers (yet) -- that will be amended in a future version."
:safe #'booleanp
:version "29.1")
-(define-icon outline-open button
- '((emoji "🔽")
+(define-icon outline-open nil
+ '((image "outline-open.svg" :height 15 :ascent center)
+ (emoji "🔽")
(symbol " ▼ ")
(text " open "))
"Icon used for buttons for opening a section in outline buffers."
:version "29.1"
:help-echo "Open this section")
-(define-icon outline-close button
- '((emoji "▶️")
+(define-icon outline-close nil
+ '((image "outline-close.svg" :height 15 :ascent center)
+ (emoji "▶️")
(symbol " ▶ ")
(text " close "))
"Icon used for buttons for closing a section in outline buffers."
From 58454b661578bb56d8feccb1b0340b94869f0655 Mon Sep 17 00:00:00 2001
From: Po Lu
Date: Fri, 16 Sep 2022 15:45:36 +0800
Subject: [PATCH 400/915] Add portable versions of the outline SVGs
* lisp/outline.el (outline-open):
(outline-close): Add PBM images.
* etc/images/outline-open.pbm:
* etc/images/outline-close.pbm: New images used on systems
without librsvg.
---
etc/images/outline-close.pbm | Bin 0 -> 39 bytes
etc/images/outline-open.pbm | Bin 0 -> 39 bytes
lisp/outline.el | 2 ++
3 files changed, 2 insertions(+)
create mode 100644 etc/images/outline-close.pbm
create mode 100644 etc/images/outline-open.pbm
diff --git a/etc/images/outline-close.pbm b/etc/images/outline-close.pbm
new file mode 100644
index 0000000000000000000000000000000000000000..b37b640b555fc03654447e3fd38533b392daa4d2
GIT binary patch
literal 39
scmWGA;W9K;Ff`?2VBlcjVPIomW?*b!IKYs=aDcIa8OY}WiZd_(0A%X~p#T5?
literal 0
HcmV?d00001
diff --git a/etc/images/outline-open.pbm b/etc/images/outline-open.pbm
new file mode 100644
index 0000000000000000000000000000000000000000..06b520f14c97d3898897027ab922ae1b6fed8538
GIT binary patch
literal 39
icmWGA;W9K;Ff`?2fPw@b0|^NOo&>f7%ngh%K?VR{(F8XD
literal 0
HcmV?d00001
diff --git a/lisp/outline.el b/lisp/outline.el
index aee6f696b5b..25f3b21e632 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -294,6 +294,7 @@ buffers (yet) -- that will be amended in a future version."
(define-icon outline-open nil
'((image "outline-open.svg" :height 15 :ascent center)
+ (image "outline-open.pbm" :height 15 :ascent center)
(emoji "🔽")
(symbol " ▼ ")
(text " open "))
@@ -303,6 +304,7 @@ buffers (yet) -- that will be amended in a future version."
(define-icon outline-close nil
'((image "outline-close.svg" :height 15 :ascent center)
+ (image "outline-close.pbm" :height 15 :ascent center)
(emoji "▶️")
(symbol " ▶ ")
(text " close "))
From 3c0dda2663e38635163f0fd6c19748c6eba1c3c8 Mon Sep 17 00:00:00 2001
From: Po Lu
Date: Fri, 16 Sep 2022 15:52:21 +0800
Subject: [PATCH 401/915] Avoid asserting for fontset validity before it is
used
* src/fontset.c (face_for_char): Move `eassert' to before the
fontset is really used. Suggested by Eli Zaretskii
---
src/fontset.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/fontset.c b/src/fontset.c
index 1793715450e..4b91eff2ef6 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -922,8 +922,6 @@ face_for_char (struct frame *f, struct face *face, int c,
int face_id;
int id;
- eassert (fontset_id_valid_p (face->fontset));
-
if (ASCII_CHAR_P (c) || CHAR_BYTE8_P (c))
return face->ascii_face->id;
@@ -969,6 +967,7 @@ face_for_char (struct frame *f, struct face *face, int c,
#endif
}
+ eassert (fontset_id_valid_p (face->fontset));
fontset = FONTSET_FROM_ID (face->fontset);
eassert (!BASE_FONTSET_P (fontset));
From 4cb3b4e98a7c43de9e210c22f70e9ad323a4340e Mon Sep 17 00:00:00 2001
From: Po Lu
Date: Fri, 16 Sep 2022 17:01:41 +0800
Subject: [PATCH 402/915] Fix wrong source window being generated for XDND
leave events
* src/xterm.c (x_dnd_update_state, handle_one_xevent): Let
x_dnd_last_seen_toplevel remain at its old value until any
XdndLeave event was definitely sent.
---
src/xterm.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index 4c3b8128175..8c41f14864a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -17152,8 +17152,6 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp)
x_dnd_waiting_for_finish = false;
target = None;
}
-
- x_dnd_last_seen_toplevel = toplevel;
}
if (target != x_dnd_last_seen_window)
@@ -17184,6 +17182,7 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp)
}
x_dnd_action = None;
+ x_dnd_last_seen_toplevel = toplevel;
x_dnd_last_seen_window = target;
x_dnd_last_protocol_version = target_proto;
x_dnd_last_motif_style = motif_style;
@@ -17211,6 +17210,8 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp)
target, &emsg);
}
}
+ else
+ x_dnd_last_seen_toplevel = toplevel;
if (x_dnd_last_window_is_frame && target != None)
x_dnd_note_self_position (dpyinfo, target, root_x, root_y);
@@ -19679,8 +19680,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
x_dnd_waiting_for_finish = false;
target = None;
}
-
- x_dnd_last_seen_toplevel = toplevel;
}
if (target != x_dnd_last_seen_window)
@@ -19732,6 +19731,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
}
x_dnd_action = None;
+ x_dnd_last_seen_toplevel = toplevel;
x_dnd_last_seen_window = target;
x_dnd_last_protocol_version = target_proto;
x_dnd_last_motif_style = motif_style;
@@ -19760,6 +19760,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
target, &emsg);
}
}
+ else
+ x_dnd_last_seen_toplevel = toplevel;
if (x_dnd_last_window_is_frame && target != None)
x_dnd_note_self_position (dpyinfo, target,
@@ -21550,8 +21552,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
x_dnd_waiting_for_finish = false;
target = None;
}
-
- x_dnd_last_seen_toplevel = toplevel;
}
if (target != x_dnd_last_seen_window)
@@ -21605,6 +21605,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
}
x_dnd_action = None;
+ x_dnd_last_seen_toplevel = toplevel;
x_dnd_last_seen_window = target;
x_dnd_last_protocol_version = target_proto;
x_dnd_last_motif_style = motif_style;
@@ -21633,6 +21634,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
target, &emsg);
}
}
+ else
+ x_dnd_last_seen_toplevel = toplevel;
if (x_dnd_last_window_is_frame && target != None)
x_dnd_note_self_position (dpyinfo, target,
From e0ab4e361223d39d955710ce1ae1e64b95bf0c0f Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Fri, 16 Sep 2022 11:03:35 +0200
Subject: [PATCH 403/915] Rename `image-elide' to `image-cut' and add more
bindings
* doc/lispref/display.texi (Showing Images): Update.
* lisp/image.el (image-map): Move binding to mirror Gimp bindings.
* lisp/image/image-crop.el (image-crop-cut-command): Rename.
(image-cut-color): New user option.
(image-cut): Rename and remove prefix.
(image-crop): Remove prefix.
(image-crop--crop-image-update): Add commands to switch to
move/square modes.
---
doc/lispref/display.texi | 4 +-
etc/NEWS | 9 ++-
lisp/image.el | 2 +-
lisp/image/image-crop.el | 138 ++++++++++++++++++++++-----------------
4 files changed, 85 insertions(+), 68 deletions(-)
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 32cf01b2374..190364852af 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6867,8 +6867,8 @@ Save the image to a file (@code{image-save}).
@item c
Crop the image interactively (@code{image-crop}).
-@item e
-Elide a rectangle from the image interactively (@code{image-elide}).
+@item x
+Cut a rectangle from the image interactively (@code{image-cut}).
@end table
@node Multi-Frame Images
diff --git a/etc/NEWS b/etc/NEWS
index dd63efb02d8..9036e4ee019 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2464,13 +2464,12 @@ name.
* New Modes and Packages in Emacs 29.1
+++
-** New commands 'image-crop' and 'image-elide'.
-These commands allow interactively cropping/eliding the image at
-point. The commands are bound to keys 'c' and 'e' (respectively) in
+** New commands 'image-crop' and 'image-cut.
+These commands allow interactively cropping/cutting the image at
+point. The commands are bound to keys 'c' and 'x' (respectively) in
the local keymap over images. They rely on external programs, by
default 'convert' from ImageMagick, to do the actual cropping/eliding
-of the image file. If the 'exiftool' program is available, it is used
-to optionally rotate images which have the :rotation property.
+of the image file.
---
** New package 'wallpaper'.
diff --git a/lisp/image.el b/lisp/image.el
index bbc3b996b19..eef47fd91c5 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -179,7 +179,7 @@ or \"ffmpeg\") is installed."
"r" #'image-rotate
"o" #'image-save
"c" #'image-crop
- "e" #'image-elide
+ "x" #'image-cut
"h" #'image-flip-horizontally
"v" #'image-flip-vertically
"C-" #'image-mouse-decrease-size
diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el
index 7716efcd543..682fce39866 100644
--- a/lisp/image/image-crop.el
+++ b/lisp/image/image-crop.el
@@ -47,10 +47,10 @@ The following `format-spec' elements are allowed:
:type '(repeat string)
:version "29.1")
-(defcustom image-crop-elide-command '("convert" "-draw" "rectangle %l,%t %r,%b"
- "-fill" "%c"
- "-" "%f:-")
- "Command to make a rectangle inside an image.
+(defcustom image-crop-cut-command '("convert" "-draw" "rectangle %l,%t %r,%b"
+ "-fill" "%c"
+ "-" "%f:-")
+ "Command to cut a rectangle out of an image.
The following `format-spec' elements are allowed:
%l: Left.
@@ -98,31 +98,37 @@ The function is called with two arguments: The first is the
original buffer text, and the second parameter is the cropped
image data.")
-;;;###autoload
-(defun image-elide (color &optional square)
- "Elide a rectangle from the image under point, filling it with COLOR.
-If SQUARE is non-nil (interactively, prefix arg), elide a square
-instead of a rectangle from the image.
-
-Interactively, prompt for COLOR to use, defaulting to black."
- (interactive (list (read-color "Use color: ")
- current-prefix-arg))
- (image-crop square (if (string-empty-p color)
- "black" color)))
+(defcustom image-cut-color "black"
+ "Color to use for the rectangle cut from the image."
+ :type 'string
+ :version "29.1")
;;;###autoload
-(defun image-crop (&optional square elide)
+(defun image-cut (&optional color)
+ "Cut a rectangle from the image under point.
+Interactively, if given a prefix, prompt for COLOR to use.
+Otherwise, default to `image-cut-color'."
+ (interactive (list (and current-prefix-arg (read-color "Use color: "))))
+ (image-crop (if (zerop (length color)) image-cut-color color)))
+
+;;;###autoload
+(defun image-crop (&optional cut)
"Crop the image under point.
-If SQUARE is non-nil (interactively, prefix arg), crop a square
-instead of a rectangle from the image.
+If CUT is non-nil, remove a rectangle from the image instead of
+cropping the image. In that case CUT should be the name of a
+color to fill the rectangle.
-If ELIDE is non-nil, remove a rectangle/square from the image
-instead of cropping the image. In that case ELIDE should be
-the name of a color to fill the rectangle.
+While cropping the image, the following key bindings are available:
+
+`q': Exit without changing anything.
+`RET': Crop/cut the image.
+`m': Make mouse movements move the rectangle instead of altering the
+ rectangle shape.
+`s': Same as `m', but make the rectangle into a square first.
After cropping an image, you can save it by `M-x image-save' or
\\\\[image-save] when point is over the image."
- (interactive "P")
+ (interactive)
(unless (image-type-available-p 'svg)
(error "SVG support is needed to crop images"))
(unless (executable-find (car image-crop-crop-command))
@@ -186,22 +192,21 @@ After cropping an image, you can save it by `M-x image-save' or
(save-excursion
(forward-line 1)
(image-crop--crop-image-1
- svg square (car size) (cdr size)
- (if elide "elide" "crop")))
+ svg (if cut "cut" "crop")))
(quit nil))))
(message (substitute-command-keys
"Type \\[image-save] to save %s image to file")
- (if elide "elided" "cropped"))
+ (if cut "cut" "cropped"))
(delete-region (pos-bol) (pos-eol))
(if area
(image-crop--crop-image-update
- area orig-data size type elide text)
+ area orig-data size type cut text)
;; If the user didn't complete the crop, re-insert the
;; original image (and text).
(insert text))
(undo-amalgamate-change-group undo-handle)))))
-(defun image-crop--crop-image-update (area data size type elide text)
+(defun image-crop--crop-image-update (area data size type cut text)
(let* ((image-scaling-factor 1)
(osize (image-size (create-image data nil t) t))
(factor (/ (float (car osize)) (car size)))
@@ -218,13 +223,13 @@ After cropping an image, you can save it by `M-x image-save' or
(with-temp-buffer
(set-buffer-multibyte nil)
(insert data)
- (if elide
- (image-crop--process image-crop-elide-command
+ (if cut
+ (image-crop--process image-crop-cut-command
`((?l . ,left)
(?t . ,top)
(?r . ,(+ left width))
(?b . ,(+ top height))
- (?c . ,elide)
+ (?c . ,cut)
(?f . ,(cadr (split-string type "/")))))
(image-crop--process image-crop-crop-command
`((?l . ,left)
@@ -235,37 +240,46 @@ After cropping an image, you can save it by `M-x image-save' or
(buffer-string))
text)))
-(defun image-crop--crop-image-1 (svg &optional square image-width image-height op)
+(defun image-crop--width (area)
+ (- (plist-get area :right) (plist-get area :left)))
+
+(defun image-crop--height (area)
+ (- (plist-get area :bottom) (plist-get area :top)))
+
+(defun image-crop--crop-image-1 (svg op)
(track-mouse
(cl-loop
- with prompt = (if square
- (format "Move square for %s" op)
- (format
- (substitute-command-keys
- "Select area for %s (click \\`mouse-1' and drag)")
- op))
- and state = (if square 'move-unclick 'begin)
- and area = (if square
- (list :left (- (/ image-width 2)
- (/ image-height 2))
- :top 0
- :right (+ (/ image-width 2)
- (/ image-height 2))
- :bottom image-height)
- (list :left 0
- :top 0
- :right 0
- :bottom 0))
+ with prompt = (format
+ (substitute-command-keys
+ "Select area for %s (click \\`mouse-1' and drag)")
+ op)
+ and state = 'begin
+ and area = (list :left 0
+ :top 0
+ :right 0
+ :bottom 0)
and corner = nil
for event = (read-event prompt)
- do (if (or (not (consp event))
- (not (consp (cadr event)))
- (not (nth 7 (cadr event)))
- ;; Only do things if point is over the SVG being
- ;; tracked.
- (not (eq (cl-getf (cdr (nth 7 (cadr event))) :type)
- 'svg)))
- ()
+ do (cond
+ ;; Go to "square" mode.
+ ((eql event ?s)
+ (setq state 'move-unclick
+ prompt (format "Move square for %s" op))
+ (let ((size (min (image-crop--width area) (image-crop--height area))))
+ (setf (plist-get area :right) (+ (plist-get area :left) size)
+ (plist-get area :bottom) (+ (plist-get area :top) size))))
+ ;; Go to "move" move.
+ ((eql event ?m)
+ (setq state 'move-unclick
+ prompt (format "Move for %s" op)))
+ ;; We have a (relevant) mouse event.
+ ((and (consp event)
+ (consp (cadr event))
+ (nth 7 (cadr event))
+ ;; Only do things if point is over the SVG being
+ ;; tracked.
+ (eq (cl-getf (cdr (nth 7 (cadr event))) :type)
+ 'svg))
(let ((pos (nth 8 (cadr event))))
(cl-case state
(begin
@@ -322,11 +336,15 @@ After cropping an image, you can save it by `M-x image-save' or
(move-click
(cond
((eq (car event) 'mouse-movement)
- (setf (cl-getf area :left) (car pos)
- (cl-getf area :right) (+ (car pos) image-height)))
+ (setf (cl-getf area :right)
+ (+ (car pos) (image-crop--width area)))
+ (setf (cl-getf area :left) (car pos))
+ (setf (cl-getf area :bottom)
+ (+ (cdr pos) (image-crop--height area)))
+ (setf (cl-getf area :top) (cdr pos)))
((memq (car event) '(mouse-1 drag-mouse-1))
(setq state 'move-unclick
- prompt (format "Click to move for %s" op))))))))
+ prompt (format "Click to move for %s" op)))))))))
do (svg-line svg (cl-getf area :left) (cl-getf area :top)
(cl-getf area :right) (cl-getf area :top)
:id "top-line" :stroke-color "white")
From cdb8106bec97c6a4d1e34a7ce98a54dfe2060d5a Mon Sep 17 00:00:00 2001
From: Po Lu
Date: Fri, 16 Sep 2022 17:16:48 +0800
Subject: [PATCH 404/915] Fix icon spec for outline icons
* lisp/outline.el (outline-open):
(outline-close): Fix listing of multiple images. Reported by
Lars Ingebrigtsen .
---
lisp/outline.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lisp/outline.el b/lisp/outline.el
index 25f3b21e632..8281f24291d 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -293,8 +293,8 @@ buffers (yet) -- that will be amended in a future version."
:version "29.1")
(define-icon outline-open nil
- '((image "outline-open.svg" :height 15 :ascent center)
- (image "outline-open.pbm" :height 15 :ascent center)
+ '((image "outline-open.svg" "outline-open.pbm"
+ :height 15 :ascent center)
(emoji "🔽")
(symbol " ▼ ")
(text " open "))
@@ -303,8 +303,8 @@ buffers (yet) -- that will be amended in a future version."
:help-echo "Open this section")
(define-icon outline-close nil
- '((image "outline-close.svg" :height 15 :ascent center)
- (image "outline-close.pbm" :height 15 :ascent center)
+ '((image "outline-close.svg" "outline-close.pbm"
+ :height 15 :ascent center)
(emoji "▶️")
(symbol " ▶ ")
(text " close "))
From fd8969fe27fc2757a22ec5ae7013e088ad4f2015 Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Fri, 16 Sep 2022 11:46:25 +0200
Subject: [PATCH 405/915] Fix sorting of backends in vc-responsible-backend
* lisp/vc/vc.el (vc-responsible-backend): When comparing directory
names, expand them first so that we get consistent sorting of ~/
etc (bug#57777).
---
lisp/vc/vc.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 39a5be6654b..05109256bd1 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1014,7 +1014,7 @@ responsible for the given file."
(lambda (backend)
(when-let ((dir (vc-call-backend
backend 'responsible-p file)))
- (cons backend dir)))
+ (cons backend (expand-file-name dir))))
vc-handled-backends))))
;; Just a single response (or none); use it.
(if (< (length dirs) 2)
From 520b041b5446b09530e4b9a23b364da223a59b7b Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Fri, 16 Sep 2022 12:14:33 +0200
Subject: [PATCH 406/915] * lisp/textmodes/page-ext.el: Improve Commentary.
---
lisp/textmodes/page-ext.el | 54 +++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/lisp/textmodes/page-ext.el b/lisp/textmodes/page-ext.el
index 24149f9afb8..a38b8d0445b 100644
--- a/lisp/textmodes/page-ext.el
+++ b/lisp/textmodes/page-ext.el
@@ -1,7 +1,6 @@
;;; page-ext.el --- extended page handling commands -*- lexical-binding:t -*-
-;; Copyright (C) 1990-1991, 1993-1994, 2001-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1990-2022 Free Software Foundation, Inc.
;; Author: Robert J. Chassell
;; (according to ack.texi)
@@ -25,20 +24,20 @@
;;; Commentary:
;; You may use these commands to handle an address list or other
-;; small data base.
+;; small database.
;;; Summary
;; The current page commands are:
-;; forward-page C-x ]
-;; backward-page C-x [
-;; narrow-to-page C-x p
-;; count-lines-page C-x l
-;; mark-page C-x C-p (change this to C-x C-p C-m)
-;; sort-pages not bound
-;; what-page not bound
+;; `forward-page' C-x ]
+;; `backward-page' C-x [
+;; `narrow-to-page' C-x p
+;; `count-lines-page' C-x l
+;; `mark-page' C-x C-p (change this to C-x C-p C-m)
+;; `sort-pages' not bound
+;; `what-page' not bound
;; The new page handling commands all use `C-x C-p' as a prefix. This
;; means that the key binding for `mark-page' must be changed.
@@ -47,15 +46,15 @@
;; New page handling commands:
-;; pages-next-page C-x C-p C-n
-;; pages-previous-page C-x C-p C-p
-;; pages-search C-x C-p C-s
-;; pages-add-new-page C-x C-p C-a
-;; pages-sort-buffer C-x C-p s
-;; pages-set-delimiter C-x C-p C-l
-;; pages-directory C-x C-p C-d
-;; pages-directory-for-addresses C-x C-p d
-;; pages-directory-goto C-c C-c
+;; `pages-next-page' C-x C-p C-n
+;; `pages-previous-page' C-x C-p C-p
+;; `pages-search' C-x C-p C-s
+;; `pages-add-new-page' C-x C-p C-a
+;; `pages-sort-buffer' C-x C-p s
+;; `pages-set-delimiter' C-x C-p C-l
+;; `pages-directory' C-x C-p C-d
+;; `pages-directory-for-addresses' C-x C-p d
+;; `pages-directory-goto' C-c C-c
;;; Using the page commands
@@ -103,8 +102,8 @@
;;
;; 2. The first line of text in each entry is the `heading line'; it
;; will appear in the pages-directory-buffer which is constructed
-;; using the `C-x C-p C-d' (pages-directory) command or the `C-x
-;; C-p d' (pages-directory-for-addresses) command.
+;; using the `C-x C-p C-d' (`pages-directory') command or the
+;; `C-x C-p d' (`pages-directory-for-addresses') command.
;;
;; The heading line may be on the same line as the page-delimiter
;; or it may follow after. It is the first non-blank line on the
@@ -163,17 +162,18 @@
;; `pages-previous-page', `pages-add-new-page', `mark-page', and `pages-search'
;; commands.
-;; You may use either the `C-x C-p d' (pages-directory-for-addresses)
-;; or the `C-x C-p C-d' (pages-directory) command to construct and
+;; You may use either the `C-x C-p d' (`pages-directory-for-addresses')
+;; or the `C-x C-p C-d' (`pages-directory') command to construct and
;; display a directory of all the heading lines.
;; In the directory, you may position the cursor over a heading line
-;; and type `C-c C-c' (pages-directory-goto) to go to the entry to
+;; and type `C-c C-c' (`pages-directory-goto') to go to the entry to
;; which it refers in the pages buffer.
-;; You can type `C-c C-p C-a' (pages-add-new-page) to add a new entry in the
-;; pages buffer or address file. This is the same command you use to
-;; add a new entry when you are in the pages buffer or address file.
+;; You can type `C-c C-p C-a' (`pages-add-new-page') to add a new
+;; entry in the pages buffer or address file. This is the same
+;; command you use to add a new entry when you are in the pages buffer
+;; or address file.
;; If you wish, you may create several different directories,
;; one for each different buffer.
From 7d39453fd64e355526291b0ca5672e838de5fb58 Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Fri, 16 Sep 2022 12:29:54 +0200
Subject: [PATCH 407/915] Add new predicate list-of-strings-p
* lisp/subr.el (list-of-strings-p): New function.
---
lisp/subr.el | 5 +++++
test/lisp/subr-tests.el | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/lisp/subr.el b/lisp/subr.el
index bfc2e207b2c..e8e8f1584b4 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4026,6 +4026,11 @@ system's shell."
Otherwise, return nil."
(or (stringp object) (null object)))
+(defun list-of-strings-p (object)
+ "Return t if OBJECT is nil or a list of strings."
+ (and (listp object)
+ (seq-every-p #'stringp object)))
+
(defun booleanp (object)
"Return t if OBJECT is one of the two canonical boolean values: t or nil.
Otherwise, return nil."
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index 30117132101..38966cea585 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -1158,5 +1158,12 @@ final or penultimate step during initialization."))
(should (equal (butlast l n)
(subr-tests--butlast-ref l n))))))
+(ert-deftest test-list-of-strings-p ()
+ (should-not (list-of-strings-p 1))
+ (should (list-of-strings-p nil))
+ (should (list-of-strings-p '("a" "b")))
+ (should-not (list-of-strings-p ["a" "b"]))
+ (should-not (list-of-strings-p '("a" nil "b"))))
+
(provide 'subr-tests)
;;; subr-tests.el ends here
From 7be7ad279e96f90cc70e384a350331de8e1607df Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Fri, 16 Sep 2022 12:36:15 +0200
Subject: [PATCH 408/915] Don't use autoloaded functions for
safe-local-variable
* doc/lispref/symbols.texi (Standard Properties): Clarify how
safe-local-variable should look.
* lisp/emacs-lisp/checkdoc.el (checkdoc-ispell-lisp-words)
(checkdoc-symbol-words): Use list-of-strings-p.
(checkdoc-list-of-strings-p): Obsolete.
* lisp/vc/vc-git.el (vc-git-annotate-switches): Remove.
(vc-git-annotate-switches): Open-code the check.
---
doc/lispref/symbols.texi | 5 ++++-
lisp/emacs-lisp/checkdoc.el | 6 +++---
lisp/vc/vc-git.el | 19 ++++++-------------
3 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi
index 336fa9c9182..ea1e086ebf1 100644
--- a/doc/lispref/symbols.texi
+++ b/doc/lispref/symbols.texi
@@ -613,7 +613,10 @@ file-local evaluation forms. @xref{File Local Variables}.
@item safe-local-variable
The value specifies a function for determining safe file-local values
-for the named variable. @xref{File Local Variables}.
+for the named variable. @xref{File Local Variables}. Since this
+value is consulted when loading files, the function should be
+efficient and should ideally not lead to loading any libraries to
+determine the safeness (e.g., it should not be an autoloaded function).
@item side-effect-free
@cindex @code{side-effect-free} property
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 20d64b59158..3f9bc28e0b0 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -250,7 +250,7 @@ with these words enabled."
(defvar checkdoc-ispell-lisp-words
'("alist" "emacs" "etags" "keymap" "paren" "regexp" "sexp")
"List of words that are correct when spell-checking Lisp documentation.")
-;;;###autoload(put 'checkdoc-ispell-list-words 'safe-local-variable #'checkdoc-list-of-strings-p)
+;;;###autoload(put 'checkdoc-ispell-list-words 'safe-local-variable #'list-of-strings-p)
(defcustom checkdoc-max-keyref-before-warn nil
"If non-nil, number of \\\\=[command-to-keystroke] tokens allowed in a doc string.
@@ -320,7 +320,7 @@ These words are ignored when unquoted symbols are searched for.
This should be set in an Emacs Lisp file's local variables."
:type '(repeat (string :tag "Word"))
:version "28.1")
-;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable #'checkdoc-list-of-strings-p)
+;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable #'list-of-strings-p)
(defcustom checkdoc-column-zero-backslash-before-paren t
"Non-nil means to warn if there is no \"\\\" before \"(\" in column zero.
@@ -360,9 +360,9 @@ large number of libraries means it is impractical to fix all
of these warnings masse. In almost any other case, setting
this to anything but t is likely to be counter-productive.")
-;;;###autoload
(defun checkdoc-list-of-strings-p (obj)
"Return t when OBJ is a list of strings."
+ (declare (obsolete list-of-strings-p "29.1"))
;; this is a function so it might be shared by checkdoc-proper-noun-list
;; and/or checkdoc-ispell-lisp-words in the future
(and (listp obj)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index b1025ed7149..a5d12f03bcf 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -119,18 +119,6 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(repeat :tag "Argument List" :value ("") string))
:version "23.1")
-;; We put the entire function into the autoload file so that we don't
-;; have to load a whole bunch of vc.*el files just to see whether the
-;; file-local variable is safe.
-;;;###autoload
-(progn
- (defun vc-git-annotate-switches-safe-p (switches)
- "Check if local value of `vc-git-annotate-switches' is safe.
-Currently only \"-w\" (ignore whitespace) is considered safe, but
-this list might be extended in the future."
- ;; TODO: Probably most options are perfectly safe.
- (equal switches "-w")))
-
(defcustom vc-git-annotate-switches nil
"String or list of strings specifying switches for Git blame under VC.
If nil, use the value of `vc-annotate-switches'. If t, use no switches."
@@ -139,7 +127,12 @@ If nil, use the value of `vc-annotate-switches'. If t, use no switches."
(string :tag "Argument String")
(repeat :tag "Argument List" :value ("") string))
:version "25.1")
-;;;###autoload(put 'vc-git-annotate-switches 'safe-local-variable #'vc-git-annotate-switches-safe-p)
+
+;; Check if local value of `vc-git-annotate-switches' is safe.
+;; Currently only "-w" (ignore whitespace) is considered safe, but
+;; this list might be extended in the future (probably most options
+;; are perfectly safe.)
+;;;###autoload(put 'vc-git-annotate-switches 'safe-local-variable (lambda (switches) (equal switches "-w")))
(defcustom vc-git-log-switches nil
"String or list of strings specifying switches for Git log under VC."
From f25f9dbf301fb0265917ddc20d8435f9ad4ee684 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Fri, 16 Sep 2022 12:44:08 +0200
Subject: [PATCH 409/915] Minor doc fixes in picture.el
* lisp/textmodes/picture.el: Improve Commentary.
(picture-forward-column, picture-backward-column)
(picture-move-down, picture-move-up, picture-movement-nw)
(picture-movement-ne, picture-movement-sw, picture-movement-se)
(picture-set-motion, picture-clear-line, picture-newline)
(picture-tab, picture-yank-rectangle)
(picture-yank-rectangle-from-register, picture-insert-rectangle)
(picture-draw-rectangle): Minor doc fixes.
---
lisp/textmodes/picture.el | 66 +++++++++++++++++++++------------------
1 file changed, 36 insertions(+), 30 deletions(-)
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index 17d9483f68c..54142412553 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -23,9 +23,9 @@
;;; Commentary:
-;; This code provides the picture-mode commands documented in the Emacs
+;; This code provides the `picture-mode' commands documented in the Emacs
;; manual. The screen is treated as a semi-infinite quarter-plane with
-;; support for rectangle operations and `etch-a-sketch' character
+;; support for rectangle operations and "etch-a-sketch" character
;; insertion in any of eight directions.
;;; Code:
@@ -96,7 +96,7 @@ If scan reaches end of buffer, stop there without error."
(defun picture-forward-column (arg &optional interactive)
"Move cursor right, making whitespace if necessary.
-With argument, move that many columns."
+With prefix argument ARG, move that many columns."
(interactive "^p\nd")
(let (deactivate-mark)
(picture-update-desired-column interactive)
@@ -110,14 +110,14 @@ With argument, move that many columns."
(defun picture-backward-column (arg &optional interactive)
"Move cursor left, making whitespace if necessary.
-With argument, move that many columns."
+With prefix argument ARG, move that many columns."
(interactive "^p\nd")
(picture-update-desired-column interactive)
(picture-forward-column (- arg)))
(defun picture-move-down (arg)
"Move vertically down, making whitespace if necessary.
-With argument, move that many lines."
+With prefix argument ARG, move that many lines."
(interactive "^p")
(let (deactivate-mark)
(picture-update-desired-column nil)
@@ -134,7 +134,7 @@ With argument, move that many lines."
(defun picture-move-up (arg)
"Move vertically up, making whitespace if necessary.
-With argument, move that many lines."
+With prefix argument ARG, move that many lines."
(interactive "^p")
(picture-update-desired-column nil)
(picture-move-down (- arg)))
@@ -161,36 +161,36 @@ With argument, move that many lines."
(defun picture-movement-nw (&optional arg)
"Move up and left after self-inserting character in Picture mode.
-With prefix argument, move up and two-column left."
+With prefix argument ARG, move up and two-column left."
(interactive "P")
(picture-set-motion -1 (if arg -2 -1)))
(defun picture-movement-ne (&optional arg)
"Move up and right after self-inserting character in Picture mode.
-With prefix argument, move up and two-column right."
+With prefix argument ARG, move up and two-column right."
(interactive "P")
(picture-set-motion -1 (if arg 2 1)))
(defun picture-movement-sw (&optional arg)
"Move down and left after self-inserting character in Picture mode.
-With prefix argument, move down and two-column left."
+With prefix argument ARG, move down and two-column left."
(interactive "P")
(picture-set-motion 1 (if arg -2 -1)))
(defun picture-movement-se (&optional arg)
"Move down and right after self-inserting character in Picture mode.
-With prefix argument, move down and two-column right."
+With prefix argument ARG, move down and two-column right."
(interactive "P")
(picture-set-motion 1 (if arg 2 1)))
-(defun picture-set-motion (vert horiz)
+(defun picture-set-motion (vertical horizontal)
"Set VERTICAL and HORIZONTAL increments for movement in Picture mode.
The mode line is updated to reflect the current direction."
- (setq picture-vertical-step vert
- picture-horizontal-step horiz)
+ (setq picture-vertical-step vertical
+ picture-horizontal-step horizontal)
(setq mode-name
(format "Picture:%s"
- (nth (+ 2 (% horiz 3) (* 5 (1+ (% vert 2))))
+ (nth (+ 2 (% horizontal 3) (* 5 (1+ (% vertical 2))))
'(wnw nw up ne ene Left left none right Right
wsw sw down se ese))))
(force-mode-line-update)
@@ -305,9 +305,9 @@ Use \"\\[command-apropos] picture-movement\" to see those commands."
(defun picture-clear-line (arg)
"Clear out rest of line; if at end of line, advance to next line.
-Cleared-out line text goes into the kill ring, as do newlines that are
-advanced over. With argument, clear out (and save in kill ring) that
-many lines."
+Cleared-out line text goes into the kill ring, as do newlines
+that are advanced over. With prefix argument ARG, clear out (and
+save in kill ring) that many lines."
(interactive "P")
(if arg
(progn
@@ -320,7 +320,8 @@ many lines."
(defun picture-newline (arg)
"Move to the beginning of the following line.
-With argument, moves that many lines (up, if negative argument);
+With prefix argument ARG, move that many lines (up, if negative
+argument);
always moves to the beginning of a line."
(interactive "^p")
(let ((start (point))
@@ -466,8 +467,11 @@ If no such character is found, move to beginning of line."
(defun picture-tab (&optional arg)
"Tab transparently (just move point) to next tab stop.
-With prefix arg, overwrite the traversed text with spaces. The tab stop
-list can be changed by \\[picture-set-tab-stops] and \\[edit-tab-stops].
+With prefix argument ARG, overwrite the traversed text with
+spaces. The tab stop list can be changed by \
+\\\\[picture-set-tab-stops] and
+\\[edit-tab-stops].
+
See also documentation for variable `picture-tab-chars'."
(interactive "^P")
(let* ((opoint (point)))
@@ -515,10 +519,11 @@ Interactively, reads the register using `register-read-with-preview'."
(defun picture-yank-rectangle (&optional insertp)
"Overlay rectangle saved by \\[picture-clear-rectangle].
-The rectangle is positioned with upper left corner at point, overwriting
-existing text. With prefix argument, the rectangle is inserted instead,
-shifting existing text. Leaves mark at one corner of rectangle and
-point at the other (diagonally opposed) corner."
+The rectangle is positioned with upper left corner at point,
+overwriting existing text. With prefix argument INSERTP, the
+rectangle is inserted instead, shifting existing text. Leave
+mark at one corner of rectangle and point at the
+other (diagonally opposed) corner."
(interactive "P")
(if (not (consp picture-killed-rectangle))
(error "No rectangle saved")
@@ -536,10 +541,11 @@ regardless of where you click."
(defun picture-yank-rectangle-from-register (register &optional insertp)
"Overlay rectangle saved in REGISTER.
-The rectangle is positioned with upper left corner at point, overwriting
-existing text. With prefix argument, the rectangle is
-inserted instead, shifting existing text. Leaves mark at one corner
-of rectangle and point at the other (diagonally opposed) corner.
+The rectangle is positioned with upper left corner at point,
+overwriting existing text. With prefix argument INSERTP, the
+rectangle is inserted instead, shifting existing text. Leave
+mark at one corner of rectangle and point at the
+other (diagonally opposed) corner.
Interactively, reads the register using `register-read-with-preview'."
(interactive (list (register-read-with-preview "Rectangle from register: ")
@@ -552,7 +558,7 @@ Interactively, reads the register using `register-read-with-preview'."
(defun picture-insert-rectangle (rectangle &optional insertp)
"Overlay RECTANGLE with upper left corner at point.
Optional argument INSERTP, if non-nil causes RECTANGLE to be inserted.
-Leaves the region surrounding the rectangle."
+Leave the region surrounding the rectangle."
(let ((indent-tabs-mode nil))
(if (not insertp)
(save-excursion
@@ -570,7 +576,7 @@ Leaves the region surrounding the rectangle."
(if (= (current-column) 0) 1 0)))
(defun picture-draw-rectangle (start end)
- "Draw a rectangle around region."
+ "Draw a rectangle around region from START to END."
(interactive "*r") ; start will be less than end
(let* ((sl (picture-current-line))
(sc (current-column))
From 37e9d6a35aa9fb087490292ca8c2143930b052cf Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Fri, 16 Sep 2022 12:51:28 +0200
Subject: [PATCH 410/915] Prefer defvar-keymap in picture.el
* lisp/textmodes/picture.el (picture-mode-map): Prefer defvar-keymap.
---
lisp/textmodes/picture.el | 108 ++++++++++++++++++--------------------
1 file changed, 52 insertions(+), 56 deletions(-)
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index e8c1e6b14f2..a020b7de850 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -1,6 +1,6 @@
;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model -*- lexical-binding: t -*-
-;; Copyright (C) 1985, 1994, 2001-2022 Free Software Foundation, Inc.
+;; Copyright (C) 1985-2022 Free Software Foundation, Inc.
;; Author: K. Shane Hartman
;; Maintainer: emacs-devel@gnu.org
@@ -615,61 +615,57 @@ Leaves the region surrounding the rectangle."
(defalias 'picture-delete-char 'delete-char)
-(defvar picture-mode-map
- (let ((map (make-keymap)))
- (define-key map [remap self-insert-command] 'picture-self-insert)
- (define-key map [remap completion-separator-self-insert-command]
- 'picture-self-insert)
- (define-key map [remap completion-separator-self-insert-autofilling]
- 'picture-self-insert)
- (define-key map [remap forward-char] 'picture-forward-column)
- (define-key map [remap right-char] 'picture-forward-column)
- (define-key map [remap backward-char] 'picture-backward-column)
- (define-key map [remap left-char] 'picture-backward-column)
- (define-key map [remap delete-char] 'picture-clear-column)
- ;; There are two possibilities for what is normally on DEL.
- (define-key map [remap backward-delete-char-untabify]
- 'picture-backward-clear-column)
- (define-key map [remap delete-backward-char] 'picture-backward-clear-column)
- (define-key map [remap kill-line] 'picture-clear-line)
- (define-key map [remap open-line] 'picture-open-line)
- (define-key map [remap newline] 'picture-newline)
- (define-key map [remap newline-and-indent] 'picture-duplicate-line)
- (define-key map [remap next-line] 'picture-move-down)
- (define-key map [remap previous-line] 'picture-move-up)
- (define-key map [remap move-beginning-of-line] 'picture-beginning-of-line)
- (define-key map [remap move-end-of-line] 'picture-end-of-line)
- (define-key map [remap mouse-set-point] 'picture-mouse-set-point)
- (define-key map "\C-c\C-d" 'picture-delete-char)
- (define-key map "\t" 'picture-tab)
- (define-key map "\e\t" 'picture-tab-search)
- (define-key map "\C-c\t" 'picture-set-tab-stops)
- (define-key map "\C-c\C-k" 'picture-clear-rectangle)
- (define-key map "\C-c\C-w" 'picture-clear-rectangle-to-register)
- (define-key map "\C-c\C-y" 'picture-yank-rectangle)
- (define-key map "\C-c\C-x" 'picture-yank-rectangle-from-register)
- (define-key map "\C-c\C-r" 'picture-draw-rectangle)
- (define-key map "\C-c\C-c" 'picture-mode-exit)
- (define-key map "\C-c\C-f" 'picture-motion)
- (define-key map "\C-c\C-b" 'picture-motion-reverse)
- (define-key map "\C-c<" 'picture-movement-left)
- (define-key map "\C-c>" 'picture-movement-right)
- (define-key map "\C-c^" 'picture-movement-up)
- (define-key map "\C-c." 'picture-movement-down)
- (define-key map "\C-c`" 'picture-movement-nw)
- (define-key map "\C-c'" 'picture-movement-ne)
- (define-key map "\C-c/" 'picture-movement-sw)
- (define-key map "\C-c\\" 'picture-movement-se)
- (define-key map [(control ?c) left] 'picture-movement-left)
- (define-key map [(control ?c) right] 'picture-movement-right)
- (define-key map [(control ?c) up] 'picture-movement-up)
- (define-key map [(control ?c) down] 'picture-movement-down)
- (define-key map [(control ?c) home] 'picture-movement-nw)
- (define-key map [(control ?c) prior] 'picture-movement-ne)
- (define-key map [(control ?c) end] 'picture-movement-sw)
- (define-key map [(control ?c) next] 'picture-movement-se)
- map)
- "Keymap used in `picture-mode'.")
+(defvar-keymap picture-mode-map
+ :doc "Keymap used in `picture-mode'."
+ :full t
+ "" #'picture-self-insert
+ "" #'picture-self-insert
+ "" #'picture-self-insert
+ "" #'picture-forward-column
+ "" #'picture-forward-column
+ "" #'picture-backward-column
+ "" #'picture-backward-column
+ "" #'picture-clear-column
+ ;; There are two possibilities for what is normally on DEL.
+ "" #'picture-backward-clear-column
+ "" #'picture-backward-clear-column
+ "" #'picture-clear-line
+ "" #'picture-open-line
+ "" #'picture-newline
+ "" #'picture-duplicate-line
+ "" #'picture-move-down
+ "" #'picture-move-up
+ "" #'picture-beginning-of-line
+ "" #'picture-end-of-line
+ "" #'picture-mouse-set-point
+ "C-c C-d" #'picture-delete-char
+ "TAB" #'picture-tab
+ "M-TAB" #'picture-tab-search
+ "C-c TAB" #'picture-set-tab-stops
+ "C-c C-k" #'picture-clear-rectangle
+ "C-c C-w" #'picture-clear-rectangle-to-register
+ "C-c C-y" #'picture-yank-rectangle
+ "C-c C-x" #'picture-yank-rectangle-from-register
+ "C-c C-r" #'picture-draw-rectangle
+ "C-c C-c" #'picture-mode-exit
+ "C-c C-f" #'picture-motion
+ "C-c C-b" #'picture-motion-reverse
+ "C-c <" #'picture-movement-left
+ "C-c >" #'picture-movement-right
+ "C-c ^" #'picture-movement-up
+ "C-c ." #'picture-movement-down
+ "C-c `" #'picture-movement-nw
+ "C-c '" #'picture-movement-ne
+ "C-c /" #'picture-movement-sw
+ "C-c \\" #'picture-movement-se
+ "C-c " #'picture-movement-left
+ "C-c " #'picture-movement-right
+ "C-c " #'picture-movement-up
+ "C-c " #'picture-movement-down
+ "C-c " #'picture-movement-nw
+ "C-c " #'picture-movement-ne
+ "C-c " #'picture-movement-sw
+ "C-c " #'picture-movement-se)
(defcustom picture-mode-hook nil
"If non-nil, its value is called on entry to Picture mode.
From 711f908f5d7ce348e28e5640c83d1b0d024b65ca Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Fri, 16 Sep 2022 13:05:54 +0200
Subject: [PATCH 411/915] Fix cperl list indentation problem
* lisp/progmodes/cperl-mode.el (cperl-calculate-indent): Indent
foo:bar() in lists correctly (bug#57829).
---
lisp/progmodes/cperl-mode.el | 2 +-
.../cperl-mode-resources/cperl-indents.erts | 26 +++++++++++++++++++
test/lisp/progmodes/cperl-mode-tests.el | 3 +++
3 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index a3995e2969d..85229250ee0 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -3016,7 +3016,7 @@ and closing parentheses and brackets."
;; Now it is a hash reference
(+ cperl-indent-level cperl-close-paren-offset))
;; Labels do not take :: ...
- (if (looking-at "\\(\\w\\|_\\)+[ \t]*:")
+ (if (looking-at "\\(\\w\\|_\\)+[ \t]*:[^:]")
(if (> (current-indentation) cperl-min-label-indent)
(- (current-indentation) cperl-label-offset)
;; Do not move `parse-data', this should
diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts b/test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts
new file mode 100644
index 00000000000..6b874ffaa1f
--- /dev/null
+++ b/test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts
@@ -0,0 +1,26 @@
+Code:
+ (lambda ()
+ (cperl-mode)
+ (indent-region (point-min) (point-max)))
+
+Name: cperl-indent1
+
+=-=
+{
+ print "",
+ "",
+ foo::bar(),
+ "";
+}
+=-=-=
+
+Name: cperl-indents1
+
+=-=
+{
+ print "",
+ "",
+ foobar(),
+ "";
+}
+=-=-=
diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el
index 7eb2d9be756..db3feec93ab 100644
--- a/test/lisp/progmodes/cperl-mode-tests.el
+++ b/test/lisp/progmodes/cperl-mode-tests.el
@@ -1103,4 +1103,7 @@ as a regex."
(funcall cperl-test-mode)
(should-not (nth 3 (syntax-ppss 3)))))
+(ert-deftest test-indentation ()
+ (ert-test-erts-file (ert-resource-file "cperl-indents.erts")))
+
;;; cperl-mode-tests.el ends here
From f3277128e0e8741cf20c72c718c83e848cd92f2f Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Fri, 16 Sep 2022 14:17:56 +0300
Subject: [PATCH 412/915] ; * lisp/vc/vc.el (vc-responsible-backend): Explain
last change.
---
lisp/vc/vc.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 05109256bd1..4688137d923 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1014,6 +1014,10 @@ responsible for the given file."
(lambda (backend)
(when-let ((dir (vc-call-backend
backend 'responsible-p file)))
+ ;; We run DIR through `expand-file-name'
+ ;; so that abbreviated directories, such
+ ;; as "~/", wouldn't look "less specific"
+ ;; due to their artificially shorter length.
(cons backend (expand-file-name dir))))
vc-handled-backends))))
;; Just a single response (or none); use it.
From 9c0403aae0498d356c56bf972013faec61097064 Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Fri, 16 Sep 2022 13:18:16 +0200
Subject: [PATCH 413/915] Inhibit image-mode resizing in the minibuffer
* lisp/image-mode.el (image-fit-to-window): Don't resize when in
the minibuffer (bug#57823).
---
lisp/image-mode.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index bc0f7ccb048..0f1c4901591 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -1058,7 +1058,11 @@ Otherwise, display the image by calling `image-mode'."
(defun image-fit-to-window (window)
"Adjust size of image to display it exactly in WINDOW boundaries."
- (when (window-live-p window)
+ (when (and (window-live-p window)
+ ;; Don't resize anything if we're in the minibuffer
+ ;; (which may transitively change the window sizes if you
+ ;; hit TAB, for instance).
+ (not (minibuffer-window-active-p (selected-window))))
(with-current-buffer (window-buffer window)
(when (derived-mode-p 'image-mode)
(let ((spec (image-get-display-property)))
From 8c5363f8e89222994f041e06668a751233f96faf Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Fri, 16 Sep 2022 13:23:34 +0200
Subject: [PATCH 414/915] Regenerate ldefs-boot.el
---
lisp/ldefs-boot.el | 248 ++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 220 insertions(+), 28 deletions(-)
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index e84795547c2..47080250020 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -4048,14 +4048,10 @@ Returns non-nil if any false statements are found.
(put 'checkdoc-force-history-flag 'safe-local-variable #'booleanp)
(put 'checkdoc-permit-comma-termination-flag 'safe-local-variable #'booleanp)
(put 'checkdoc-spellcheck-documentation-flag 'safe-local-variable #'booleanp)
-(put 'checkdoc-ispell-list-words 'safe-local-variable #'checkdoc-list-of-strings-p)
+(put 'checkdoc-ispell-list-words 'safe-local-variable #'list-of-strings-p)
(put 'checkdoc-arguments-in-order-flag 'safe-local-variable #'booleanp)
(put 'checkdoc-verb-check-experimental-flag 'safe-local-variable #'booleanp)
-(put 'checkdoc-symbol-words 'safe-local-variable #'checkdoc-list-of-strings-p)
-(autoload 'checkdoc-list-of-strings-p "checkdoc" "\
-Return t when OBJ is a list of strings.
-
-(fn OBJ)")
+(put 'checkdoc-symbol-words 'safe-local-variable #'list-of-strings-p)
(put 'checkdoc-proper-noun-regexp 'safe-local-variable 'stringp)
(put 'checkdoc-common-verbs-regexp 'safe-local-variable 'stringp)
(autoload 'checkdoc "checkdoc" "\
@@ -16943,25 +16939,31 @@ should output the image in the current buffer, converted to
;;; Generated autoloads from image/image-crop.el
-(autoload 'image-elide "image-crop" "\
-Elide a square from the image under point.
-If SQUARE (interactively, the prefix), elide a square instead of a
-rectangle from the image.
+(autoload 'image-cut "image-crop" "\
+Cut a rectangle from the image under point.
+Interactively, if given a prefix, prompt for COLOR to use.
+Otherwise, default to `image-cut-color'.
-(fn &optional SQUARE)" t)
+(fn &optional COLOR)" t)
(autoload 'image-crop "image-crop" "\
Crop the image under point.
-If SQUARE (interactively, the prefix), crop a square instead of a
-rectangle from the image.
+If CUT is non-nil, remove a rectangle from the image instead of
+cropping the image. In that case CUT should be the name of a
+color to fill the rectangle.
-If ELIDE, remove a rectangle from the image instead of cropping
-the image.
+While cropping the image, the following key bindings are available:
-After cropping an image, it can be saved by `M-x image-save' or
+`q': Exit without changing anything.
+`RET': Crop/cut the image.
+`m': Make mouse movements move the rectangle instead of altering the
+ rectangle shape.
+`s': Same as `m', but make the rectangle into a square first.
+
+After cropping an image, you can save it by `M-x image-save' or
\\\\[image-save] when point is over the image.
-(fn &optional SQUARE ELIDE)" t)
-(register-definition-prefixes "image-crop" '("image-crop-"))
+(fn &optional CUT)" t)
+(register-definition-prefixes "image-crop" '("image-c"))
;;; Generated autoloads from image/image-dired.el
@@ -18756,7 +18758,7 @@ See `linum-mode' for more information on Linum mode.
(put 'generated-autoload-file 'safe-local-variable 'stringp)
(put 'generated-autoload-load-name 'safe-local-variable 'stringp)
(autoload 'loaddefs-generate "loaddefs-gen" "\
-Generate loaddefs files for Lisp files in the directories DIRS.
+Generate loaddefs files for Lisp files in one or more directories given by DIR.
DIR can be either a single directory or a list of directories.
The autoloads will be written to OUTPUT-FILE. If any Lisp file
@@ -18764,7 +18766,7 @@ binds `generated-autoload-file' as a file-local variable, write
its autoloads into the specified file instead.
The function does NOT recursively descend into subdirectories of the
-directory or directories specified by DIRS.
+directories specified by DIR.
Optional argument EXCLUDED-FILES, if non-nil, should be a list of
files, such as preloaded files, whose autoloads should not be written
@@ -23281,6 +23283,13 @@ for the result of evaluating EXP (first arg to `pcase').
Completion rules for the `cvs' command.")
(register-definition-prefixes "pcmpl-cvs" '("pcmpl-cvs-"))
+
+;;; Generated autoloads from pcmpl-git.el
+
+(autoload 'pcomplete/git "pcmpl-git" "\
+Completion for the `git' command.")
+(register-definition-prefixes "pcmpl-git" '("pcmpl-git--"))
+
;;; Generated autoloads from pcmpl-gnu.el
@@ -23294,7 +23303,16 @@ Completion for GNU `make'.")
Completion for the GNU tar utility.")
(autoload 'pcomplete/find "pcmpl-gnu" "\
Completion for the GNU find utility.")
-(defalias 'pcomplete/gdb 'pcomplete/xargs)
+(autoload 'pcomplete/awk "pcmpl-gnu" "\
+Completion for the `awk' command.")
+(autoload 'pcomplete/gpg "pcmpl-gnu" "\
+Completion for the `gpg` command.")
+(autoload 'pcomplete/gdb "pcmpl-gnu" "\
+Completion for the `gdb' command.")
+(autoload 'pcomplete/emacs "pcmpl-gnu" "\
+Completion for the `emacs' command.")
+(autoload 'pcomplete/emacsclient "pcmpl-gnu" "\
+Completion for the `emacsclient' command.")
(register-definition-prefixes "pcmpl-gnu" '("pcmpl-gnu-" "pcomplete/find"))
@@ -23306,6 +23324,10 @@ Completion for GNU/Linux `kill', using /proc filesystem.")
Completion for GNU/Linux `umount'.")
(autoload 'pcomplete/mount "pcmpl-linux" "\
Completion for GNU/Linux `mount'.")
+(autoload 'pcomplete/systemctl "pcmpl-linux" "\
+Completion for the `systemctl' command.")
+(autoload 'pcomplete/journalctl "pcmpl-linux" "\
+Completion for the `journalctl' command.")
(register-definition-prefixes "pcmpl-linux" '("pcmpl-linux-" "pcomplete-pare-list"))
@@ -23313,6 +23335,8 @@ Completion for GNU/Linux `mount'.")
(autoload 'pcomplete/rpm "pcmpl-rpm" "\
Completion for the `rpm' command.")
+(autoload 'pcomplete/dnf "pcmpl-rpm" "\
+Completion for the `dnf' command.")
(register-definition-prefixes "pcmpl-rpm" '("pcmpl-rpm-"))
@@ -23324,16 +23348,174 @@ Completion for `cd'.")
(autoload 'pcomplete/rmdir "pcmpl-unix" "\
Completion for `rmdir'.")
(autoload 'pcomplete/rm "pcmpl-unix" "\
-Completion for `rm'.")
+Completion for the `rm' command.")
(autoload 'pcomplete/xargs "pcmpl-unix" "\
Completion for `xargs'.")
-(defalias 'pcomplete/time 'pcomplete/xargs)
+(autoload 'pcomplete/time "pcmpl-unix" "\
+Completion for the `time' command.")
(autoload 'pcomplete/which "pcmpl-unix" "\
Completion for `which'.")
+(autoload 'pcomplete/cat "pcmpl-unix" "\
+Completion for the `cat' command.")
+(autoload 'pcomplete/tac "pcmpl-unix" "\
+Completion for the `tac' command.")
+(autoload 'pcomplete/nl "pcmpl-unix" "\
+Completion for the `nl' command.")
+(autoload 'pcomplete/od "pcmpl-unix" "\
+Completion for the `od' command.")
+(autoload 'pcomplete/base32 "pcmpl-unix" "\
+Completion for the `base32' and `base64' commands.")
+(defalias 'pcomplete/base64 'pcomplete/base32)
+(autoload 'pcomplete/basenc "pcmpl-unix" "\
+Completion for the `basenc' command.")
+(autoload 'pcomplete/fmt "pcmpl-unix" "\
+Completion for the `fmt' command.")
+(autoload 'pcomplete/pr "pcmpl-unix" "\
+Completion for the `pr' command.")
+(autoload 'pcomplete/fold "pcmpl-unix" "\
+Completion for the `fold' command.")
+(autoload 'pcomplete/head "pcmpl-unix" "\
+Completion for the `head' command.")
+(autoload 'pcomplete/tail "pcmpl-unix" "\
+Completion for the `tail' command.")
+(autoload 'pcomplete/split "pcmpl-unix" "\
+Completion for the `split' command.")
+(autoload 'pcomplete/csplit "pcmpl-unix" "\
+Completion for the `csplit' command.")
+(autoload 'pcomplete/wc "pcmpl-unix" "\
+Completion for the `wc' command.")
+(autoload 'pcomplete/sum "pcmpl-unix" "\
+Completion for the `sum' command.")
+(autoload 'pcomplete/cksum "pcmpl-unix" "\
+Completion for the `cksum' command.")
+(autoload 'pcomplete/b2sum "pcmpl-unix" "\
+Completion for the `b2sum' command.")
+(autoload 'pcomplete/md5sum "pcmpl-unix" "\
+Completion for checksum commands.")
+(defalias 'pcomplete/sha1sum 'pcomplete/md5sum)
+(defalias 'pcomplete/sha224sum 'pcomplete/md5sum)
+(defalias 'pcomplete/sha256sum 'pcomplete/md5sum)
+(defalias 'pcomplete/sha384sum 'pcomplete/md5sum)
+(defalias 'pcomplete/sha521sum 'pcomplete/md5sum)
+(autoload 'pcomplete/sort "pcmpl-unix" "\
+Completion for the `sort' command.")
+(autoload 'pcomplete/shuf "pcmpl-unix" "\
+Completion for the `shuf' command.")
+(autoload 'pcomplete/uniq "pcmpl-unix" "\
+Completion for the `uniq' command.")
+(autoload 'pcomplete/comm "pcmpl-unix" "\
+Completion for the `comm' command.")
+(autoload 'pcomplete/ptx "pcmpl-unix" "\
+Completion for the `ptx' command.")
+(autoload 'pcomplete/tsort "pcmpl-unix" "\
+Completion for the `tsort' command.")
+(autoload 'pcomplete/cut "pcmpl-unix" "\
+Completion for the `cut' command.")
+(autoload 'pcomplete/paste "pcmpl-unix" "\
+Completion for the `paste' command.")
+(autoload 'pcomplete/join "pcmpl-unix" "\
+Completion for the `join' command.")
+(autoload 'pcomplete/tr "pcmpl-unix" "\
+Completion for the `tr' command.")
+(autoload 'pcomplete/expand "pcmpl-unix" "\
+Completion for the `expand' command.")
+(autoload 'pcomplete/unexpand "pcmpl-unix" "\
+Completion for the `unexpand' command.")
+(autoload 'pcomplete/ls "pcmpl-unix" "\
+Completion for the `ls' command.")
+(defalias 'pcomplete/dir 'pcomplete/ls)
+(defalias 'pcomplete/vdir 'pcomplete/ls)
+(autoload 'pcomplete/cp "pcmpl-unix" "\
+Completion for the `cp' command.")
+(autoload 'pcomplete/dd "pcmpl-unix" "\
+Completion for the `dd' command.")
+(autoload 'pcomplete/install "pcmpl-unix" "\
+Completion for the `install' command.")
+(autoload 'pcomplete/mv "pcmpl-unix" "\
+Completion for the `mv' command.")
+(autoload 'pcomplete/shred "pcmpl-unix" "\
+Completion for the `shred' command.")
+(autoload 'pcomplete/ln "pcmpl-unix" "\
+Completion for the `ln' command.")
+(autoload 'pcomplete/mkdir "pcmpl-unix" "\
+Completion for the `mkdir' command.")
+(autoload 'pcomplete/mkfifo "pcmpl-unix" "\
+Completion for the `mkfifo' command.")
+(autoload 'pcomplete/mknod "pcmpl-unix" "\
+Completion for the `mknod' command.")
+(autoload 'pcomplete/readlink "pcmpl-unix" "\
+Completion for the `readlink' command.")
(autoload 'pcomplete/chown "pcmpl-unix" "\
Completion for the `chown' command.")
(autoload 'pcomplete/chgrp "pcmpl-unix" "\
Completion for the `chgrp' command.")
+(autoload 'pcomplete/chmod "pcmpl-unix" "\
+Completion for the `chmod' command.")
+(autoload 'pcomplete/touch "pcmpl-unix" "\
+Completion for the `touch' command.")
+(autoload 'pcomplete/df "pcmpl-unix" "\
+Completion for the `df' command.")
+(autoload 'pcomplete/du "pcmpl-unix" "\
+Completion for the `du' command.")
+(autoload 'pcomplete/stat "pcmpl-unix" "\
+Completion for the `stat' command.")
+(autoload 'pcomplete/sync "pcmpl-unix" "\
+Completion for the `sync' command.")
+(autoload 'pcomplete/truncate "pcmpl-unix" "\
+Completion for the `truncate' command.")
+(autoload 'pcomplete/echo "pcmpl-unix" "\
+Completion for the `echo' command.")
+(autoload 'pcomplete/test "pcmpl-unix" "\
+Completion for the `test' command.")
+(defalias (intern "pcomplete/[") 'pcomplete/test)
+(autoload 'pcomplete/tee "pcmpl-unix" "\
+Completion for the `tee' command.")
+(autoload 'pcomplete/basename "pcmpl-unix" "\
+Completion for the `basename' command.")
+(autoload 'pcomplete/dirname "pcmpl-unix" "\
+Completion for the `dirname' command.")
+(autoload 'pcomplete/pathchk "pcmpl-unix" "\
+Completion for the `pathchk' command.")
+(autoload 'pcomplete/mktemp "pcmpl-unix" "\
+Completion for the `mktemp' command.")
+(autoload 'pcomplete/realpath "pcmpl-unix" "\
+Completion for the `realpath' command.")
+(autoload 'pcomplete/id "pcmpl-unix" "\
+Completion for the `id' command.")
+(autoload 'pcomplete/groups "pcmpl-unix" "\
+Completion for the `groups' command.")
+(autoload 'pcomplete/who "pcmpl-unix" "\
+Completion for the `who' command.")
+(autoload 'pcomplete/date "pcmpl-unix" "\
+Completion for the `date' command.")
+(autoload 'pcomplete/nproc "pcmpl-unix" "\
+Completion for the `nproc' command.")
+(autoload 'pcomplete/uname "pcmpl-unix" "\
+Completion for the `uname' command.")
+(autoload 'pcomplete/hostname "pcmpl-unix" "\
+Completion for the `hostname' command.")
+(autoload 'pcomplete/uptime "pcmpl-unix" "\
+Completion for the `uptime' command.")
+(autoload 'pcomplete/chcon "pcmpl-unix" "\
+Completion for the `chcon' command.")
+(autoload 'pcomplete/runcon "pcmpl-unix" "\
+Completion for the `runcon' command.")
+(autoload 'pcomplete/chroot "pcmpl-unix" "\
+Completion for the `chroot' command.")
+(autoload 'pcomplete/env "pcmpl-unix" "\
+Completion for the `env' command.")
+(autoload 'pcomplete/nice "pcmpl-unix" "\
+Completion for the `nice' command.")
+(autoload 'pcomplete/nohup "pcmpl-unix" "\
+Completion for the `nohup' command.")
+(autoload 'pcomplete/stdbuf "pcmpl-unix" "\
+Completion for the `stdbuf' command.")
+(autoload 'pcomplete/timeout "pcmpl-unix" "\
+Completion for the `timeout' command.")
+(autoload 'pcomplete/numfmt "pcmpl-unix" "\
+Completion for the `numfmt' command.")
+(autoload 'pcomplete/seq "pcmpl-unix" "\
+Completion for the `seq' command.")
(autoload 'pcomplete/ssh "pcmpl-unix" "\
Completion rules for the `ssh' command.")
(defalias 'pcomplete/rsh #'pcomplete/ssh)
@@ -23341,13 +23523,25 @@ Completion rules for the `ssh' command.")
Completion rules for the `scp' command.
Includes files as well as host names followed by a colon.")
(autoload 'pcomplete/telnet "pcmpl-unix")
+(autoload 'pcomplete/sudo "pcmpl-unix" "\
+Completion for the `sudo' command.")
(register-definition-prefixes "pcmpl-unix" '("pcmpl-" "pcomplete/"))
;;; Generated autoloads from pcmpl-x.el
+(autoload 'pcomplete/tex "pcmpl-x" "\
+Completion for the `tex' command.")
+(defalias 'pcomplete/pdftex 'pcomplete/tex)
+(defalias 'pcomplete/latex 'pcomplete/tex)
+(defalias 'pcomplete/pdflatex 'pcomplete/tex)
+(autoload 'pcomplete/luatex "pcmpl-x" "\
+Completion for the `luatex' command.")
+(defalias 'pcomplete/lualatex 'pcomplete/luatex)
(autoload 'pcomplete/tlmgr "pcmpl-x" "\
Completion for the `tlmgr' command.")
+(autoload 'pcomplete/rg "pcmpl-x" "\
+Completion for the `rg' command.")
(autoload 'pcomplete/ack "pcmpl-x" "\
Completion for the `ack' command.
Start an argument with `-' to complete short options and `--' for
@@ -23358,6 +23552,8 @@ Completion for the `ag' command.")
(autoload 'pcomplete/bcc32 "pcmpl-x" "\
Completion function for Borland's C++ compiler.")
(defalias 'pcomplete/bcc 'pcomplete/bcc32)
+(autoload 'pcomplete/rclone "pcmpl-x" "\
+Completion for the `rclone' command.")
(register-definition-prefixes "pcmpl-x" '("pcmpl-x-"))
@@ -33558,11 +33754,7 @@ case, and the process object in the asynchronous case.
;;; Generated autoloads from vc/vc-git.el
-(defun vc-git-annotate-switches-safe-p (switches) "\
-Check if local value of `vc-git-annotate-switches' is safe.
-Currently only \"-w\" (ignore whitespace) is considered safe, but
-this list might be extended in the future." (equal switches "-w"))
-(put 'vc-git-annotate-switches 'safe-local-variable #'vc-git-annotate-switches-safe-p)
+(put 'vc-git-annotate-switches 'safe-local-variable (lambda (switches) (equal switches "-w")))
(defun vc-git-registered (file)
"Return non-nil if FILE is registered with git."
(if (vc-find-root file ".git") ; Short cut.
From e485734151ca3741ecf03e27aae2384fc7ace461 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Fri, 16 Sep 2022 14:23:41 +0300
Subject: [PATCH 415/915] ; * lisp/image/image-crop.el (image-cut): Doc fix.
---
lisp/image/image-crop.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el
index 682fce39866..8b6694f2231 100644
--- a/lisp/image/image-crop.el
+++ b/lisp/image/image-crop.el
@@ -105,9 +105,9 @@ image data.")
;;;###autoload
(defun image-cut (&optional color)
- "Cut a rectangle from the image under point.
-Interactively, if given a prefix, prompt for COLOR to use.
-Otherwise, default to `image-cut-color'."
+ "Cut a rectangle from the image under point, filling it with COLOR.
+COLOR defaults to the value of `image-cut-color'.
+Interactively, with prefix argument, prompt for COLOR to use."
(interactive (list (and current-prefix-arg (read-color "Use color: "))))
(image-crop (if (zerop (length color)) image-cut-color color)))
From e3fa41ac9217cc0a4dd83676c349786290e6fa09 Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Fri, 16 Sep 2022 13:38:01 +0200
Subject: [PATCH 416/915] Fix *Help* output for native-comp functions from IELM
* lisp/help-fns.el (find-lisp-object-file-name): Don't claim that
native-comp functions that are defined outside of files (for
instance, created by calling `native-compile' in IELM) are in C
source (bug#57819).
---
lisp/help-fns.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index a3d4e002b6f..2bb3e63487c 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -457,7 +457,9 @@ the C sources, too."
load-path '(".el" ".elc") 'readable))))))))
(cond
- ((and (not file-name) (subrp type))
+ ((and (not file-name)
+ (subrp type)
+ (not (subr-native-elisp-p type)))
;; A built-in function. The form is from `describe-function-1'.
(if (or (get-buffer " *DOC*")
(and also-c-source
From 19de241a7dc193c0d0423019824627adb28f8944 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Fri, 16 Sep 2022 13:59:51 +0200
Subject: [PATCH 417/915] Recommend NonGNU ELPA over MELPA
* doc/misc/org.org (Using CDLaTeX to enter math, Footnotes): Recommend
NonGNU ELPA over MELPA.
---
doc/misc/org.org | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/misc/org.org b/doc/misc/org.org
index 9f69c684318..16cddbc3c9f 100644
--- a/doc/misc/org.org
+++ b/doc/misc/org.org
@@ -11042,7 +11042,7 @@ a major LaTeX mode like AUCTeX in order to speed-up insertion of
environments and math templates. Inside Org mode, you can make use of
some of the features of CDLaTeX mode. You need to install
=cdlatex.el= and =texmathp.el= (the latter comes also with AUCTeX)
-using [[https://melpa.org/][MELPA]] with the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html][Emacs packaging system]] or alternatively from
+from [[https://elpa.nongnu.org/][NonGNU ELPA]] with the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html][Emacs packaging system]] or alternatively from
[[https://staff.fnwi.uva.nl/c.dominik/Tools/cdlatex/]]. Do not use
CDLaTeX mode itself under Org mode, but use the special version Org
CDLaTeX minor mode that comes as part of Org. Turn it on for the
@@ -22024,7 +22024,7 @@ a deadline string. See ~org-agenda-entry-types~ on how to set what
planning information is taken into account.
[fn:104] For HTML you need to install Hrvoje Nikšić's =htmlize.el=
-as an Emacs package from MELPA or from [[https://github.com/hniksic/emacs-htmlize][Hrvoje Nikšić's repository]].
+as an Emacs package from [[https://elpa.nongnu.org/][NonGNU ELPA]] or from [[https://github.com/hniksic/emacs-htmlize][Hrvoje Nikšić's repository]].
[fn:105] To create PDF output, the Ghostscript ps2pdf utility must be
installed on the system. Selecting a PDF file also creates the
From 838e6cae81392139377dd8b78b52ff3aaeba2fc1 Mon Sep 17 00:00:00 2001
From: Michael Albinus
Date: Fri, 16 Sep 2022 15:07:08 +0200
Subject: [PATCH 418/915] ; * etc/NEWS: Fix typos.
---
etc/NEWS | 43 ++++++++++++++++++++++---------------------
1 file changed, 22 insertions(+), 21 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index 9036e4ee019..df09533c0b9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -107,7 +107,7 @@ as was already the case for all the non-preloaded files.
** Emacs Sessions (Desktop)
+++
-*** New option to load a locked desktop if locking Emacs is not running.
+*** New user option to load a locked desktop if locking Emacs is not running.
The option 'desktop-load-locked-desktop' can now be set to the value
'check-pid', which means to allow loading a locked ".emacs.desktop"
file if the Emacs process which locked it is no longer running on the
@@ -189,7 +189,7 @@ buffers, but not in buffers that inherit from 'special-mode'. To get
back to how things worked in Emacs 28.1, put the following in your
init file:
- (setopt show-paren-predicate t)
+ (setopt show-paren-predicate t)
+++
*** Explicitly-set read-only state is preserved when reverting a buffer.
@@ -1588,7 +1588,7 @@ Non-nil means that the default definitions of equivalent characters
are overridden.
*** New command 'describe-char-fold-equivalences'.
-It displays character equivalences used by `char-fold-to-regexp'.
+It displays character equivalences used by 'char-fold-to-regexp'.
+++
*** New command 'isearch-emoji-by-name'.
@@ -1681,7 +1681,7 @@ consistent with 'vc-responsible-backend'.
---
*** Log Edit now font locks long Git commit summary lines.
Writing shorter summary lines avoids truncation in contexts in which
-Git commands display summary lines. See the two new variables
+Git commands display summary lines. See the two new user options
'vc-git-log-edit-summary-target-len' and 'vc-git-log-edit-summary-max-len'.
** Message
@@ -1951,16 +1951,16 @@ as opposed to via the command-line.
*** New command 'image-transform-fit-to-window'.
This command fits the image to the current window by scaling down or
up as necessary. Unlike 'image-transform-fit-both', this does not
-only scale the image down, but up as well. It is bound to "s w" in
+only scale the image down, but up as well. It is bound to 's w' in
Image Mode by default.
---
*** New command 'image-mode-wallpaper-set'.
This command sets the desktop background to the current image. It is
-bound to "W" by default.
+bound to 'W' by default.
+++
-*** 'image-transform-fit-to-(height|width)' are now obsolete.
+*** 'image-transform-fit-to-{height,width}' are now obsolete.
Use the new command 'image-transform-fit-to-window' instead.
The keybinding for 'image-transform-fit-to-width' is now 's i'.
@@ -1986,7 +1986,7 @@ These commands horizontally and vertically flip the image under point.
+++
*** New command 'image-transform-set-percent'.
It allows setting the image size to a percentage of its original size,
-and is bound to "s p" in Image mode.
+and is bound to 's p' in Image mode.
+++
*** 'image-transform-original' renamed to 'image-transform-reset-to-original'.
@@ -2107,7 +2107,7 @@ now obsolete: 'image-dired-gallery-thumb-image-root-url',
'image-dired-gallery-image-root-url'.
---
-*** 'image-dired-rotate-thumbnail-(left|right)' is now obsolete.
+*** 'image-dired-rotate-thumbnail-{left,right}' are now obsolete.
Instead, use commands 'image-dired-refresh-thumb' to generate a new
thumbnail, or 'image-rotate' to rotate the thumbnail without updating
the thumbnail file.
@@ -2178,9 +2178,9 @@ recently set.
It is bound to the new command 'bookmark-edit-annotation-cancel'.
---
-*** New option 'bookmark-fringe-mark'.
+*** New user option 'bookmark-fringe-mark'.
This option controls the bitmap used to indicate bookmarks in the
-fringe (or 'nil' to disable showing this marker).
+fringe (or nil to disable showing this marker).
** Exif
@@ -2282,7 +2282,7 @@ in the project root directory and is shared among all project buffers.
Without a prefix argument, the kind of shell (buffer-dedicated,
project-dedicated or global) is specified by the new
-'python-shell-dedicated' variable.
+'python-shell-dedicated' user option.
** Ruby Mode
@@ -2308,14 +2308,15 @@ automatically insert the Tramp prefix. The automatic insertion
applies only when 'default-directory' is remote and the command is a
Lisp function. This frees you from having to keep track of whether
commands are Lisp function or external when supplying absolute file
-name arguments. See "Electric forward slash" in the Eshell manual.
+name arguments. See the "(eshell) Electric forward slash" node in the
+Eshell manual for details.
+++
*** Improved support for redirection operators in Eshell.
Eshell now supports a wider variety of redirection operators. For
example, you can now redirect both stdout and stderr via '&>' or
duplicate one output handle to another via 'NEW-FD>&OLD-FD'. For more
-information, see "Redirections" in the Eshell manual.
+information, see the "(eshell) Redirection" node in the Eshell manual.
+++
*** Double-quoting an Eshell expansion now treats the result as a single string.
@@ -2434,7 +2435,7 @@ instead of also trying to ping it. Customize the user option
*** The 'run-dig' command is now obsolete; use 'dig' instead.
---
-*** Some `bib-mode' commands and variables have been renamed.
+*** Some 'bib-mode' commands and variables have been renamed.
To respect Emacs naming conventions, the variable 'unread-bib-file'
has been renamed to 'bib-unread-file'. The following commands have
also been renamed:
@@ -2468,15 +2469,15 @@ name.
These commands allow interactively cropping/cutting the image at
point. The commands are bound to keys 'c' and 'x' (respectively) in
the local keymap over images. They rely on external programs, by
-default 'convert' from ImageMagick, to do the actual cropping/eliding
+default "convert" from ImageMagick, to do the actual cropping/eliding
of the image file.
---
** New package 'wallpaper'.
This package provides the command 'wallpaper-set', which sets the
desktop background image. Depending on the system and the desktop,
-this may require an external program (such as 'swaybg', 'gm',
-'display' or 'xloadimage'). If so, a suitable command should be
+this may require an external program (such as "swaybg", "gm",
+"display" or "xloadimage"). If so, a suitable command should be
detected automatically in most cases. It can also be customized
manually if needed, using the new user options 'wallpaper-command' and
'wallpaper-command-args'.
@@ -2687,7 +2688,7 @@ It's been obsolete since Emacs-22.1, actually.
negative arguments, and is generally slower than 'ash', which should be
used instead. This warning can be suppressed by surrounding calls to
'lsh' with the construct '(with-suppressed-warnings ((suspicious lsh)) ...)',
-but switching to `ash` is generally much preferable.
+but switching to 'ash' is generally much preferable.
---
** Some functions and variables obsolete since Emacs 24 have been removed:
@@ -2837,12 +2838,12 @@ patcomp.el, pc-mode.el, pc-select.el, s-region.el, and sregex.el.
Emacs has a number of rather obscure generalized variables defined,
that, for instance, allowed you to say things like:
- (setf (point-min) 4)
+ (setf (point-min) 4)
These never caught on and have been made obsolete. The form above,
for instance, is the same as saying
- (narrow-to-region 4 (point-max))
+ (narrow-to-region 4 (point-max))
The following generalized variables have been made obsolete:
'buffer-file-name', 'buffer-local-value', 'buffer-modified-p',
From 70ca5f652409ce7a85d1ddbcc16036b4266ec053 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Fri, 16 Sep 2022 15:03:19 +0200
Subject: [PATCH 419/915] ; * etc/NEWS: Fix typos.
---
etc/NEWS | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index 4030589decf..15854be8fd2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -386,7 +386,7 @@ the current buffer and the text "GNU Emacs" instead of the value of
your init file:
(setq frame-title-format '(multiple-frames "%b"
- ("" invocation-name "@" system-name)))
+ ("" invocation-name "@" system-name)))
*** New frame parameter 'drag-with-tab-line'.
This parameter, similar to 'drag-with-header-line', allows moving frames
@@ -3951,7 +3951,6 @@ and enable the MS-Windows native Input Method Editor (IME) at run
time. A companion function 'w32-get-ime-open-status' returns the
current IME activation status.
---
** On macOS, 's-' and 's-' are now bound to
'move-beginning-of-line' and 'move-end-of-line' respectively. The commands
to select previous/next frame are still bound to 's-~' and 's-`'.
From 397890ba77465f71c4ccd38314f30907b78193b8 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Fri, 16 Sep 2022 15:16:43 +0200
Subject: [PATCH 420/915] Delete "etc/NEWS*.html" from .gitignore
We actually do want to see it when preparing a release, so that we
don't include it in a tarball by mistake.
* .gitignore: Don't ignore "etc/NEWS*.html".
---
.gitignore | 1 -
1 file changed, 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index e48e3594269..2254b8a9c8e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -263,7 +263,6 @@ doc/misc/cc-mode.ss
doc/misc/modus-themes.texi
doc/misc/org.texi
etc/DOC
-etc/NEWS*.html
etc/refcards/emacsver.tex
gnustmp*
/info/
From 4da0fbdc82577da0583c8858a52f456beb23fd0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?=
Date: Fri, 16 Sep 2022 15:29:03 +0200
Subject: [PATCH 421/915] Faster and more robust list-of-strings-p
* lisp/subr.el (list-of-strings-p): Speed up by a factor 4 (approx.)
and don't crash on dotted lists.
* test/lisp/subr-tests.el (test-list-of-strings-p): Extend test.
---
lisp/subr.el | 5 +++--
test/lisp/subr-tests.el | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/subr.el b/lisp/subr.el
index e8e8f1584b4..caea2b9f933 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4028,8 +4028,9 @@ Otherwise, return nil."
(defun list-of-strings-p (object)
"Return t if OBJECT is nil or a list of strings."
- (and (listp object)
- (seq-every-p #'stringp object)))
+ (while (and (consp object) (stringp (car object)))
+ (setq object (cdr object)))
+ (null object))
(defun booleanp (object)
"Return t if OBJECT is one of the two canonical boolean values: t or nil.
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index 38966cea585..347981e8185 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -1163,7 +1163,8 @@ final or penultimate step during initialization."))
(should (list-of-strings-p nil))
(should (list-of-strings-p '("a" "b")))
(should-not (list-of-strings-p ["a" "b"]))
- (should-not (list-of-strings-p '("a" nil "b"))))
+ (should-not (list-of-strings-p '("a" nil "b")))
+ (should-not (list-of-strings-p '("a" "b" . "c"))))
(provide 'subr-tests)
;;; subr-tests.el ends here
From ec2dfd110c407038ab1abc7fd713d37ada91edd9 Mon Sep 17 00:00:00 2001
From: Alan Mackenzie
Date: Fri, 16 Sep 2022 13:57:40 +0000
Subject: [PATCH 422/915] cc-fonts.el: Eliminate an Emacs compiler warning
introduced yesterday.
* lisp/progmodes/cc-fonts.el (top level): Introduce a cc-bytecomp-defvar for
font-lock-reference-face.
---
lisp/progmodes/cc-fonts.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index c52f4a8416b..5d80eb58e38 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -99,6 +99,8 @@
(cc-bytecomp-defun c-font-lock-invalid-string)
(cc-bytecomp-defun c-font-lock-fontify-region)
+(cc-bytecomp-defvar font-lock-reference-face) ; For Emacs 29
+
;; Note that font-lock in XEmacs doesn't expand face names as
;; variables, so we have to use the (eval . FORM) in the font lock
@@ -165,9 +167,8 @@
(defconst c-doc-markup-face-name
(if (c-face-name-p 'font-lock-doc-markup-face)
- ;; If it happens to occur in the future. (Well, the more
- ;; pragmatic reason is to get unique faces for the test
- ;; suite.)
+ ;; Exists in Emacs 28+. (For other emacsen, the pragmatic
+ ;; reason is to get unique faces for the test suite.)
'font-lock-doc-markup-face
c-label-face-name))
From d407bdfd01a8fa4a1a20b8b0f1d07629be4ae54f Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Fri, 16 Sep 2022 16:06:09 +0200
Subject: [PATCH 423/915] Add command to delete temporary markers in NEWS
* lisp/textmodes/emacs-news-mode.el
(emacs-news-delete-temporary-markers): New command.
* admin/make-tarball.txt: Update instructions.
---
admin/make-tarball.txt | 11 ++++++-----
lisp/textmodes/emacs-news-mode.el | 11 +++++++++++
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index ad2aacb57a9..9a406b24fa1 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -52,11 +52,12 @@ General steps (for each step, check for possible errors):
./autogen.sh
./configure --with-native-compilation && make
- For a release (as opposed to pretest), delete any left-over "---"
- and "+++" markers from etc/NEWS, as well as the "Temporary note"
- section at the beginning of that file, and commit etc/NEWS if it
- was modified. For a bug fix release (e.g. 28.2), delete any empty
- headlines too.
+ For a release (as opposed to pretest), visit etc/NEWS and use the
+ "M-x emacs-news-delete-temporary-markers" command to delete any
+ left-over "---" and "+++" markers from etc/NEWS, as well as the
+ "Temporary note" section at the beginning of that file, and commit
+ etc/NEWS if it was modified. For a bug fix release (e.g. 28.2),
+ delete any empty headlines too.
2. Regenerate the versioned ChangeLog.N and etc/AUTHORS files.
diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el
index 6bf96deaccb..88e89480609 100644
--- a/lisp/textmodes/emacs-news-mode.el
+++ b/lisp/textmodes/emacs-news-mode.el
@@ -276,6 +276,17 @@ documentation marks on the previous line."
(forward-line -1))
(open-line n))
+(defun emacs-news-delete-temporary-markers ()
+ "Delete any temporary markers.
+This is used when preparing a new release of Emacs."
+ (interactive nil emacs-news-mode)
+ (goto-char (point-min))
+ (re-search-forward "^Temporary note:$")
+ (forward-line -1)
+ (delete-region (point) (save-excursion (forward-paragraph) (point)))
+ (while (re-search-forward (rx bol (or "+++" "---") eol) nil t)
+ (delete-line)))
+
(provide 'emacs-news-mode)
;;; emacs-news-mode.el ends here
From 01ad2a4a926ba56ce370db9e368e72cf824026e5 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Fri, 16 Sep 2022 16:10:26 +0200
Subject: [PATCH 424/915] ; * etc/NEWS.28: Fix merge of NEWS.28.
---
etc/NEWS.28 | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/etc/NEWS.28 b/etc/NEWS.28
index 1e8bd499b68..5f3626eeeb0 100644
--- a/etc/NEWS.28
+++ b/etc/NEWS.28
@@ -15,6 +15,33 @@ in older Emacs versions.
You can narrow news to a specific version by calling 'view-emacs-news'
with a prefix argument or by typing 'C-u C-h C-n'.
+
+* Installation Changes in Emacs 28.3
+
+
+* Startup Changes in Emacs 28.3
+
+
+* Changes in Emacs 28.3
+
+
+* Editing Changes in Emacs 28.3
+
+
+* Changes in Specialized Modes and Packages in Emacs 28.3
+
+
+* New Modes and Packages in Emacs 28.3
+
+
+* Incompatible Lisp Changes in Emacs 28.3
+
+
+* Lisp Changes in Emacs 28.3
+
+
+* Changes in Emacs 28.3 on Non-Free Operating Systems
+
* Installation Changes in Emacs 28.2
@@ -3257,12 +3284,13 @@ completing on commands from buffers in major modes derived from
MODE..., or, if it's a minor mode, when that minor mode is enabled in
the current buffer.
-Note that these forms will only have their effect if the
+Note that these forms will only have their effect for 'M-x' if the
'read-extended-command-predicate' user option is customized to call
'command-completion-default-include-p' or a similar function. The
default value of 'read-extended-command-predicate' is nil, which means
no commands that match what you have typed are excluded from being
-completion candidates.
+completion candidates. The forms will, however, be used by 'M-S-x' by
+default.
** 'define-minor-mode' now takes an ':interactive' argument.
This can be used for specifying which modes this minor mode is meant
From f232d989fd90dc35b647da9db152d70b421f35a9 Mon Sep 17 00:00:00 2001
From: Stefan Kangas
Date: Fri, 16 Sep 2022 14:17:14 +0200
Subject: [PATCH 425/915] Improve HTML export of NEWS file
* admin/admin.el (admin--org-export-headers-format)
(admin--org-html-postamble): New variables.
(admin--require-external-package): New function.
(make-news-html-file): Improve HTML export.
---
admin/admin.el | 211 ++++++++++++++++++++++++++++++-------------------
1 file changed, 130 insertions(+), 81 deletions(-)
diff --git a/admin/admin.el b/admin/admin.el
index 12e6fcb7f8c..60b043a3516 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -770,69 +770,13 @@ Optional argument TYPE is type of output (nil means all)."
(if (member type (list nil m))
(make-manuals-dist--1 root m))))
-(defun make-news-html-file (root version)
- "Convert the NEWS file into an HTML file."
- (interactive (let ((root
- (if noninteractive
- (or (pop command-line-args-left)
- default-directory)
- (read-directory-name "Emacs root directory: "
- source-directory nil t))))
- (list root
- (read-string "Version number: " emacs-version))))
- (unless (file-exists-p (expand-file-name "src/emacs.c" root))
- (user-error "%s doesn't seem to be the root of an Emacs source tree" root))
- (let* ((dir (make-temp-file "emacs-news-file" t))
- (orig (expand-file-name "etc/NEWS" root))
- (new (expand-file-name (format "NEWS.%s.org" version) dir))
- (html-file (format "%s.html" (file-name-base new)))
- (copyright-years (format-time-string "%Y")))
- (unwind-protect
- (progn
- (copy-file orig new)
- (find-file new)
-
- ;; Find the copyright range:
- (goto-char (point-min))
- (re-search-forward "^Copyright (C) \\([0-9-]+\\) Free Software Foundation, Inc.")
- (setq copyright-years (match-string 1))
-
- ;; Get rid of some unnecessary stuff:
- (replace-regexp-in-region "^---$" "" (point-min) (point-max))
- (replace-regexp-in-region "^\\+\\+\\+$" "" (point-min) (point-max))
- (dolist (str '("\n"
- "GNU Emacs NEWS -- history of user-visible changes."
- "Temporary note:"
- "+++ indicates that all relevant manuals in doc/ have been updated."
- "--- means no change in the manuals is needed."
- "When you add a new item, use the appropriate mark if you are sure it"
- "applies, and please also update docstrings as needed."
- "You can narrow news to a specific version by calling 'view-emacs-news'"
- "with a prefix argument or by typing 'C-u C-h C-n'."))
- (replace-string-in-region str "" (point-min) (point-max)))
-
- ;; Use Org-mode markers for .
- (replace-regexp-in-region
- ;; This could probably be improved quite a bit...
- (rx "'" (group (+ (not (any "'\n")))) "'")
- "~\\1~" (point-min) (point-max))
-
- ;; Format Emacs Lisp.
- (while (re-search-forward "^ " nil t)
- (backward-paragraph)
- (insert "\n#+begin_src emacs-lisp")
- (forward-paragraph)
- (insert "#+end_src\n"))
-
- ;; Insert Org-mode export headers.
- (goto-char (point-min))
- (insert (format
- "\
+(defvar admin--org-export-headers-format "\
#+title: GNU Emacs %s NEWS -- history of user-visible changes
#+author:
-#+options: author:nil creator:nil toc:1 num:2 *:nil \\n:nil
+#+options: author:nil creator:nil toc:1 num:2 *:nil \\n:t ^:nil tex:nil
#+language: en
-#+HTML_LINK_HOME: https://www.gnu.org/software/emacs
+#+HTML_LINK_HOME: /software/emacs
+#+HTML_LINK_UP: /software/emacs
#+html_head_extra:
#+html_head_extra:
#+html_head_extra:
@@ -844,12 +788,9 @@ Optional argument TYPE is type of output (nil means all)."
of a GNU] \" width=\"129\" height=\"122\"/>
-#+END_EXPORT\n\n"
- version))
- (org-mode)
- (let ((org-html-postamble
- (format
- "
+#+END_EXPORT\n\n")
+
+(defvar admin--org-html-postamble "