commit 520a703fa7db07ba82661e68cf4eafe7ba61a8d0 (HEAD, refs/remotes/origin/master) Merge: 8bdea76720 c086358574 Author: Stefan Kangas Date: Sun Dec 5 06:30:35 2021 +0100 Merge from origin/emacs-28 c086358574 Update to Org 9.5.1-15-gdb4805 fef3e60061 * lisp/emacs-lisp/edebug.el (edebug-eval-defun): Minor doc... a1e30e4106 ; Fix most remaining AUTHORS warnings f3e6a432c5 ; * doc/misc/efaq.texi (New in Emacs 28): Add more news. 00236cc802 Fix the enumeration values returned by 'try_scrolling' commit 8bdea767208257599f6ab727e51dd94f0c1872e1 Author: Lars Ingebrigtsen Date: Sun Dec 5 04:20:55 2021 +0100 Remove hack from seq-tests.el for broken `with-suppressed-warnings' * test/lisp/emacs-lisp/seq-tests.el: `with-suppressed-warnings' now works better in erf-deftests, so remove hack that works around it (bug#36568). diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el index 8cfa3bdb86..4b940af81f 100644 --- a/test/lisp/emacs-lisp/seq-tests.el +++ b/test/lisp/emacs-lisp/seq-tests.el @@ -172,23 +172,19 @@ Evaluate BODY for each created sequence. (should-not (seq-find #'null '(1 2 3))) (should (seq-find #'null '(1 2 3) 'sentinel))) -;; Hack to work around the ERT limitation that we can't reliably use -;; `with-suppressed-warnings' inside an `ert-deftest'. (Bug#36568) -(defun seq--contains (&rest args) - (with-suppressed-warnings ((obsolete seq-contains)) - (apply #'seq-contains args))) - (ert-deftest test-seq-contains () - (with-test-sequences (seq '(3 4 5 6)) - (should (seq--contains seq 3)) - (should-not (seq--contains seq 7))) - (with-test-sequences (seq '()) - (should-not (seq--contains seq 3)) - (should-not (seq--contains seq nil)))) + (with-suppressed-warnings ((obsolete seq-contains)) + (with-test-sequences (seq '(3 4 5 6)) + (should (seq-contains seq 3)) + (should-not (seq-contains seq 7))) + (with-test-sequences (seq '()) + (should-not (seq-contains seq 3)) + (should-not (seq-contains seq nil))))) (ert-deftest test-seq-contains-should-return-the-elt () - (with-test-sequences (seq '(3 4 5 6)) - (should (= 5 (seq--contains seq 5))))) + (with-suppressed-warnings ((obsolete seq-contains)) + (with-test-sequences (seq '(3 4 5 6)) + (should (= 5 (seq-contains seq 5)))))) (ert-deftest test-seq-contains-p () (with-test-sequences (seq '(3 4 5 6)) commit 7842a606b76dfabd1540da1c130728064e8f02ed Author: Lars Ingebrigtsen Date: Sun Dec 5 04:12:55 2021 +0100 Improve before-make-frame-hook and after-make-frame-functions docs * lisp/frame.el (before-make-frame-hook): (after-make-frame-functions): Note when the functions are run. diff --git a/lisp/frame.el b/lisp/frame.el index 1319759e74..bc08649504 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -808,12 +808,19 @@ also select the new frame." new-frame)) (defvar before-make-frame-hook nil - "Functions to run before `make-frame' creates a new frame.") + "Functions to run before `make-frame' creates a new frame. +Note that these functions are usually not run for the initial +frame, except when the initial frame is created from an Emacs +daemon.") (defvar after-make-frame-functions nil "Functions to run after `make-frame' created a new frame. The functions are run with one argument, the newly created -frame.") +frame. + +Note that these functions are usually not run for the initial +frame, except when the initial frame is created from an Emacs +daemon.") (defvar after-setting-font-hook nil "Functions to run after a frame's font has been changed.") commit 5d7eb2979bc7eec01cff7e7908dbbd3edb38ea0c Author: Lars Ingebrigtsen Date: Sun Dec 5 04:09:33 2021 +0100 Clarify Creating Frames documentation * doc/lispref/frames.texi (Creating Frames): Remove misleading explanation -- even if the hooks are set, they won't be run (bug#38143). diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 923ff19997..95360d4bdd 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -167,11 +167,10 @@ argument, the frame just created. @end defvar Note that any functions added to these hooks by your initial file are -usually not run for the initial frame, since Emacs reads the initial -file only after creating that frame. However, if the initial frame is -specified to use a separate minibuffer frame (@pxref{Minibuffers and -Frames}), the functions will be run for both, the minibuffer-less and -the minibuffer frame. +usually not run for the initial frame. However, if the initial frame +is specified to use a separate minibuffer frame (@pxref{Minibuffers +and Frames}), the functions will be run for both, the minibuffer-less +and the minibuffer frame. @defvar frame-inherited-parameters This variable specifies the list of frame parameters that a newly commit c086358574e3671787394c7b9f6069760e7c6b3c (refs/remotes/origin/emacs-28) Author: Kyle Meyer Date: Sat Dec 4 21:27:59 2021 -0500 Update to Org 9.5.1-15-gdb4805 diff --git a/doc/misc/org.org b/doc/misc/org.org index 85117714ee..adf24da1c3 100644 --- a/doc/misc/org.org +++ b/doc/misc/org.org @@ -15571,7 +15571,7 @@ for usage and configuration details. :DESCRIPTION: Fine-tuning the export output. :END: -*** Hooks +*** Export hooks :PROPERTIES: :UNNUMBERED: notoc :END: @@ -18203,7 +18203,7 @@ expanded anyway. #+kindex: C-c C-v f Choose a file to tangle. Bound to {{{kbd(C-c C-v f)}}}. -*** Hooks +*** Tangle hooks :PROPERTIES: :UNNUMBERED: notoc :END: diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 212069e668..de75519ec6 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made." (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.5.1-11-g96d91b")) + (let ((org-git-version "release_9.5.1-15-gdb4805")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el index 3e3967033a..c45dc98a09 100644 --- a/lisp/org/ox-latex.el +++ b/lisp/org/ox-latex.el @@ -3706,7 +3706,7 @@ Return PDF file's name." (let ((outfile (org-export-output-file-name ".tex" subtreep))) (org-export-to-file 'latex outfile async subtreep visible-only body-only ext-plist - (lambda (file) (org-latex-compile file))))) + #'org-latex-compile))) (defun org-latex-compile (texfile &optional snippet) "Compile a TeX file. commit 133f9a7e940e9696d998284b264dfa6430932c3e Author: Po Lu Date: Sun Dec 5 09:59:45 2021 +0800 Fix tty mouse wheel on window systems other than X * lisp/mwheel.el (mouse-wheel-down-alternate-event) (mouse-wheel-up-alternate-event) (mouse-wheel-left-alternate-event) (mouse-wheel-right-alternate-event): Set appropriately for non-X systems. diff --git a/lisp/mwheel.el b/lisp/mwheel.el index 6a853a3521..9d303b7ee3 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -65,7 +65,10 @@ :set 'mouse-wheel-change-button) (defcustom mouse-wheel-down-alternate-event - (when (featurep 'xinput2) 'wheel-up) + (if (featurep 'xinput2) + 'wheel-up + (unless (featurep 'x) + 'mouse-4)) "Alternative wheel down event to consider." :group 'mouse :type 'symbol @@ -83,7 +86,10 @@ :set 'mouse-wheel-change-button) (defcustom mouse-wheel-up-alternate-event - (when (featurep 'xinput2) 'wheel-down) + (if (featurep 'xinput2) + 'wheel-down + (unless (featurep 'x) + 'mouse-5)) "Alternative wheel up event to consider." :group 'mouse :type 'symbol @@ -246,7 +252,10 @@ Also see `mouse-wheel-tilt-scroll'." "Event used for scrolling left.") (defvar mouse-wheel-left-alternate-event - (when (featurep 'xinput2) 'wheel-left) + (if (featurep 'xinput2) + 'wheel-left + (unless (featurep 'x) + 'mouse-6)) "Alternative wheel left event to consider.") (defvar mouse-wheel-right-event @@ -257,7 +266,10 @@ Also see `mouse-wheel-tilt-scroll'." "Event used for scrolling right.") (defvar mouse-wheel-right-alternate-event - (when (featurep 'xinput2) 'wheel-right) + (if (featurep 'xinput2) + 'wheel-right + (unless (featurep 'x) + 'mouse-7)) "Alternative wheel right event to consider.") (defun mouse-wheel--get-scroll-window (event) commit 5404973916dc5d0b92604d31ad7dca2358bc5b9a Author: Lars Ingebrigtsen Date: Sun Dec 5 02:57:43 2021 +0100 Make help--describe-command more robust * lisp/help.el (help--describe-command): `help-function' buttons are defined in help-mode.el, so it might not exist yet when calling `documentation' directly (bug#52291). diff --git a/lisp/help.el b/lisp/help.el index adb2bd87a9..eb0a782227 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1353,7 +1353,8 @@ Return nil if the key sequence is too long." (defun help--describe-command (definition &optional translation) (cond ((symbolp definition) - (if (fboundp definition) + (if (and (fboundp definition) + help-buffer-under-preparation) (insert-text-button (symbol-name definition) 'type 'help-function 'help-args (list definition)) commit d3b4f838b981853dba7759ff9b9bd2d8b8e04c42 Author: Christer Enfors Date: Sun Dec 5 02:44:35 2021 +0100 Add IRC introduction to the ERC manual * doc/misc/erc.texi (Getting Started): Mention libera.char (bug#52287). (Introduction): Explain what IRC is. Copyright-paperwork-exempt: yes diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 49ad795c32..6631d8420f 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -87,6 +87,28 @@ Advanced Usage @node Introduction @chapter Introduction +IRC is short for Internet Relay Chat. When using IRC, you can +communicate with other users on the same IRC network. There are +several of these networks available---if you search for ``IRC +networks'' in your favorite search engine, you are likely to find +up-to-date lists of IRC networks catering to various interests and +topics. + +In order to use IRC, you need an IRC client such as ERC. Using the +client, you connect to an IRC server. Once you've done that, you will +have access to all available channels on that server's network. A +channel is basically a chat room, and what you type in a channel will +be shown to all other users in that channel, and you can be in several +channels at the same time---most clients will show each channel in its +own window. IRC channel names always begin with a @samp{#} character. +For example, the Emacs channel on Libera.Chat is @samp{#emacs}, and +the ERC channel is @samp{#erc}. Do not confuse them with the hashtags +used on many social media platforms. + +It is also possible to send private messages to other IRC +users on the same network, regardless of whether or not they are in +the same channel as you. + ERC is a powerful, modular, and extensible IRC client for Emacs. It is distributed with Emacs since version 22.1. @@ -114,7 +136,11 @@ It comes with the following capabilities enabled by default. @cindex settings The command @kbd{M-x erc} will start ERC and prompt for the server to -connect to. +connect to. If you're unsure of which server or network to connect +to, we suggest you start with ``irc.libera.chat''. There you will +find the @samp{#emacs} channels where you can chat with other Emacs +and users, and if you're having trouble with ERC, you can join the +@samp{#erc} channel and ask for help there. If you want to place ERC settings in their own file, you can place them in @file{~/.emacs.d/.ercrc.el}, creating it if necessary. commit 643eee8b1bf0bcacf6030f58bcaf161e5a3d5ab6 Author: Po Lu Date: Sun Dec 5 09:44:06 2021 +0800 Make pixel scrolling through images less jumpy * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down-page): Improve detection of situations where vscroll must directly be set. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index ce2aee6c45..5d6836ca68 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -411,23 +411,23 @@ the height of the current window." (object (posn-object desired-pos)) (desired-start (posn-point desired-pos)) (desired-vscroll (cdr (posn-object-x-y desired-pos))) + (edges (window-edges nil t)) + (usable-height (- (nth 3 edges) + (nth 1 edges))) (next-pos (save-excursion (goto-char desired-start) (when (zerop (vertical-motion (1+ scroll-margin))) (signal 'end-of-buffer nil)) - (point)))) - (if (and (< (point) next-pos) - (let ((pos-visibility (pos-visible-in-window-p next-pos nil t))) - (and pos-visibility - (or (eq (length pos-visibility) 2) - (when-let* ((posn (posn-at-point next-pos)) - (edges (window-edges nil t)) - (usable-height (- (nth 3 edges) - (nth 1 edges)))) - (> (cdr (posn-object-width-height posn)) - usable-height)))))) - (goto-char next-pos)) - (if (or (consp object) (stringp object)) + (point))) + (end-pos (posn-at-x-y 0 (+ usable-height + (window-tab-line-height) + (window-header-line-height))))) + (if (or (overlayp object) + (stringp object) + (and (consp object) + (stringp (car object))) + (and (consp (posn-object end-pos)) + (> (cdr (posn-object-x-y end-pos)) 0))) ;; We are either on an overlay or a string, so set vscroll ;; directly. (set-window-vscroll nil (+ (window-vscroll nil t) @@ -441,7 +441,15 @@ the height of the current window." (beginning-of-visual-line) (point))) t)) - (set-window-vscroll nil desired-vscroll t)))) + (set-window-vscroll nil desired-vscroll t)) + (if (and (or (< (point) next-pos)) + (let ((pos-visibility (pos-visible-in-window-p next-pos nil t))) + (and pos-visibility + (or (eq (length pos-visibility) 2) + (when-let* ((posn (posn-at-point next-pos))) + (> (cdr (posn-object-width-height posn)) + usable-height)))))) + (goto-char next-pos)))) (defun pixel-scroll-precision-scroll-down (delta) "Scroll the current window down by DELTA pixels." commit c585112ac5f60f32d26ccf59100176ff194098ab Author: Earl Hyatt Date: Sun Dec 5 02:41:39 2021 +0100 Update the Info documentation of Eshell's built-in commands * doc/misc/eshell.texi (Built-in commands): Add the remaining built-in Eshell commands to the list of built-ins. Expand some of the descriptions and mention user options affecting command behavior. Sort these commands in alphabetical order (bug#52289). diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index c01ceb5fb9..ef82c889a6 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -271,8 +271,30 @@ Some of the built-in commands have different behavior from their external counterparts, and some have no external counterpart. Most of these will print a usage message when given the @code{--help} option. +In some cases, a built-in command's behavior can be configured via +user settings, some of which are mentioned below. For example, +certain commands have two user settings to allow them to overwrite +files without warning and to ensure that they always prompt before +overwriting files. If both settings are non-@code{nil}, the commands +always prompt. If both settings are @code{nil} (the default), the +commands signal an error. + +Several commands observe the value of +@code{eshell-default-target-is-dot}. If non-@code{nil}, then the +default target for the commands @command{cp}, @command{mv}, and +@command{ln} is the current directory. + +A few commands are wrappers for more niche Emacs features, and can be +loaded as part of the eshell-xtra module. @xref{Extension modules}. + @table @code +@item . +@cmindex . +Source an Eshell file in the current environment. This is not to be +confused with the command @command{source}, which sources a file in a +subshell environment. + @item addpath @cmindex addpath Adds a given path or set of paths to the PATH environment variable, or, @@ -282,26 +304,128 @@ with no arguments, prints the current paths in this variable. @cmindex alias Define an alias (@pxref{Aliases}). This adds it to the aliases file. +@item basename +@cmindex basename +Return a file name without its directory. + +@item cat +@cmindex cat +Concatenate file contents into standard output. If in a pipeline, or +if the file is not a regular file, directory, or symlink, then this +command reverts to the system's definition of @command{cat}. + +@item cd +@cmindex cd +This command changes the current working directory. Usually, it is +invoked as @samp{cd foo} where @file{foo} is the new working directory. +But @command{cd} knows about a few special arguments: + +When it receives no argument at all, it changes to the home directory. + +Giving the command @samp{cd -} changes back to the previous working +directory (this is the same as @samp{cd $-}). + +The command @samp{cd =} shows the directory stack. Each line is +numbered. + +With @samp{cd =foo}, Eshell searches the directory stack for a directory +matching the regular expression @samp{foo} and changes to that +directory. + +With @samp{cd -42}, you can access the directory stack by number. + +If @code{eshell-cd-shows-directory} is non-@code{nil}, @command{cd} +will report the directory it changes to. If +@code{eshell-list-files-after-cd} is non-@code{nil}, then @command{ls} +is called with any remaining arguments after changing directories. + @item clear @cmindex clear -Scrolls the contents of the eshell window out of sight, leaving a blank window. -If provided with an optional non-nil argument, the scrollback contents are -cleared instead. +Scrolls the contents of the Eshell window out of sight, leaving a +blank window. If provided with an optional non-@code{nil} argument, +the scrollback contents are cleared instead. + +@item clear-scrollback +@cmindex clear-scrollback +Clear the scrollback contents of the Eshell window. Unlike the +command @command{clear}, this command deletes content in the Eshell +buffer. + +@item cp +@cmindex cp +Copy a file to a new location or copy multiple files to the same +directory. + +If @code{eshell-cp-overwrite-files} is non-@code{nil}, then +@command{cp} will overwrite files without warning. If +@code{eshell-cp-interactive-query} is non-@code{nil}, then +@command{cp} will ask before overwriting anything. @item date @cmindex date -Similar to, but slightly different from, the GNU Coreutils +Print the current local time as a human-readable string. This command +is similar to, but slightly different from, the GNU Coreutils @command{date} command. @item define @cmindex define -Define a varalias. +Define a variable alias. @xref{Variable Aliases, , , elisp, The Emacs Lisp Reference Manual}. @item diff @cmindex diff -Use Emacs's internal @code{diff} (not to be confused with -@code{ediff}). @xref{Comparing Files, , , emacs, The GNU Emacs Manual}. +Compare files using Emacs's internal @code{diff} (not to be confused +with @code{ediff}). @xref{Comparing Files, , , emacs, The GNU Emacs +Manual}. + +If @code{eshell-plain-diff-behavior} is non-@code{nil}, then this +command does not use Emacs's internal @code{diff}. This is the same +as using @samp{alias diff '*diff $*'}. + +@item dirname +@cmindex dirname +Return the directory component of a file name. + +@item dirs +@cmindex dirs +Prints the directory stack. Directories can be added or removed from +the stack using the commands @command{pushd} and @command{popd}, +respectively. + +@item du +@cmindex du +Summarize disk usage for each file. + +@item echo +@cmindex echo +Echos its input. If @code{eshell-plain-echo-behavior} is +non-@code{nil}, @command{echo} will try to behave more like a plain +shell's @command{echo}. + +@item env +@cmindex env +Prints the current environment variables. Unlike in Bash, this +command does not yet support running commands with a modified +environment. + +@item exit +@cmindex exit +Exit Eshell and save the history. By default, this command kills the +Eshell buffer, but if @code{eshell-kill-on-exit} is @code{nil}, then +the buffer is merely buried instead. + +@item export +@cmindex export +Set environment variables using input like Bash's @command{export}, as +in @samp{export @var{var1}=@var{val1} @var{var2}=@var{val2} @dots{}}. + +@item expr +@cmindex expr +An implementation of @command{expr} using the Calc package. +@xref{Top,,, calc, The GNU Emacs Calculator}. + +This command can be loaded as part of the eshell-xtra module, which is +disabled by default. @item grep @cmindex grep @@ -313,13 +437,35 @@ Use Emacs's internal @code{diff} (not to be confused with @cmindex fgrep @itemx glimpse @cmindex glimpse -The @command{grep} commands are compatible with GNU @command{grep}, but -use Emacs's internal @code{grep} instead. +The @command{grep} commands are compatible with GNU @command{grep}, +but use Emacs's internal @code{grep} instead. +@xref{Grep Searching, , , emacs, The GNU Emacs Manual}. + +If @code{eshell-plain-grep-behavior} is non-@code{nil}, then these +commands do not use Emacs's internal @code{grep}. This is the same as +using @samp{alias grep '*grep $*'}, though this setting applies to all +of the built-in commands for which you would need to create a separate +alias. + +@item history +@cmindex history +Prints Eshell's input history. With a numeric argument @var{N}, this +command prints the @var{N} most recent items in the history. @item info @cmindex info -Same as the external @command{info} command, but uses Emacs's internal -Info reader. +Browse the available Info documentation. This command is the same as +the external @command{info} command, but uses Emacs's internal Info +reader. +@xref{Misc Help, , , emacs, The GNU Emacs Manual}. + +@item intersection +@cmindex intersection +A wrapper around the function @code{cl-intersection}. This command +can be used for comparing lists of strings. + +This command can be loaded as part of the eshell-xtra module, which is +disabled by default. @item jobs @cmindex jobs @@ -337,46 +483,147 @@ Eshell version of @code{list}. Allows you to create a list using Eshell syntax, rather than Elisp syntax. For example, @samp{listify foo bar} and @code{("foo" "bar")} both evaluate to @code{("foo" "bar")}. +@item ln +@cmindex ln +Create links to files. + +If @code{eshell-ln-overwrite-files} is non-@code{nil}, @command{ln} +will overwrite files without warning. If +@code{eshell-ln-interactive-query} is non-@code{nil}, then +@command{ln} will ask before overwriting files. + @item locate @cmindex locate Alias to Emacs's @code{locate} function, which simply runs the external @command{locate} command and parses the results. @xref{Dired and Find, , , emacs, The GNU Emacs Manual}. +If @code{eshell-plain-locate-behavior} is non-@code{nil}, then Emacs's +internal @code{locate} is not used. This is the same as using +@samp{alias locate '*locate $*'}. + +@item ls +@cmindex ls +Lists the contents of directories. + +If @code{eshell-ls-use-colors} is non-@code{nil}, the contents of a +directory is color-coded according to file type and status. These +colors and the regexps used to identify their corresponding files can +be customized via @samp{M-x customize-group RET eshell-ls RET}. + +The user option @code{eshell-ls-date-format} determines how the date +is displayed when using the @option{-l} option. The date is produced +using the function @code{format-time-string}. + +The user option @code{eshell-ls-initial-args} contains a list of +arguments to include with any call to @command{ls}. For example, you +can include the option @option{-h} to always use a more human-readable +format. + +The user option @code{eshell-ls-default-blocksize} determines the +default blocksize used when displaying file sizes with the option +@option{-s}. + @item make @cmindex make Run @command{make} through @code{compile} when run asynchronously (e.g., @samp{make &}). @xref{Compilation, , , emacs, The GNU Emacs Manual}. Otherwise call the external @command{make} command. +@item man +@cmindex man +Display Man pages using the Emacs @code{man} command. +@xref{Man Page, , , emacs, The GNU Emacs Manual}. + +@item mismatch +@cmindex mismatch +A wrapper around the function @code{cl-mismatch}. This command can be +used for comparing lists of strings. + +This command can be loaded as part of the eshell-xtra module, which is +disabled by default. + +@item mkdir +@cmindex mkdir +Make new directories. + +@item mv +@cmindex mv +Move or rename files. + +If @code{eshell-mv-overwrite-files} is non-@code{nil}, @command{mv} +will overwrite files without warning. If +@code{eshell-mv-interactive-query} is non-@code{nil}, @command{mv} +will prompt before overwriting anything. + @item occur @cmindex occur Alias to Emacs's @code{occur}. @xref{Other Repeating Search, , , emacs, The GNU Emacs Manual}. +@item popd +@cmindex popd +Pop a directory from the directory stack and switch to a another place +in the stack. + @item printnl @cmindex printnl Print the arguments separated by newlines. -@item cd -@cmindex cd -This command changes the current working directory. Usually, it is -invoked as @samp{cd foo} where @file{foo} is the new working directory. -But @command{cd} knows about a few special arguments: +@item pushd +@cmindex pushd +Change to a directory and push that directory onto the directory +stack. -When it receives no argument at all, it changes to the home directory. +If @code{eshell-pushd-dunique} is non-@code{nil}, then only unique +directories will be added to the stack. If +@code{eshell-pushd-dextract} is non-@code{nil}, then @samp{pushd ++@var{n}} will pop the @var{n}th directory to the top of the stack. -Giving the command @samp{cd -} changes back to the previous working -directory (this is the same as @samp{cd $-}). +@item pwd +@cmindex pwd +Prints the current working directory. -The command @samp{cd =} shows the directory stack. Each line is -numbered. +@item rm +@cmindex rm +Removes files, buffers, processes, or Emacs Lisp symbols, depending on +the argument. -With @samp{cd =foo}, Eshell searches the directory stack for a directory -matching the regular expression @samp{foo} and changes to that -directory. +If @code{eshell-rm-interactive-query} is non-@code{nil}, @command{rm} +will prompt before removing anything. If +@code{eshell-rm-removes-directories} is non-@code{nil}, then +@command{rm} can also remove directories. Otherwise, @command{rmdir} +is required. -With @samp{cd -42}, you can access the directory stack by number. +@item rmdir +@cmindex rmdir +Removes directories if they are empty. + +@item set-difference +@cmindex set-difference +A wrapper around the function @code{cl-set-difference}. This command +can be used for comparing lists of strings. + +This command can be loaded as part of the eshell-xtra module, which is +disabled by default. + +@item set-exclusive-or +@cmindex set-exclusive-or +A wrapper around the function @code{cl-set-exclusive-or}. This +command can be used for comparing lists of strings. + +This command can be loaded as part of the eshell-xtra module, which is +disabled by default. + +@item setq +@cmindex setq +Set variable values, using the function @code{setq} like a command. + +@item source +@cmindex source +Source an Eshell file in a subshell environment. This is not to be +confused with the command @command{.}, which sources a file in the +current environment. @item su @cmindex su @@ -386,6 +633,48 @@ Uses TRAMP's @command{su} or @command{sudo} method @pxref{Inline methods, , , tr to run a command via @command{su} or @command{sudo}. These commands are in the eshell-tramp module, which is disabled by default. + +@item substitute +@cmindex substitute +A wrapper around the function @code{cl-substitute}. This command can +be used for comparing lists of strings. + +This command can be loaded as part of the eshell-xtra module, which is +disabled by default. + +@item time +@cmindex time +Show the time elapsed during a command's execution. + +@item umask +@cmindex umask +Set or view the default file permissions for newly created files and +directories. + +@item union +@cmindex union +A wrapper around the function @code{cl-union}. This command can be +used for comparing lists of strings. + +This command can be loaded as part of the eshell-xtra module, which is +disabled by default. + +@item unset +@cmindex unset +Unset an environment variable. + +@item wait +@cmindex wait +Wait until a process has successfully completed. + +@item which +@cmindex which +Identify a command and its location. + +@item whoami +@cmindex whoami +Print the current user. This Eshell version of @command{whoami} +supports Tramp. @end table @subsection Built-in variables commit f14a4c377dfa6602e9e159c806656137854a667b Author: Lars Ingebrigtsen Date: Sun Dec 5 02:13:00 2021 +0100 Make package-dir-info more resilient * lisp/emacs-lisp/package.el (package-dir-info): Check that the file exists before using it (bug#41489). diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 08dfe504d2..66bbd631a7 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1181,13 +1181,17 @@ The return result is a `package-desc'." info) (while files (with-temp-buffer - (insert-file-contents (pop files)) - ;; When we find the file with the data, - (when (setq info (ignore-errors (package-buffer-info))) - ;; stop looping, - (setq files nil) - ;; set the 'dir kind, - (setf (package-desc-kind info) 'dir)))) + (let ((file (pop files))) + ;; The file may be a link to a nonexistent file; e.g., a + ;; lock file. + (when (file-exists-p file) + (insert-file-contents file) + ;; When we find the file with the data, + (when (setq info (ignore-errors (package-buffer-info))) + ;; stop looping, + (setq files nil) + ;; set the 'dir kind, + (setf (package-desc-kind info) 'dir)))))) (unless info (error "No .el files with package headers in `%s'" default-directory)) ;; and return the info. commit dbadbb5badb26a006f562374127c180a27c11f70 Author: Lars Ingebrigtsen Date: Sun Dec 5 01:53:31 2021 +0100 Tweak fancy-about-text * lisp/startup.el (fancy-about-text): Mention that Emacs is an editor, because people don't know that (bug#43636). diff --git a/lisp/startup.el b/lisp/startup.el index a57ce3da05..8ea7a5b392 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1636,9 +1636,10 @@ Each element in the list should be a list of strings or pairs `((:face (variable-pitch font-lock-comment-face) "This is " :link ("GNU Emacs" - ,(lambda (_button) (browse-url "https://www.gnu.org/software/emacs/")) + ,(lambda (_button) + (browse-url "https://www.gnu.org/software/emacs/")) "Browse https://www.gnu.org/software/emacs/") - ", one component of the " + ", a text editor and more.\nIt's a component of the " :link ,(lambda () (if (eq system-type 'gnu/linux) commit ab41b1c5541cd0b1a72b1f0358dcbb0c2f60dc3b Author: Lars Ingebrigtsen Date: Sun Dec 5 01:51:12 2021 +0100 Fill Emacs version on about screen * lisp/startup.el (fancy-about-text): Fill the Emacs version, since it's too long these days. diff --git a/lisp/startup.el b/lisp/startup.el index d4bb338fc0..a57ce3da05 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1651,7 +1651,11 @@ Each element in the list should be a list of strings or pairs " operating system.\n" :face (variable-pitch font-lock-builtin-face) "\n" - ,(lambda () (emacs-version)) + ,(lambda () + (with-temp-buffer + (insert (emacs-version)) + (fill-region (point-min) (point-max)) + (buffer-string))) "\n" :face (variable-pitch (:height 0.8)) ,(lambda () emacs-copyright) commit b3505e31d6ce4ea7c2cf1b01b8b7357b1f527bf1 Author: Lars Ingebrigtsen Date: Sat Dec 4 23:47:17 2021 +0100 Further gnus-inews-insert-gcc fixes * lisp/gnus/gnus-msg.el (gnus-inews-insert-gcc): Use a single comma to separate groups, since that's what the splitter expects (bug#52274). diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index bf2d1370eb..c60faa1326 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1748,7 +1748,7 @@ this is a reply." (concat "\"" str "\"") str))) (when groups - (insert ", "))) + (insert ","))) (insert "\n"))))))) (defun gnus-mailing-list-followup-to () commit ae415e79714eecaf2bd32059df9dc223db1adb7d Author: Lars Ingebrigtsen Date: Sat Dec 4 21:44:58 2021 +0100 Avoid having gud bug out if `C-x C-a' has been bound * lisp/progmodes/gdb-mi.el (gud-global-map): Use gud-global-map. * lisp/progmodes/gud.el (gud-global-map): Define a map instead of assuming that `C-x C-a' is undefined (bug#6035). (gud-def): Use the map. diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index cf1d62d369..409ff940d9 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1266,7 +1266,7 @@ Used by Speedbar." :version "22.1") (define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch) -(define-key global-map (vconcat gud-key-prefix "\C-w") 'gud-watch) +(keymap-set gud-global-map "C-w" 'gud-watch) (declare-function tooltip-identifier-from-point "tooltip" (point)) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 9b884c4ff8..d5bd265517 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -90,8 +90,10 @@ pdb (Python), and jdb." "Prefix of all GUD commands valid in C buffers." :type 'key-sequence) -(global-set-key (vconcat gud-key-prefix "\C-l") #'gud-refresh) -;; (define-key ctl-x-map " " 'gud-break); backward compatibility hack +(defvar-keymap gud-global-map + "C-l" #'gud-refresh) + +(global-set-key gud-key-prefix gud-global-map) (defvar gud-marker-filter nil) (put 'gud-marker-filter 'permanent-local t) @@ -433,7 +435,7 @@ we're in the GUD buffer)." ;; Unused lexical warning if cmd does not use "arg". cmd)))) ,(if key `(local-set-key ,(concat "\C-c" key) #',func)) - ,(if key `(global-set-key (vconcat gud-key-prefix ,key) #',func)))) + ,(if key `(define-key gud-global-map ,key #',func)))) ;; Where gud-display-frame should put the debugging arrow; a cons of ;; (filename . line-number). This is set by the marker-filter, which scans commit 2898566fa0db33804cde57a34475e4c32f2f9bf2 Author: Eric Abrahamsen Date: Sat Dec 4 13:41:23 2021 -0800 Don't swallow gnus-search errors when creating nnselect groups * lisp/gnus/gnus-search.el (gnus-search-run-query): Modify condition-case to re-signal any gnus-search related errors; the user should see them. (gnus-search-error): Define a new parent error for all gnus-search errors. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index bce5d57c52..c77de688e6 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -105,9 +105,13 @@ (gnus-add-shutdown #'gnus-search-shutdown 'gnus) -(define-error 'gnus-search-parse-error "Gnus search parsing error") +(define-error 'gnus-search-error "Gnus search error") -(define-error 'gnus-search-config-error "Gnus search configuration error") +(define-error 'gnus-search-parse-error "Gnus search parsing error" + 'gnus-search-error) + +(define-error 'gnus-search-config-error "Gnus search configuration error" + 'gnus-search-error) ;;; User Customizable Variables: @@ -1927,7 +1931,7 @@ Assume \"size\" key is equal to \"larger\"." (apply #'nnheader-message 4 "Search engine for %s improperly configured: %s" server (cdr err)) - (signal 'gnus-search-config-error err))))) + (signal (car err) (cdr err)))))) (alist-get 'search-group-spec specs)) ;; Some search engines do their own limiting, but some don't, so ;; do it again here. This is bad because, if the user is diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index ecec705b32..252e9f6683 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -779,6 +779,10 @@ Return an article list." (args (alist-get 'nnselect-args specs))) (condition-case-unless-debug err (funcall func args) + ;; Don't swallow gnus-search errors; the user should be made + ;; aware of them. + (gnus-search-error + (signal (car err) (cdr err))) (error (gnus-error 3 "nnselect-run: %s on %s gave error %s" func args err) [])))) commit f247fa5d5ce7cb34f23c979c17b14c5713eb5490 Author: Juri Linkov Date: Sat Dec 4 22:04:37 2021 +0200 * lisp/isearch.el (isearch-delete-char): Reopen hidden overlays (bug#52248). (isearch-filter-visible): Move text-property-not-all higher to not call isearch-range-invisible on inhibit-isearch text. Remove min/max since arguments are always in the right order. diff --git a/lisp/isearch.el b/lisp/isearch.el index fcb7d646c6..8815cb4f2d 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2504,6 +2504,11 @@ If no input items have been entered yet, just beep." (if (null (cdr isearch-cmds)) (ding) (isearch-pop-state)) + ;; When going back to the hidden match, reopen it. + (when (and (eq search-invisible 'open) isearch-hide-immediately + isearch-other-end) + (isearch-range-invisible (min (point) isearch-other-end) + (max (point) isearch-other-end))) (isearch-update)) (defun isearch-del-char (&optional arg) @@ -3787,10 +3792,9 @@ Isearch, at least partially, as determined by `isearch-range-invisible'. If `search-invisible' is t, which allows Isearch matches inside invisible text, this function will always return non-nil, regardless of what `isearch-range-invisible' says." - (and (or (eq search-invisible t) - (not (isearch-range-invisible beg end))) - (not (text-property-not-all (min beg end) (max beg end) - 'inhibit-isearch nil)))) + (and (not (text-property-not-all beg end 'inhibit-isearch nil)) + (or (eq search-invisible t) + (not (isearch-range-invisible beg end))))) ;; General utilities commit 08782d58db6437b593c0469372dc936f9d8a62da Author: Lars Ingebrigtsen Date: Sat Dec 4 20:38:22 2021 +0100 Fix pixel-fill--fill-line infloop for certain unbreakable lines * lisp/textmodes/pixel-fill.el (pixel-fill--fill-line): Fix infloops for certain line widths (bug#52271). diff --git a/lisp/textmodes/pixel-fill.el b/lisp/textmodes/pixel-fill.el index f69696e1f5..0a0f0eb8b6 100644 --- a/lisp/textmodes/pixel-fill.el +++ b/lisp/textmodes/pixel-fill.el @@ -116,15 +116,13 @@ prefix on subsequent lines." (while (not (eolp)) ;; We have to do some folding. First find the first previous ;; point suitable for folding. - (if (or (not (pixel-fill-find-fill-point (line-beginning-position))) - (= (point) start)) - ;; We had unbreakable text (for this width), so just go to - ;; the first space and carry on. - (progn - (beginning-of-line) - (skip-chars-forward " ") - (search-forward " " (line-end-position) 'move))) - ;; Success; continue. + (when (or (not (pixel-fill-find-fill-point (line-beginning-position))) + (= (point) start)) + ;; We had unbreakable text (for this width), so just go to + ;; the first space and carry on. + (beginning-of-line) + (skip-chars-forward " ") + (search-forward " " (line-end-position) 'move)) (when (= (preceding-char) ?\s) (delete-char -1)) (unless (eobp) @@ -133,7 +131,8 @@ prefix on subsequent lines." (insert (propertize " " 'display (list 'space :align-to (list indentation)))))) (setq start (point)) - (pixel-fill--goto-pixel width)))) + (unless (eobp) + (pixel-fill--goto-pixel width))))) (define-inline pixel-fill--char-breakable-p (char) "Return non-nil if a line can be broken before and after CHAR." commit 3bfd8e4007868c1cccb3f7e0590c436d32de2146 Author: Lars Ingebrigtsen Date: Sat Dec 4 20:22:44 2021 +0100 Add a comma between groups in gnus-inews-insert-gcc * lisp/gnus/gnus-msg.el (gnus-inews-insert-gcc): Insert a comma between group names to get more mail-like syntax (bug#52274). diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index bb265642bc..bf2d1370eb 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1748,7 +1748,7 @@ this is a reply." (concat "\"" str "\"") str))) (when groups - (insert " "))) + (insert ", "))) (insert "\n"))))))) (defun gnus-mailing-list-followup-to () commit 7505abae3968f9ecdc2e0be909bfffed822f9fdb Author: Lars Ingebrigtsen Date: Sat Dec 4 05:56:32 2021 +0100 Improve bookmark-maybe-historicize-string doc string * lisp/bookmark.el (bookmark-maybe-historicize-string): Clarify that this isn't about menus (but calls from bmenu) (bug#12504). diff --git a/lisp/bookmark.el b/lisp/bookmark.el index a8fa9ae774..f35cbc1a5e 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -510,8 +510,9 @@ If DEFAULT is nil then return empty string for empty input." (defmacro bookmark-maybe-historicize-string (string) "Put STRING into the bookmark prompt history, if caller non-interactive. -We need this because sometimes bookmark functions are invoked from -menus, so `completing-read' never gets a chance to set `bookmark-history'." +We need this because sometimes bookmark functions are invoked +from other commands that pass in the bookmark name, so +`completing-read' never gets a chance to set `bookmark-history'." `(or (called-interactively-p 'interactive) (setq bookmark-history (cons ,string bookmark-history)))) commit 7c5e699b8147dccc4b9960b5481692378de96e1d Author: Michael Albinus Date: Sat Dec 4 20:02:07 2021 +0100 Add ".crate" to Tramp archive file suffixes. * doc/misc/tramp.texi (Archive file names): * lisp/net/tramp-archive.el (tramp-archive-suffixes): Add ".crate". diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 1f6d4ad626..2a8a038280 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3389,8 +3389,8 @@ indication that the process has been interrupted, and returns a corresponding string. This remote process handling does not apply to @acronym{GVFS} -(@pxref{GVFS-based methods}) because the remote file system is mounted on -the local host and @value{tramp} accesses it by changing the +(@pxref{GVFS-based methods}) because the remote file system is mounted +on the local host and @value{tramp} accesses it by changing the @code{default-directory}. @value{tramp} starts a remote process when a command is executed in a @@ -4059,6 +4059,11 @@ CPIO archives @cindex @file{cpio} file archive suffix @cindex file archive suffix @file{cpio} +@item @samp{.crate} --- +Cargo (Rust) packages +@cindex @file{crate} file archive suffix +@cindex file archive suffix @file{crate} + @item @samp{.deb} --- Debian packages @cindex @file{deb} file archive suffix diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index efd38e6b4b..b0f447a3ae 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -54,6 +54,7 @@ ;; * ".ar" - UNIX archiver formats ;; * ".cab", ".CAB" - Microsoft Windows cabinets ;; * ".cpio" - CPIO archives +;; * ".crate" - Cargo (Rust) packages ;; * ".deb" - Debian packages ;; * ".depot" - HP-UX SD depots ;; * ".exe" - Self extracting Microsoft Windows EXE files @@ -141,6 +142,7 @@ "ar" ;; UNIX archiver formats. "cab" "CAB" ;; Microsoft Windows cabinets. "cpio" ;; CPIO archives. + "crate" ;; Cargo (Rust) packages. Not in libarchive testsuite. "deb" ;; Debian packages. Not in libarchive testsuite. "depot" ;; HP-UX SD depot. Not in libarchive testsuite. "exe" ;; Self extracting Microsoft Windows EXE files. commit de727b5886fb4a81df2dc17d9d094e915c1e9fb4 Author: Stefan Monnier Date: Sat Dec 4 13:47:19 2021 -0500 eieio-core.el: Allow assignment to cl-structs through `slot-value` * lisp/emacs-lisp/eieio-core.el (eieio--validate-slot-value): Obey the `:read-only` property of the slot. (eieio-oset): Allow use on cl-structs as well. (eieio-read-only): New error. * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test--struct): Make the last field read-only. (eieio-test-defstruct-slot-value): Test that cl-struct slots can be assigned via `slot-value`. diff --git a/doc/misc/eieio.texi b/doc/misc/eieio.texi index 2b0b1f7fd6..8a4b914687 100644 --- a/doc/misc/eieio.texi +++ b/doc/misc/eieio.texi @@ -703,8 +703,7 @@ This function retrieves the value of @var{slot} from @var{object}. It can also be used on objects defined by @code{cl-defstruct}. This is a generalized variable that can be used with @code{setf} to -modify the value stored in @var{slot}, tho not for objects defined by -@code{cl-defstruct}. +modify the value stored in @var{slot}. @xref{Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}. @end defun diff --git a/etc/NEWS b/etc/NEWS index 2b4eaaf8a1..df5e6ef790 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -423,7 +423,7 @@ representation as emojis. ** EIEIO +++ -*** 'slot-value' can now be used to read slots of 'cl-defstruct' objects. +*** 'slot-value' can now be used to access slots of 'cl-defstruct' objects. ** align diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 7c5babcf54..ca47ec77f7 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -450,7 +450,7 @@ See `defclass' for more information." )) ;; Now that everything has been loaded up, all our lists are backwards! - ;; Fix that up now and then them into vectors. + ;; Fix that up now and turn them into vectors. (cl-callf (lambda (slots) (apply #'vector (nreverse slots))) (eieio--class-slots newc)) (cl-callf nreverse (eieio--class-initarg-tuples newc)) @@ -704,11 +704,15 @@ an error." nil ;; Trim off object IDX junk added in for the object index. (setq slot-idx (- slot-idx (eval-when-compile eieio--object-num-slots))) - (let ((st (cl--slot-descriptor-type (aref (eieio--class-slots class) - slot-idx)))) - (if (not (eieio--perform-slot-validation st value)) - (signal 'invalid-slot-type - (list (eieio--class-name class) slot st value)))))) + (let* ((sd (aref (eieio--class-slots class) + slot-idx)) + (st (cl--slot-descriptor-type sd))) + (cond + ((not (eieio--perform-slot-validation st value)) + (signal 'invalid-slot-type + (list (eieio--class-name class) slot st value))) + ((alist-get :read-only (cl--slot-descriptor-props sd)) + (signal 'eieio-read-only (list (eieio--class-name class) slot))))))) (defun eieio--validate-class-slot-value (class slot-idx value slot) "Make sure that for CLASS referencing SLOT-IDX, VALUE is valid. @@ -813,7 +817,7 @@ Fills in CLASS's SLOT with its default value." (defun eieio-oset (obj slot value) "Do the work for the macro `oset'. Fills in OBJ's SLOT with VALUE." - (cl-check-type obj eieio-object) + (cl-check-type obj (or eieio-object cl-structure-object)) (cl-check-type slot symbol) (let* ((class (eieio--object-class obj)) (c (eieio--slot-name-index class slot))) @@ -1063,6 +1067,7 @@ method invocation orders of the involved classes." ;; (define-error 'invalid-slot-name "Invalid slot name") (define-error 'invalid-slot-type "Invalid slot type") +(define-error 'eieio-read-only "Read-only slot") (define-error 'unbound-slot "Unbound slot") (define-error 'inconsistent-class-hierarchy "Inconsistent class hierarchy") diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el index dfdfb63b58..6f6a1f4f19 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el @@ -971,7 +971,7 @@ Subclasses to override slot attributes.") ;;;; Interaction with defstruct -(cl-defstruct eieio-test--struct a b c) +(cl-defstruct eieio-test--struct a b (c nil :read-only t)) (ert-deftest eieio-test-defstruct-slot-value () (let ((x (make-eieio-test--struct :a 'A :b 'B :c 'C))) @@ -980,7 +980,10 @@ Subclasses to override slot attributes.") (should (eq (eieio-test--struct-b x) (slot-value x 'b))) (should (eq (eieio-test--struct-c x) - (slot-value x 'c))))) + (slot-value x 'c))) + (setf (slot-value x 'a) 1) + (should (eq (eieio-test--struct-a x) 1)) + (should-error (setf (slot-value x 'c) 3) :type 'eieio-read-only))) (provide 'eieio-tests) commit 63be97fb050545cc33ae5d857188ad45fbe27715 Author: Paul Eggert Date: Sat Dec 4 10:33:32 2021 -0800 Fix (date-to-time "2021-12-04") This should complete the fix for Bug#52209. * lisp/calendar/time-date.el (date-to-time): Apply decoded-time-set-defaults only to the output of (parse-time-string date), and only when the output has a year (to avoid confusion when dates lack years). There is no point applying it after timezone-make-date-arpa-standard since the latter fills in all the blanks. And the former code mistakenly called encode-time on an already-encoded time. This goes back to the code a couple of days ago, except with changed behavior (to fix Bug#52209) only when timezone-make-date-arpa-standard is not called. * test/lisp/calendar/time-date-tests.el (test-date-to-time) (test-days-between): New tests. diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index e420644cd8..b4efc44b03 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1724,7 +1724,8 @@ This function parses the time-string @var{string} and returns the corresponding Lisp timestamp. The argument @var{string} should represent a date-time, and should be in one of the forms recognized by @code{parse-time-string} (see below). This function assumes Universal -Time if @var{string} lacks explicit time zone information. +Time if @var{string} lacks explicit time zone information, +and assumes earliest values if @var{string} lacks month, day, or time. The operating system limits the range of time and zone values. @end defun diff --git a/etc/NEWS b/etc/NEWS index ac1787d7f8..2b4eaaf8a1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1084,6 +1084,10 @@ cookies set by web pages on disk. ** New variable 'help-buffer-under-preparation'. This variable is bound to t during the preparation of a "*Help*" buffer. ++++ +** 'date-to-time' now assumes earliest values if its argument lacks +month, day, or time. For example, (date-to-time "2021-12-04") now +assumes a time of 00:00 instead of signaling an error. * Changes in Emacs 29.1 on Non-Free Operating Systems diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 8a6ee0f270..37a16d3b98 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -153,28 +153,22 @@ it is assumed that PICO was omitted and should be treated as zero." "Parse a string DATE that represents a date-time and return a time value. DATE should be in one of the forms recognized by `parse-time-string'. If DATE lacks timezone information, GMT is assumed." - ;; Pass the result of parsing through decoded-time-set-defaults - ;; because encode-time signals if HH:MM:SS are not filled in. - (encode-time - (decoded-time-set-defaults - (condition-case err - (let ((time (parse-time-string date))) - (prog1 time - ;; Cause an error if data `parse-time-string' returns is invalid. - (setq time (encode-time time)))) - (error - (let ((overflow-error '(error "Specified time is not representable"))) - (if (or (equal err overflow-error) - ;; timezone-make-date-arpa-standard misbehaves if - ;; not given at least HH:MM as part of the date. - (not (string-match ":" date))) - (signal (car err) (cdr err)) - (condition-case err - (parse-time-string (timezone-make-date-arpa-standard date)) - (error - (if (equal err overflow-error) - (signal (car err) (cdr err)) - (error "Invalid date: %s" date))))))))))) + (condition-case err + (let ((parsed (parse-time-string date))) + (when (decoded-time-year parsed) + (decoded-time-set-defaults parsed)) + (encode-time parsed)) + (error + (let ((overflow-error '(error "Specified time is not representable"))) + (if (equal err overflow-error) + (signal (car err) (cdr err)) + (condition-case err + (encode-time (parse-time-string + (timezone-make-date-arpa-standard date))) + (error + (if (equal err overflow-error) + (signal (car err) (cdr err)) + (error "Invalid date: %s" date))))))))) ;;;###autoload (defalias 'time-to-seconds 'float-time) diff --git a/test/lisp/calendar/time-date-tests.el b/test/lisp/calendar/time-date-tests.el index 4568947c0b..d5269804ad 100644 --- a/test/lisp/calendar/time-date-tests.el +++ b/test/lisp/calendar/time-date-tests.el @@ -41,6 +41,13 @@ (encode-time-value 1 2 3 4 3)) '(1 2 3 4)))) +(ert-deftest test-date-to-time () + (should (equal (format-time-string "%F %T" (date-to-time "2021-12-04")) + "2021-12-04 00:00:00"))) + +(ert-deftest test-days-between () + (should (equal (days-between "2021-10-22" "2020-09-29") 388))) + (ert-deftest test-leap-year () (should-not (date-leap-year-p 1999)) (should-not (date-leap-year-p 1900)) commit 7384a329d2582e28e28eb8f8e568f7688dceea38 Author: Michael Albinus Date: Sat Dec 4 18:43:45 2021 +0100 Further changes on directory summary line in Tramp * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-system-info): Do not assume 0 in case of missing information. * lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): * lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory): Revert previous change, it doesn't fly. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index ab71c9cd13..22e31428a7 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1521,11 +1521,11 @@ If FILE-SYSTEM is non-nil, return file system attributes." (size (cdr (assoc "filesystem::size" attr))) (used (cdr (assoc "filesystem::used" attr))) (free (cdr (assoc "filesystem::free" attr)))) - (when (or size used free) - (list (string-to-number (or size "0")) - (string-to-number (or free "0")) - (- (string-to-number (or size "0")) - (string-to-number (or used "0")))))))) + (when (or size free) + (list (and size (string-to-number size)) + (and free (string-to-number free)) + (and size used + (- (string-to-number size) (string-to-number used)))))))) (defun tramp-gvfs-handle-make-directory (dir &optional parents) "Like `make-directory' for Tramp files." diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 780c3b3941..8d106591af 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2678,17 +2678,15 @@ The method used must be an out-of-band method." (point-min) 'noerror) (replace-match (file-relative-name filename) t)) - ;; Try to insert the amount of free space. This is moved to - ;; `dired-insert-directory' in Emacs 29.1. - (unless (boundp 'dired-free-space) - (goto-char (point-min)) - ;; First find the line to put it on. - (when (re-search-forward "^\\([[:space:]]*total\\)" nil t) - (when-let ((available (get-free-disk-space "."))) - ;; Replace "total" with "total used", to avoid confusion. - (replace-match "\\1 used in directory") - (end-of-line) - (insert " available " available))))) + ;; Try to insert the amount of free space. + (goto-char (point-min)) + ;; First find the line to put it on. + (when (re-search-forward "^\\([[:space:]]*total\\)" nil t) + (when-let ((available (get-free-disk-space "."))) + ;; Replace "total" with "total used", to avoid confusion. + (replace-match "\\1 used in directory") + (end-of-line) + (insert " available " available)))) (prog1 (goto-char end-marker) (set-marker beg-marker nil) @@ -6024,5 +6022,8 @@ function cell is returned to be applied on a buffer." ;; be to stipulate, as a directory or connection-local variable, an ;; additional rc file on the remote machine that is sourced every ;; time Tramp connects. +;; +;; * Support hostname canonicalization in ~/.ssh/config. +;; ;;; tramp-sh.el ends here diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 0a7d1efc8b..24119539db 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1120,14 +1120,12 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (setcar x (concat (car x) "*")))))) entries)) - ;; Insert size information. This is moved to - ;; `dired-insert-directory' in Emacs 29.1. - (unless (boundp 'dired-free-space) - (when full-directory-p - (insert - (if avail - (format "total used in directory %s available %s\n" used avail) - (format "total %s\n" used))))) + ;; Insert size information. + (when full-directory-p + (insert + (if avail + (format "total used in directory %s available %s\n" used avail) + (format "total %s\n" used)))) ;; Print entries. (mapc commit 7c68c84674d67d7bee9d78b99ce01ad789a77961 Author: Stefan Kangas Date: Sat Dec 4 15:49:42 2021 +0100 Silence byte-compiler in some tests * test/lisp/dired-tests.el: * test/lisp/emacs-lisp/cl-macs-tests.el: * test/lisp/emacs-lisp/derived-tests.el: * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el: * test/lisp/emacs-lisp/generator-tests.el: * test/lisp/emacs-lisp/lisp-tests.el: * test/lisp/emacs-lisp/seq-tests.el (test-seq-let) (test-seq-setq): * test/lisp/emacs-lisp/subr-x-tests.el (subr-x-test-if-let*-false) (subr-x-test-if-let*-and-laziness-is-preserved) (subr-x-test-when-let*-false) (subr-x-test-when-let*-and-laziness-is-preserved): * test/lisp/emacs-lisp/timer-tests.el (timer-tests-debug-timer-check): * test/lisp/format-spec-tests.el (format-spec-do-flags-truncate) (format-spec-do-flags-pad): * test/lisp/ls-lisp-tests.el (ls-lisp-test-bug27762): * test/lisp/obsolete/cl-tests.el (labels-function-quoting): * test/lisp/progmodes/elisp-mode-tests.el: * test/lisp/replace-tests.el (replace-regexp-bug45973): * test/lisp/ses-tests.el: * test/lisp/subr-tests.el: * test/lisp/tar-mode-tests.el (tar-mode-test-tar-grind-file-mode): * test/src/data-tests.el (data-tests--set-default-per-buffer): * test/src/search-tests.el (test-replace-match-modification-hooks): Silence byte-compiler. diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index 43791118f1..1c4f37bd32 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el @@ -543,10 +543,12 @@ path's data to use." ((equal "." path) default-directory) (path))) (return-size - (car (files-tests--look-up-free-data path)))) + ;; It is always defined but this silences the byte-compiler: + (when (fboundp 'files-tests--look-up-free-data) + (car (files-tests--look-up-free-data path))))) (list return-size return-size return-size)))) - (defun files-tests--insert-directory-output (dir &optional verbose) + (defun files-tests--insert-directory-output (dir &optional _verbose) "Run `insert-directory' and return its output." (with-current-buffer-window "files-tests--insert-directory" nil nil (let ((dired-free-space 'separate)) @@ -555,35 +557,46 @@ path's data to use." (ert-deftest files-tests-insert-directory-shows-files () "Verify `insert-directory' reports the files in the directory." - (let* ((test-dir (car test-files)) - (files (cdr test-files)) - (output (files-tests--insert-directory-output test-dir))) - (dolist (file files) - (should (string-match-p file output))))) + ;; It is always defined but this silences the byte-compiler: + (when (fboundp 'files-tests--insert-directory-output) + (let* ((test-dir (car test-files)) + (files (cdr test-files)) + (output (files-tests--insert-directory-output test-dir))) + (dolist (file files) + (should (string-match-p file output)))))) (defun files-tests--insert-directory-shows-given-free (dir &optional info-func) "Run `insert-directory' and verify it reports the correct available space. Stub `file-system-info' to ensure the available space is consistent, either with the given stub function or a default one using test data." - (cl-letf (((symbol-function 'file-system-info) - (or info-func - (files-tests--make-file-system-info-stub)))) - (should (string-match-p (cadr - (files-tests--look-up-free-data dir)) - (files-tests--insert-directory-output dir t))))) + ;; It is always defined but this silences the byte-compiler: + (when (and (fboundp 'files-tests--make-file-system-info-stub) + (fboundp 'files-tests--look-up-free-data) + (fboundp 'files-tests--insert-directory-output)) + (cl-letf (((symbol-function 'file-system-info) + (or info-func + (files-tests--make-file-system-info-stub)))) + (should (string-match-p (cadr + (files-tests--look-up-free-data dir)) + (files-tests--insert-directory-output dir t)))))) (ert-deftest files-tests-insert-directory-shows-free () "Test that verbose `insert-directory' shows the correct available space." - (files-tests--insert-directory-shows-given-free - test-dir - (files-tests--make-file-system-info-stub test-dir))) + ;; It is always defined but this silences the byte-compiler: + (when (and (fboundp 'files-tests--insert-directory-shows-given-free) + (fboundp 'files-tests--make-file-system-info-stub)) + (files-tests--insert-directory-shows-given-free + test-dir + (files-tests--make-file-system-info-stub test-dir)))) (ert-deftest files-tests-bug-50630 () "Verify verbose `insert-directory' shows free space of the target directory. The current directory at call time should not affect the result (Bug#50630)." - (let ((default-directory test-dir-other)) - (files-tests--insert-directory-shows-given-free test-dir)))) + ;; It is always defined but this silences the byte-compiler: + (when (fboundp 'files-tests--insert-directory-shows-given-free) + (let ((default-directory test-dir-other)) + (files-tests--insert-directory-shows-given-free test-dir))))) (provide 'dired-tests) ;;; dired-tests.el ends here diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index be2c0fa02b..7c3afefaad 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el @@ -668,6 +668,10 @@ collection clause." #'len)) (`(function (lambda (,_ ,_) . ,_)) t)))) +(with-suppressed-warnings ((lexical test) (lexical test1) (lexical test2)) + (defvar test) + (defvar test1) + (defvar test2)) (ert-deftest cl-macs--progv () (should (= (cl-progv '(test test) '(1 2) test) 2)) (should (equal (cl-progv '(test1 test2) '(1 2) (list test1 test2)) diff --git a/test/lisp/emacs-lisp/derived-tests.el b/test/lisp/emacs-lisp/derived-tests.el index 9c8e6c33b4..2647b86826 100644 --- a/test/lisp/emacs-lisp/derived-tests.el +++ b/test/lisp/emacs-lisp/derived-tests.el @@ -24,13 +24,13 @@ (define-derived-mode derived-tests--parent-mode prog-mode "P" :after-hook (let ((f (let ((x "S")) (lambda () x)))) - (insert (format "AFP=%s " (let ((x "D")) (funcall f))))) + (insert (format "AFP=%s " (let ((x "D")) x (funcall f))))) (insert "PB ")) (define-derived-mode derived-tests--child-mode derived-tests--parent-mode "C" :after-hook (let ((f (let ((x "S")) (lambda () x)))) - (insert (format "AFC=%s " (let ((x "D")) (funcall f))))) + (insert (format "AFC=%s " (let ((x "D")) x (funcall f))))) (insert "CB ")) (ert-deftest derived-tests-after-hook-lexical () diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el index ba2e5f7be4..dfdfb63b58 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el @@ -172,7 +172,7 @@ ;; Check that generic-p works (should (generic-p 'generic1)) - (defmethod generic1 ((c class-a)) + (defmethod generic1 ((_c class-a)) "Method on generic1." 'monkey) @@ -240,12 +240,12 @@ Argument C is the class bound to this static method." (should (make-instance 'class-a :water 'cho)) (should (make-instance 'class-b))) -(defmethod class-cn ((a class-a)) +(defmethod class-cn ((_a class-a)) "Try calling `call-next-method' when there isn't one. Argument A is object of type symbol `class-a'." (call-next-method)) -(defmethod no-next-method ((a class-a) &rest args) +(defmethod no-next-method ((_a class-a) &rest _args) "Override signal throwing for variable `class-a'. Argument A is the object of class variable `class-a'." 'moose) @@ -254,7 +254,7 @@ Argument A is the object of class variable `class-a'." ;; Play with call-next-method (should (eq (class-cn eitest-ab) 'moose))) -(defmethod no-applicable-method ((b class-b) method &rest args) +(defmethod no-applicable-method ((_b class-b) _method &rest _args) "No need. Argument B is for booger. METHOD is the method that was attempting to be called." @@ -264,38 +264,38 @@ METHOD is the method that was attempting to be called." ;; Non-existing methods. (should (eq (class-cn eitest-b) 'moose))) -(defmethod class-fun ((a class-a)) +(defmethod class-fun ((_a class-a)) "Fun with class A." 'moose) -(defmethod class-fun ((b class-b)) +(defmethod class-fun ((_b class-b)) "Fun with class B." (error "Class B fun should not be called") ) -(defmethod class-fun-foo ((b class-b)) +(defmethod class-fun-foo ((_b class-b)) "Foo Fun with class B." 'moose) -(defmethod class-fun2 ((a class-a)) +(defmethod class-fun2 ((_a class-a)) "More fun with class A." 'moose) -(defmethod class-fun2 ((b class-b)) +(defmethod class-fun2 ((_b class-b)) "More fun with class B." (error "Class B fun2 should not be called") ) -(defmethod class-fun2 ((ab class-ab)) +(defmethod class-fun2 ((_ab class-ab)) "More fun with class AB." (call-next-method)) ;; How about if B is the only slot? -(defmethod class-fun3 ((b class-b)) +(defmethod class-fun3 ((_b class-b)) "Even More fun with class B." 'moose) -(defmethod class-fun3 ((ab class-ab)) +(defmethod class-fun3 ((_ab class-ab)) "Even More fun with class AB." (call-next-method)) @@ -314,17 +314,17 @@ METHOD is the method that was attempting to be called." (defvar class-fun-value-seq '()) -(defmethod class-fun-value :BEFORE ((a class-a)) +(defmethod class-fun-value :BEFORE ((_a class-a)) "Return `before', and push `before' in `class-fun-value-seq'." (push 'before class-fun-value-seq) 'before) -(defmethod class-fun-value :PRIMARY ((a class-a)) +(defmethod class-fun-value :PRIMARY ((_a class-a)) "Return `primary', and push `primary' in `class-fun-value-seq'." (push 'primary class-fun-value-seq) 'primary) -(defmethod class-fun-value :AFTER ((a class-a)) +(defmethod class-fun-value :AFTER ((_a class-a)) "Return `after', and push `after' in `class-fun-value-seq'." (push 'after class-fun-value-seq) 'after) @@ -343,14 +343,14 @@ METHOD is the method that was attempting to be called." ;; (ert-deftest eieio-test-13-init-methods () - (defmethod initialize-instance ((a class-a) &rest slots) + (defmethod initialize-instance ((a class-a) &rest _slots) "Initialize the slots of class-a." (call-next-method) (if (/= (oref a test-tag) 1) (error "shared-initialize test failed.")) (oset a test-tag 2)) - (defmethod shared-initialize ((a class-a) &rest slots) + (defmethod shared-initialize ((a class-a) &rest _slots) "Shared initialize method for class-a." (call-next-method) (oset a test-tag 1)) @@ -369,7 +369,7 @@ METHOD is the method that was attempting to be called." (ert-deftest eieio-test-15-slot-missing () - (defmethod slot-missing ((ab class-ab) &rest foo) + (defmethod slot-missing ((_ab class-ab) &rest _foo) "If a slot in AB is unbound, return something cool. FOO." 'moose) @@ -425,7 +425,7 @@ METHOD is the method that was attempting to be called." (ert-deftest eieio-test-18-slot-unbound () - (defmethod slot-unbound ((a class-a) &rest foo) + (defmethod slot-unbound ((_a class-a) &rest _foo) "If a slot in A is unbound, ignore FOO." 'moose) @@ -448,7 +448,7 @@ METHOD is the method that was attempting to be called." (should (eq (oref (class-a) water) 'penguin)) ;; Revert the above - (defmethod slot-unbound ((a class-a) &rest foo) + (defmethod slot-unbound ((_a class-a) &rest _foo) "If a slot in A is unbound, ignore FOO." ;; Disable the old slot-unbound so we can run this test ;; more than once diff --git a/test/lisp/emacs-lisp/generator-tests.el b/test/lisp/emacs-lisp/generator-tests.el index 50b8cc53a2..492c4e4085 100644 --- a/test/lisp/emacs-lisp/generator-tests.el +++ b/test/lisp/emacs-lisp/generator-tests.el @@ -74,7 +74,7 @@ identical output." (cps-testcase cps-prog1-b (prog1 1)) (cps-testcase cps-prog1-c (prog2 1 2 3)) (cps-testcase cps-quote (progn 'hello)) -(cps-testcase cps-function (progn #'hello)) +(cps-testcase cps-function (progn #'message)) (cps-testcase cps-and-fail (and 1 nil 2)) (cps-testcase cps-and-succeed (and 1 2 3)) @@ -307,6 +307,7 @@ identical output." (1+ it))))))) -2))) +(defun generator-tests-edebug ()) ; silence byte-compiler (ert-deftest generator-tests-edebug () "Check that Bug#40434 is fixed." (with-temp-buffer diff --git a/test/lisp/emacs-lisp/lisp-tests.el b/test/lisp/emacs-lisp/lisp-tests.el index 8301d9906a..7f4d50c595 100644 --- a/test/lisp/emacs-lisp/lisp-tests.el +++ b/test/lisp/emacs-lisp/lisp-tests.el @@ -213,6 +213,7 @@ (should-error (forward-sexp)))) ;; FIXME: Shouldn't be an error. ;; Test some core Elisp rules. +(defvar c-e-x) (ert-deftest core-elisp-tests-1-defvar-in-let () "Test some core Elisp rules." (with-temp-buffer diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el index 8dc0b93b5a..8cfa3bdb86 100644 --- a/test/lisp/emacs-lisp/seq-tests.el +++ b/test/lisp/emacs-lisp/seq-tests.el @@ -172,17 +172,23 @@ Evaluate BODY for each created sequence. (should-not (seq-find #'null '(1 2 3))) (should (seq-find #'null '(1 2 3) 'sentinel))) +;; Hack to work around the ERT limitation that we can't reliably use +;; `with-suppressed-warnings' inside an `ert-deftest'. (Bug#36568) +(defun seq--contains (&rest args) + (with-suppressed-warnings ((obsolete seq-contains)) + (apply #'seq-contains args))) + (ert-deftest test-seq-contains () (with-test-sequences (seq '(3 4 5 6)) - (should (seq-contains seq 3)) - (should-not (seq-contains seq 7))) + (should (seq--contains seq 3)) + (should-not (seq--contains seq 7))) (with-test-sequences (seq '()) - (should-not (seq-contains seq 3)) - (should-not (seq-contains seq nil)))) + (should-not (seq--contains seq 3)) + (should-not (seq--contains seq nil)))) (ert-deftest test-seq-contains-should-return-the-elt () (with-test-sequences (seq '(3 4 5 6)) - (should (= 5 (seq-contains seq 5))))) + (should (= 5 (seq--contains seq 5))))) (ert-deftest test-seq-contains-p () (with-test-sequences (seq '(3 4 5 6)) @@ -404,7 +410,7 @@ Evaluate BODY for each created sequence. (let ((seq '(1 (2 (3 (4)))))) (seq-let (_ (_ (_ (a)))) seq (should (= a 4)))) - (let (seq) + (let ((seq nil)) (seq-let (a b c) seq (should (null a)) (should (null b)) @@ -428,7 +434,7 @@ Evaluate BODY for each created sequence. (seq '(1 (2 (3 (4)))))) (seq-setq (_ (_ (_ (a)))) seq) (should (= a 4))) - (let (seq a b c) + (let ((seq nil) a b c) (seq-setq (a b c) seq) (should (null a)) (should (null b)) diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el index 69d59e84f6..d836950600 100644 --- a/test/lisp/emacs-lisp/subr-x-tests.el +++ b/test/lisp/emacs-lisp/subr-x-tests.el @@ -169,13 +169,13 @@ "no") "no")) (should (equal - (let (z) + (let ((z nil)) (if-let* (z (a 1) (b 2) (c 3)) "yes" "no")) "no")) (should (equal - (let (d) + (let ((d nil)) (if-let* ((a 1) (b 2) (c 3) d) "yes" "no")) @@ -191,7 +191,7 @@ (ert-deftest subr-x-test-if-let*-and-laziness-is-preserved () "Test `if-let' respects `and' laziness." - (let (a-called b-called c-called) + (let ((a-called nil) (b-called nil) c-called) (should (equal (if-let* ((a nil) (b (setq b-called t)) @@ -199,7 +199,7 @@ "yes" (list a-called b-called c-called)) (list nil nil nil)))) - (let (a-called b-called c-called) + (let ((a-called nil) (b-called nil) c-called) (should (equal (if-let* ((a (setq a-called t)) (b nil) @@ -207,12 +207,12 @@ "yes" (list a-called b-called c-called)) (list t nil nil)))) - (let (a-called b-called c-called) + (let ((a-called nil) (b-called nil) c-called) (should (equal (if-let* ((a (setq a-called t)) - (b (setq b-called t)) - (c nil) - (d (setq c-called t))) + (b (setq b-called t)) + (c nil) + (d (setq c-called t))) "yes" (list a-called b-called c-called)) (list t t nil))))) @@ -329,12 +329,12 @@ "no") nil)) (should (equal - (let (z) + (let ((z nil)) (when-let* (z (a 1) (b 2) (c 3)) "no")) nil)) (should (equal - (let (d) + (let ((d nil)) (when-let* ((a 1) (b 2) (c 3) d) "no")) nil))) @@ -348,7 +348,7 @@ (ert-deftest subr-x-test-when-let*-and-laziness-is-preserved () "Test `when-let' respects `and' laziness." - (let (a-called b-called c-called) + (let ((a-called nil) (b-called nil) (c-called nil)) (should (equal (progn (when-let* ((a nil) @@ -357,7 +357,7 @@ "yes") (list a-called b-called c-called)) (list nil nil nil)))) - (let (a-called b-called c-called) + (let ((a-called nil) (b-called nil) (c-called nil)) (should (equal (progn (when-let* ((a (setq a-called t)) @@ -366,7 +366,7 @@ "yes") (list a-called b-called c-called)) (list t nil nil)))) - (let (a-called b-called c-called) + (let ((a-called nil) (b-called nil) (c-called nil)) (should (equal (progn (when-let* ((a (setq a-called t)) diff --git a/test/lisp/emacs-lisp/timer-tests.el b/test/lisp/emacs-lisp/timer-tests.el index 7856c217f9..0f5b1a7186 100644 --- a/test/lisp/emacs-lisp/timer-tests.el +++ b/test/lisp/emacs-lisp/timer-tests.el @@ -37,7 +37,8 @@ (ert-deftest timer-tests-debug-timer-check () ;; This function exists only if --enable-checking. (skip-unless (fboundp 'debug-timer-check)) - (should (debug-timer-check))) + (when (fboundp 'debug-timer-check) ; silence byte-compiler + (should (debug-timer-check)))) (ert-deftest timer-test-multiple-of-time () (should (time-equal-p diff --git a/test/lisp/format-spec-tests.el b/test/lisp/format-spec-tests.el index ff2abdeaad..3c6fa540fe 100644 --- a/test/lisp/format-spec-tests.el +++ b/test/lisp/format-spec-tests.el @@ -56,7 +56,7 @@ (ert-deftest format-spec-do-flags-truncate () "Test `format-spec--do-flags' truncation." - (let (flags) + (let ((flags nil)) (should (equal (format-spec--do-flags "" flags nil 0) "")) (should (equal (format-spec--do-flags "" flags nil 1) "")) (should (equal (format-spec--do-flags "a" flags nil 0) "")) @@ -75,7 +75,7 @@ (ert-deftest format-spec-do-flags-pad () "Test `format-spec--do-flags' padding." - (let (flags) + (let ((flags nil)) (should (equal (format-spec--do-flags "" flags 0 nil) "")) (should (equal (format-spec--do-flags "" flags 1 nil) " ")) (should (equal (format-spec--do-flags "a" flags 0 nil) "a")) diff --git a/test/lisp/ls-lisp-tests.el b/test/lisp/ls-lisp-tests.el index e3a75bed41..9f2c63225b 100644 --- a/test/lisp/ls-lisp-tests.el +++ b/test/lisp/ls-lisp-tests.el @@ -54,7 +54,8 @@ (kill-buffer buf) (setq buf (dired (nconc (list dir) files))) (should (looking-at "src")) - (next-line) ; File names must be aligned. + (with-suppressed-warnings ((interactive-only next-line)) + (next-line)) ; File names must be aligned. (should (looking-at "src"))) (when (buffer-live-p buf) (kill-buffer buf))))) diff --git a/test/lisp/obsolete/cl-tests.el b/test/lisp/obsolete/cl-tests.el index 0e02e1ca1b..0b8c1178f3 100644 --- a/test/lisp/obsolete/cl-tests.el +++ b/test/lisp/obsolete/cl-tests.el @@ -27,10 +27,15 @@ +;; Hack to work around the ERT limitation that we can't reliably use +;; `with-suppressed-warnings' inside an `ert-deftest'. (Bug#36568) +(defun cl-tests-labels-test () + (with-suppressed-warnings ((obsolete labels)) + (funcall (labels ((foo () t)) + #'foo)))) + (ert-deftest labels-function-quoting () "Test that #'foo does the right thing in `labels'." ; Bug#31792. - (should (eq (funcall (labels ((foo () t)) - #'foo)) - t))) + (should (eq (cl-tests-labels-test) t))) ;;; cl-tests.el ends here diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index 63bae79bb4..9dc5e8cadc 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -438,7 +438,8 @@ to (xref-elisp-test-descr-to-target xref)." ;; track down the problem. (cl-defmethod xref-elisp-generic-no-default ((this xref-elisp-root-type) arg2) "Doc string generic no-default xref-elisp-root-type." - "non-default for no-default") + "non-default for no-default" + (list this arg2)) ; silence byte-compiler ;; defgeneric after defmethod in file to ensure the fallback search ;; method of just looking for the function name will fail. @@ -463,19 +464,23 @@ to (xref-elisp-test-descr-to-target xref)." (cl-defmethod xref-elisp-generic-separate-default (arg1 arg2) "Doc string generic separate-default default." - "separate default") + "separate default" + (list arg1 arg2)) ; silence byte-compiler (cl-defmethod xref-elisp-generic-separate-default ((this xref-elisp-root-type) arg2) "Doc string generic separate-default xref-elisp-root-type." - "non-default for separate-default") + "non-default for separate-default" + (list this arg2)) ; silence byte-compiler (cl-defmethod xref-elisp-generic-implicit-generic (arg1 arg2) "Doc string generic implicit-generic default." - "default for implicit generic") + "default for implicit generic" + (list arg1 arg2)) ; silence byte-compiler (cl-defmethod xref-elisp-generic-implicit-generic ((this xref-elisp-root-type) arg2) "Doc string generic implicit-generic xref-elisp-root-type." - "non-default for implicit generic") + "non-default for implicit generic" + (list this arg2)) ; silence byte-compiler (xref-elisp-deftest find-defs-defgeneric-no-methods @@ -845,7 +850,8 @@ to (xref-elisp-test-descr-to-target xref)." (if (stringp form) (insert form) (pp form (current-buffer))) - (font-lock-debug-fontify) + (with-suppressed-warnings ((interactive-only font-lock-debug-fontify)) + (font-lock-debug-fontify)) (goto-char (point-min)) (and (re-search-forward search nil t) (get-text-property (match-beginning 1) 'face)))) diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el index 7f62a417a0..dcd5ebb1fe 100644 --- a/test/lisp/replace-tests.el +++ b/test/lisp/replace-tests.el @@ -599,11 +599,12 @@ bound to HIGHLIGHT-LOCUS." (with-temp-buffer (insert before) (goto-char (point-min)) - (replace-regexp - "\\(\\(L\\)\\|\\(R\\)\\)" - '(replace-eval-replacement - replace-quote - (if (match-string 2) "R" "L"))) + (with-suppressed-warnings ((interactive-only replace-regexp)) + (replace-regexp + "\\(\\(L\\)\\|\\(R\\)\\)" + '(replace-eval-replacement + replace-quote + (if (match-string 2) "R" "L")))) (should (equal (buffer-string) after))))) (ert-deftest test-count-matches () diff --git a/test/lisp/ses-tests.el b/test/lisp/ses-tests.el index 9a7fb502d7..932291afcc 100644 --- a/test/lisp/ses-tests.el +++ b/test/lisp/ses-tests.el @@ -24,6 +24,10 @@ (require 'ert) (require 'ses) +;; Silence byte-compiler. +(with-suppressed-warnings ((lexical A2) (lexical A3)) + (defvar A2) + (defvar A3)) ;; PLAIN FORMULA TESTS ;; ====================================================================== diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index e02de952f2..063c6fe6a7 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -926,6 +926,7 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." (should-not (apropos-internal "^next-line$" #'keymapp))) +(defvar test-global-boundp) (ert-deftest test-buffer-local-boundp () (let ((buf (generate-new-buffer "boundp"))) (with-current-buffer buf diff --git a/test/lisp/tar-mode-tests.el b/test/lisp/tar-mode-tests.el index 6964d42318..dd430cac2f 100644 --- a/test/lisp/tar-mode-tests.el +++ b/test/lisp/tar-mode-tests.el @@ -24,6 +24,12 @@ (defvar tar-mode-tests-data-directory (expand-file-name "test/data/decompress" source-directory)) +;; Hack to work around the ERT limitation that we can't reliably use +;; `with-suppressed-warnings' inside an `ert-deftest'. (Bug#36568) +(defun tar-mode-tests--tar-grind-file-mode (&rest args) + (with-suppressed-warnings ((obsolete tar-grind-file-mode)) + (apply #'tar-grind-file-mode args))) + (ert-deftest tar-mode-test-tar-grind-file-mode () (let ((alist (list (cons 448 "rwx------") (cons 420 "rw-r--r--") @@ -32,7 +38,7 @@ (cons 1024 "-----S---") (cons 2048 "--S------")))) (dolist (x alist) - (should (equal (cdr x) (tar-grind-file-mode (car x))))))) + (should (equal (cdr x) (tar-mode-tests--tar-grind-file-mode (car x))))))) (ert-deftest tar-mode-test-tar-extract-gz () (skip-unless (executable-find "gzip")) diff --git a/test/src/data-tests.el b/test/src/data-tests.el index dfc12735bd..8cc271b9e1 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el @@ -433,26 +433,27 @@ comparing the subr with a much slower Lisp implementation." ;; More specifically, test the problem seen in bug#41029 where setting ;; the default value of a variable takes time proportional to the ;; number of buffers. - (let* ((fun #'error) - (test (lambda () - (with-temp-buffer - (let ((st (car (current-cpu-time)))) - (dotimes (_ 1000) - (let ((case-fold-search 'data-test)) - ;; Use an indirection through a mutable var - ;; to try and make sure the byte-compiler - ;; doesn't optimize away the let bindings. - (funcall fun))) - ;; FIXME: Handle the wraparound, if any. - (- (car (current-cpu-time)) st))))) - (_ (setq fun #'ignore)) - (time1 (funcall test)) - (bufs (mapcar (lambda (_) (generate-new-buffer " data-test")) - (make-list 1000 nil))) - (time2 (funcall test))) - (mapc #'kill-buffer bufs) - ;; Don't divide one time by the other since they may be 0. - (should (< time2 (* time1 5))))) + (when (fboundp 'current-cpu-time) ; silence byte-compiler + (let* ((fun #'error) + (test (lambda () + (with-temp-buffer + (let ((st (car (current-cpu-time)))) + (dotimes (_ 1000) + (let ((case-fold-search 'data-test)) + ;; Use an indirection through a mutable var + ;; to try and make sure the byte-compiler + ;; doesn't optimize away the let bindings. + (funcall fun))) + ;; FIXME: Handle the wraparound, if any. + (- (car (current-cpu-time)) st))))) + (_ (setq fun #'ignore)) + (time1 (funcall test)) + (bufs (mapcar (lambda (_) (generate-new-buffer " data-test")) + (make-list 1000 nil))) + (time2 (funcall test))) + (mapc #'kill-buffer bufs) + ;; Don't divide one time by the other since they may be 0. + (should (< time2 (* time1 5)))))) ;; More tests to write - ;; kill-local-variable diff --git a/test/src/search-tests.el b/test/src/search-tests.el index b7b4ab9a8f..b5f4730f26 100644 --- a/test/src/search-tests.el +++ b/test/src/search-tests.el @@ -28,7 +28,7 @@ (setq ov-set (make-overlay 3 5)) (overlay-put ov-set 'modification-hooks - (list (lambda (o after &rest _args) + (list (lambda (_o after &rest _args) (when after (let ((inhibit-modification-hooks t)) (save-excursion commit fef3e6006188d1ef2cdc70a45982d6aebb6ee722 Author: Stefan Kangas Date: Sat Dec 4 13:23:35 2021 +0100 * lisp/emacs-lisp/edebug.el (edebug-eval-defun): Minor doc fix. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 4f3c05baa9..1ef2959951 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -469,7 +469,7 @@ just FUNCTION is printed." (funcall orig-fun nil))) (defun edebug-eval-defun (edebug-it) - (declare (obsolete "use eval-defun or edebug--eval-defun instead" "28.1")) + (declare (obsolete "use `eval-defun' or `edebug--eval-defun' instead" "28.1")) (interactive "P") (if (advice-member-p #'edebug--eval-defun 'eval-defun) (eval-defun edebug-it) commit aa6681a51ad12e3fd8363febfbaacebe9dc06510 Author: Eli Zaretskii Date: Sat Dec 4 13:42:25 2021 +0200 Fix the MinGW build broken by recent changes in image.c * src/image.c (rsvg_handle_get_intrinsic_size_in_pixels) [WINDOWSNT]: Fix prototype. (Bug#44655) diff --git a/src/image.c b/src/image.c index c08ee92287..b85c405487 100644 --- a/src/image.c +++ b/src/image.c @@ -10067,7 +10067,7 @@ DEF_DLL_FN (void, rsvg_handle_set_dpi_x_y, (RsvgHandle * handle, double dpi_x, double dpi_y)); # if LIBRSVG_CHECK_VERSION (2, 52, 1) -DEF_DLL_FN (void, rsvg_handle_get_intrinsic_size_in_pixels, +DEF_DLL_FN (gboolean, rsvg_handle_get_intrinsic_size_in_pixels, (RsvgHandle *, gdouble *, gdouble *)); # endif # if LIBRSVG_CHECK_VERSION (2, 46, 0) commit 6d6d2b73d069d44a4f5c0dfa68f253777b0418fb Author: Stefan Kangas Date: Sat Dec 4 12:22:58 2021 +0100 ; Fix removal of obsolete newsticker function * lisp/net/newst-plainview.el (newsticker-close-buffer) (newsticker-mark-all-items-of-feed-as-read) (newsticker-mark-all-items-as-read): Use 'newsticker--cache-save' instead of removed obsolete function 'newsticker--cache-update'. * etc/NEWS: Don't mention obsolete internal variables. diff --git a/etc/NEWS b/etc/NEWS index 81fc26b147..ac1787d7f8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -771,10 +771,9 @@ Use 'exif-parse-file' and 'exif-field' instead. This change is now applied in 'dired-insert-directory'. ** Some functions and variables obsolete since Emacs 23 have been removed: -'find-emacs-lisp-shadows', 'newsticker--cache-read-version1', -'newsticker--cache-save-version1', 'newsticker--cache-update', -'newsticker-cache-filename', 'unify-8859-on-decoding-mode', -'unify-8859-on-encoding-mode', 'vc-arch-command'. +'find-emacs-lisp-shadows', 'newsticker-cache-filename', +'unify-8859-on-decoding-mode', 'unify-8859-on-encoding-mode', +'vc-arch-command'. * Lisp Changes in Emacs 29.1 diff --git a/lisp/net/newst-plainview.el b/lisp/net/newst-plainview.el index 420cf82e4d..82977b000b 100644 --- a/lisp/net/newst-plainview.el +++ b/lisp/net/newst-plainview.el @@ -589,7 +589,7 @@ calls `w3m-toggle-inline-image'. It works only if (defun newsticker-close-buffer () "Close the newsticker buffer." (interactive) - (newsticker--cache-update t) + (newsticker--cache-save) (bury-buffer)) (defun newsticker-next-new-item (&optional do-not-wrap-at-eob) @@ -748,7 +748,7 @@ Return new buffer position." (newsticker--cache-replace-age newsticker--cache feed 'new 'old) (newsticker--cache-replace-age newsticker--cache feed 'obsolete 'old) - (newsticker--cache-update) + (newsticker--cache-save) (newsticker--buffer-set-uptodate nil) (newsticker--ticker-text-setup) (newsticker-buffer-update) @@ -879,7 +879,7 @@ not get changed." (newsticker--cache-replace-age newsticker--cache 'any 'new 'old) (newsticker--buffer-set-uptodate nil) (newsticker--ticker-text-setup) - (newsticker--cache-update) + (newsticker--cache-save) (newsticker-buffer-update))) (defun newsticker-hide-extra () commit a1e30e41063c6c2068eed0dc69351c6e5d1704a6 Author: Stefan Kangas Date: Sat Dec 4 11:48:50 2021 +0100 ; Fix most remaining AUTHORS warnings * admin/authors.el (authors-ignored-files) (authors-renamed-files-alist): Further updates for Emacs 28. * ChangeLog.3: Further fixes. * etc/AUTHORS: Update accordingly. diff --git a/ChangeLog.3 b/ChangeLog.3 index fecad62af0..b149c8295b 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -83,7 +83,7 @@ * lisp/progmodes/gdb-mi.el (gdb-frame-handler): Protect against nil fullnames (bug#52196). -2021-11-30 YugaEgo (tiny change) +2021-11-30 Yuga Ego (tiny change) Format and index concept 'predicate' in ELisp Intro @@ -8597,7 +8597,7 @@ * lisp/net/rcirc.el (reconnect): Kill previous process and start a new one -2021-09-07 A +2021-09-07 Glenn Morris * test/lisp/vc/vc-tests.el (vc-test--version-diff): Git env tweak. @@ -11985,7 +11985,7 @@ Valid quoting in .desktop files - * etc/emacsclient.desktop, emacsclient-mail.desktop (Exec): Quote + * etc/emacsclient.desktop, etc/emacsclient-mail.desktop (Exec): Quote according to the rules in the Freedesktop.org Desktop Entry Specification. @@ -18217,7 +18217,7 @@ pulse-reset-face change -- reset back to the start face (bug#48936). -2021-06-13 dick +2021-06-13 dickmao Avoid an infinite loop in mml-expand-html-into-multipart-related @@ -58474,9 +58474,9 @@ Dictionary now uses button - * net/lisp/dictionary-link.el: Removed now obsolete file - * net/lisp/dictionary.el: Use insert-button and make-button - * net/lisp/dictionary.el (dictionary-mode-map): Now defined using defvar + * lisp/net/dictionary-link.el: Removed now obsolete file + * lisp/net/dictionary.el: Use insert-button and make-button + * lisp/net/dictionary.el (dictionary-mode-map): Now defined using defvar I had to add a conversion function as parameter for the button 'action as I need to be able to pass nil data to my function. This is not @@ -69091,7 +69091,7 @@ (macfont_glyph_extents): Fix monospace glyph computation. (macfont_shape): Ditto. -2020-08-12 Mingde (Matthew) Zeng +2020-08-12 Mingde Matthew Zeng Fix erc-reuse-buffers behavior diff --git a/admin/authors.el b/admin/authors.el index 9d72d8b6f4..adf6d22a88 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -396,8 +396,12 @@ Changes to files matching one of the regexps in this list are not listed.") "images/icons/allout-widgets-light-bg" "lisp/shorthand.el" "test/lisp/shorthand-tests.el" + "lisp/shorthands.el" + "test/src/comp-test-funcs.el" "lisp/net/link.el" "lisp/net/connection.el" + "lisp/net/dictionary-link.el" + "test/src/comp-test-funcs-dyn.el" ;; Never had any meaningful changes logged, now deleted: "lib/stdarg.in.h" "lib/stdbool.in.h" "unidata/bidimirror.awk" "unidata/biditype.awk" @@ -535,6 +539,8 @@ Changes to files matching one of the regexps in this list are not listed.") "lisp/org/ob-abc.el" "lisp/org/ob-ebnf.el" "lisp/org/ob-J.el" + ;; Removed -- for now. + "test/src/doc-tests.el" ) "List of files and directories to ignore. Changes to files in this list are not listed.") @@ -997,6 +1003,7 @@ in the repository.") ("DIFF" . "OTHER.EMACSES") ("CCADIFF" . "OTHER.EMACSES") ("GOSDIFF" . "OTHER.EMACSES") + ("emacs.appdata.xml" . "emacs.metainfo.xml") ;; Nextstep ("nextstep/Cocoa/Emacs.base/Contents/Info.plist" . "nextstep/templates/Info.plist.in") ;; Moved from lisp/tpu-doc.el to etc/tpu-edt.doc in Emacs 19.29. @@ -1051,6 +1058,12 @@ in the repository.") ("lisp/gnus/messcompat.el" . "messcompat.el") ("html2text.el" . "html2text.el") ("lisp/net/html2text.el" . "html2text.el") + ;; Obsolete in 28.1. + ("inversion.el" . "inversion.el") + ("test/lisp/cedet/inversion-tests.el" . "inversion-tests.el") + ("test/lisp/mail/rfc2368-tests.el" . "rfc2368-tests.el") + ;; This file was briefly obsolete: + ("lisp/obsolete/erc-compat.el" . "erc-compat.el") ;; From lisp to etc/forms. ("forms-d2.el" . "forms-d2.el") ("forms-pass.el" . "forms-pass.el") @@ -1193,8 +1206,12 @@ in the repository.") ("lisp/gnus/nnir.el" . "nnir.el") ("src/regex.c" . "emacs-regex.c") ("src/regex.h" . "emacs-regex.h") - ("erc-compat.el" . "erc-compat.el") - ("semantic-utest-fmt.el" . "format-tests.el") + ("test/manual/rmailmm.el" . "rmailmm-tests.el") + ("test/lisp/cedet/semantic-utest-fmt.el" . "format-tests.el") + ("test/lisp/emacs-lisp/tabulated-list-test.el" . "tabulated-list-tests.el") + ("test/lisp/url/url-handlers-test.el" . "url-handlers-tests.el") + ("test/src/dired-tests.el" . "dired-tests.el") + (".dir-locals.el" . ".dir-locals.el") ) "Alist of files which have been renamed during their lifetime. Elements are (OLDNAME . NEWNAME).") diff --git a/etc/AUTHORS b/etc/AUTHORS index 3e70cc6d35..60b1ee4bd0 100644 --- a/etc/AUTHORS +++ b/etc/AUTHORS @@ -257,8 +257,8 @@ Alyssa Ross: changed progmodes/compile.el simple.el Ami Fischman: changed bindings.el calendar.el diary-lib.el print.c savehist.el vc-git.el -Amin Bandali: changed erc.el erc-backend.el erc-button.el erc-track.el - erc-compat.el erc-dcc.el erc-desktop-notifications.el erc-match.el +Amin Bandali: changed erc.el erc-backend.el erc-button.el erc-compat.el + erc-track.el erc-dcc.el erc-desktop-notifications.el erc-match.el erc-services.el erc-speedbar.el erc-status-sidebar.el erc.texi erc-autoaway.el erc-fill.el erc-goodies.el erc-ibuffer.el erc-imenu.el erc-join.el erc-lang.el erc-list.el erc-log.el and 11 other files @@ -473,8 +473,8 @@ Artem Chuprina: changed message.el Artem Loenko: changed src/Makefile.in Arthur Miller: changed help-fns.el ange-ftp.el bytecomp.el comp.c comp.el - dired.c dired.el files.texi help.texi lisp.h ls-lisp.el sysdep.c - tramp-adb.el tramp-rclone.el tramp-sh.el tramp-smb.el tramp.el + dired-tests.el dired.c dired.el files.texi help.texi lisp.h ls-lisp.el + sysdep.c tramp-adb.el tramp-rclone.el tramp-sh.el tramp-smb.el tramp.el wdired.el Artur Malabarba: wrote char-fold-tests.el faces-tests.el isearch-tests.el @@ -1422,8 +1422,8 @@ Diane Murray: changed erc.el erc-backend.el erc-menu.el erc-button.el Dick R. Chiang: changed ffap-tests.el ffap.el gnus-group.el gnus.texi message.el bindings.el buffer-tests.el buffer.c checkdoc.el cl-macs-tests.el cl-macs.el comint-tests.el gnus-srvr.el gnus-sum.el - gnus-topic.el gnutls.c key.pub key.sec minibuffer.el misc.texi - package.el and 6 other files + gnus-topic.el gnutls.c key.pub key.sec minibuffer.el misc.texi mml.el + and 7 other files Didier Verna: wrote gnus-diary.el nndiary.el and co-wrote nnml.el @@ -2004,7 +2004,7 @@ and changed configure.ac Makefile.in src/Makefile.in calendar.el lisp/Makefile.in diary-lib.el files.el make-dist rmail.el progmodes/f90.el bytecomp.el admin.el misc/Makefile.in simple.el authors.el startup.el emacs.texi lib-src/Makefile.in display.texi - ack.texi subr.el and 1789 other files + ack.texi subr.el and 1790 other files Glynn Clements: wrote gamegrid.el snake.el tetris.el @@ -2899,7 +2899,7 @@ and co-wrote help-tests.el keymap-tests.el and changed subr.el desktop.el w32fns.c faces.el simple.el emacsclient.c files.el server.el bs.el help-fns.el xdisp.c org.el w32term.c w32.c buffer.c keyboard.c ido.el image.c window.c eval.c allout.el - and 1224 other files + and 1226 other files Juan Pechiar: changed ob-octave.el @@ -3303,7 +3303,7 @@ and co-wrote gnus-kill.el gnus-mh.el gnus-msg.el gnus-score.el and changed gnus.texi simple.el subr.el files.el process.c text.texi display.texi dired.el gnutls.c gnus-ems.el smtpmail.el help-fns.el auth-source.el url-http.el edebug.el gnus-cite.el image.el pop3.el - dired-aux.el fns.c image.c and 859 other files + dired-aux.el fns.c image.c and 860 other files Lars Rasmusson: changed ebrowse.c @@ -3977,6 +3977,8 @@ and changed comint.el faces.el simple.el editfns.c xfaces.c xdisp.c Milton Wulei: changed gdb-ui.el +Mingde Matthew Zeng: changed erc-join.el erc.el + Mirek Kaim: changed configure.ac Mirko Vukovic: changed emacs.texi maintaining.texi @@ -4130,7 +4132,7 @@ and changed README authors.el configure.ac sed2v2.inp sequences.texi README.W32 emacs.png HISTORY emacs23.png arc-mode.el cl-extra.el emacs.svg manoj-dark-theme.el Emacs.icns Makefile.in auth-source.el emacs.ico fns.c make-tarball.txt obarray-tests.el obarray.el - and 36 other files + and 37 other files Nicolas Richard: wrote cl-seq-tests.el cmds-tests.el replace-tests.el and changed ffap.el package.el byte-run.el help.el keyboard.c landmark.el @@ -4422,8 +4424,8 @@ Peter Münster: changed image-dired.el gnus-delay.el gnus-demon.el Peter O'Gorman: changed configure.ac frame.h hpux10-20.h termhooks.h -Peter Oliver: changed emacsclient.desktop Makefile.in emacs-mail.desktop - emacsclient-mail.desktop server.el configure.ac emacs.desktop +Peter Oliver: changed emacsclient.desktop emacsclient-mail.desktop + Makefile.in emacs-mail.desktop server.el configure.ac emacs.desktop emacs.metainfo.xml misc.texi perl-mode.el ruby-mode-tests.el vc-sccs.el Peter Povinec: changed term.el @@ -4746,7 +4748,7 @@ Robert Cochran: changed tab-bar.el bytecomp.el checkdoc.el data.c Robert Fenk: changed desktop.el -Robert Jarzmik: changed ede/linux.el +Robert Jarzmik: changed ede/linux.el inversion.el Robert J. Chassell: wrote makeinfo.el page-ext.el texinfo.el texnfo-upd.el @@ -5162,7 +5164,7 @@ and changed efaq.texi checkdoc.el package.el cperl-mode.el bookmark.el help.el keymap.c subr.el simple.el erc.el ediff-util.el idlwave.el time.el bytecomp-tests.el comp.el speedbar.el bytecomp.el emacs-lisp-intro.texi flyspell.el ibuffer.el package-tests.el - and 1333 other files + and 1337 other files Stefan Merten: co-wrote rst.el @@ -5179,7 +5181,7 @@ and co-wrote font-lock.el gitmerge.el pcvs.el and changed subr.el simple.el keyboard.c bytecomp.el cl-macs.el files.el lisp.h vc.el xdisp.c alloc.c eval.c sh-script.el progmodes/compile.el keymap.c buffer.c window.c tex-mode.el lisp-mode.el newcomment.el - help-fns.el lread.c and 1615 other files + help-fns.el lread.c and 1616 other files Stefano Facchini: changed gtkutil.c @@ -5984,6 +5986,8 @@ Yuchen Pei: changed calendar.texi diary-lib.el icalendar-tests.el Yue Daian: wrote cl-font-lock.el +Yuga Ego: changed emacs-lisp-intro.texi + Yu-ji Hosokawa: changed README.W32 Yukihiro Matsumoto: co-wrote ruby-mode.el commit 796075ef7e1c7a294fe8c3c36c999c10c2f09d38 Author: Alan Third Date: Fri Dec 3 22:17:45 2021 +0000 Make use of Trash on macOS (bug#21340) * src/nsfns.m (Fsystem_move_file_to_trash): New function. diff --git a/src/nsfns.m b/src/nsfns.m index c2791aa15a..81019fce09 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -2362,6 +2362,47 @@ Frames are listed from topmost (first) to bottommost (last). */) ========================================================================== */ +#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 +/* Moving files to the system recycle bin. + Used by `move-file-to-trash' instead of the default moving to ~/.Trash */ +DEFUN ("system-move-file-to-trash", Fsystem_move_file_to_trash, + Ssystem_move_file_to_trash, 1, 1, 0, + doc: /* Move file or directory named FILENAME to the recycle bin. */) + (Lisp_Object filename) +{ + Lisp_Object handler; + Lisp_Object operation; + + operation = Qdelete_file; + if (!NILP (Ffile_directory_p (filename)) + && NILP (Ffile_symlink_p (filename))) + { + operation = intern ("delete-directory"); + filename = Fdirectory_file_name (filename); + } + + /* Must have fully qualified file names for moving files to Trash. */ + filename = Fexpand_file_name (filename, Qnil); + + handler = Ffind_file_name_handler (filename, operation); + if (!NILP (handler)) + return call2 (handler, operation, filename); + else + { + NSFileManager *fm = [NSFileManager defaultManager]; + BOOL result = NO; + NSURL *fileURL = [NSURL fileURLWithPath:[NSString stringWithLispString:filename] + isDirectory:!NILP (Ffile_directory_p (filename))]; + if ([fm respondsToSelector:@selector(trashItemAtURL:resultingItemURL:error:)]) + result = [fm trashItemAtURL:fileURL resultingItemURL:nil error:nil]; + + if (!result) + report_file_error ("Removing old name", list1 (filename)); + } + return Qnil; +} +#endif + DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, doc: /* SKIP: real doc in xfns.c. */) (Lisp_Object color, Lisp_Object frame) @@ -3243,6 +3284,10 @@ - (Lisp_Object)lispString defsubr (&Sx_show_tip); defsubr (&Sx_hide_tip); +#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + defsubr (&Ssystem_move_file_to_trash); +#endif + as_status = 0; as_script = Qnil; staticpro (&as_script); commit 16b8741556837a5074480f4dc6f480907b7761c5 Author: Stefan Kangas Date: Sat Dec 4 11:33:43 2021 +0100 ; Silence byte-compiler warning in test * test/lisp/dired-aux-tests.el (dired-test-bug28834): Silence byte-compiler. diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el index 374164f1f9..69fc95ba55 100644 --- a/test/lisp/dired-aux-tests.el +++ b/test/lisp/dired-aux-tests.el @@ -64,7 +64,7 @@ (ert-deftest dired-test-bug28834 () "test for https://debbugs.gnu.org/28834 ." - (let (from to-cp to-mv) + (let (to-cp to-mv) ;; `dired-create-destination-dirs' set to 'always. (with-dired-bug28834-test 'always nil commit f3e6a432c5900c7e24ebd33711ec7a1d825f1a52 Author: Eli Zaretskii Date: Sat Dec 4 11:11:08 2021 +0200 ; * doc/misc/efaq.texi (New in Emacs 28): Add more news. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 40d8e9e066..24bee6ad04 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -934,7 +934,7 @@ file (@kbd{C-h n}) for the full list of changes in Emacs 28. @item Emacs now optionally supports native compilation of Lisp files. This can improves performance significantly in some cases. To enable this, -configure Emacs with the '--with-native-compilation' option. +configure Emacs with the @option{--with-native-compilation} option. @item The new NonGNU ELPA archive is enabled by default alongside GNU ELPA. @@ -944,6 +944,13 @@ by the @code{list-packages} command. @item The Cairo graphics library is now used by default if present. +@item +On GNU/Linux, Emacs now supports loading Secure Computing filters. To +use this feature, invoke Emacs with the @option{--seccomp=@var{file}} +command-line switch, where @var{file} names a binary file that defines +the filtering. See the manual page of the @code{seccomp} system call +for more details. + @item The new themes @samp{modus-vivendi} and @samp{modus-operandi} have been added. They are designed to conform with the highest standard @@ -957,10 +964,50 @@ sequences by default, provided that a suitable font is available. New system for displaying documentation for groups of functions (@kbd{M-x shortdoc-display-group RET}). +@item +Emacs can now support 24-bit color text-mode terminals even if their +terminfo database doesn't state this support in a standard way. Set +the @env{COLORTERM} environment variable to the value @samp{truecolor} +to activate this. + +@item +The @code{strike-through} face attribute is now supported on capable +text-mode terminals. + +@item +@code{xterm-mouse-mode} supports TTY menus. + +@item +A new minor mode @code{context-menu-mode} causes @code{mouse-3} +(a.k.a.@: ``right-clicks'') of the mouse to pop up context-dependent +menus. + +@item +Prefix commands to control the display of the results of the next +command. @kbd{C-x 4 4 @var{command}} displays the result of +@var{command} in a new window. @kbd{C-x 5 5 @var{command}} displays +the results of @var{command} in a new frame. + +@item +Emacs now supports ``transient'' input methods. A transient input +method is enabled for inserting a single character, and is then +automatically disabled. Select a transient input method with @kbd{C-u +C-x \}; enable it (for inserting a single character) with @kbd{C-x \}. +New input methods @code{compose} (based on X Window System Multi_key +sequences) and @code{iso-transl} are especially convenient with this +feature, when you need to insert a single special character. + +@item +@kbd{M-y}, when invoked after a command that is not a yank command, +allows selection of one of the previous kills. + +@item +New minor mode @code{repeat-mode} allows to repeat commands with fewer +keystrokes. + @item Among the many internal changes in this release, we would like to highlight that all files in the tree now use @code{lexical-binding}. - @end itemize commit 3e7aff5fcdd3fa6e30497323c914f6c79c951ed6 Author: Eli Zaretskii Date: Sat Dec 4 10:37:40 2021 +0200 Yet another place inside redisplay_window to prevent quitting * src/xdisp.c (handle_single_display_spec): Inhibit quitting around the call to 'lookup_derived_face' (which can QUIT). (Bug#44448) diff --git a/src/xdisp.c b/src/xdisp.c index 9f93799783..7ca3977200 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5822,8 +5822,15 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, if (CONSP (XCDR (XCDR (spec)))) { Lisp_Object face_name = XCAR (XCDR (XCDR (spec))); - int face_id2 = lookup_derived_face (it->w, it->f, face_name, - FRINGE_FACE_ID, false); + int face_id2; + /* Don't allow quitting from lookup_derived_face, for when + we are displaying a non-selected window, and the buffer's + point was temporarily moved to the window-point. */ + ptrdiff_t count1 = SPECPDL_INDEX (); + specbind (Qinhibit_quit, Qt); + face_id2 = lookup_derived_face (it->w, it->f, face_name, + FRINGE_FACE_ID, false); + unbind_to (count1, Qnil); if (face_id2 >= 0) face_id = face_id2; } commit 00236cc802a22555ad0299546a48420cbfbaaed5 Author: Eli Zaretskii Date: Sat Dec 4 10:19:56 2021 +0200 Fix the enumeration values returned by 'try_scrolling' * src/xdisp.c (try_scrolling): Make the enum values match the commentary. Reported by Po Lu . diff --git a/src/xdisp.c b/src/xdisp.c index 4642541823..527a79b38d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -17422,9 +17422,9 @@ cursor_row_fully_visible_p (struct window *w, bool force_p, enum { - SCROLLING_SUCCESS, - SCROLLING_FAILED, - SCROLLING_NEED_LARGER_MATRICES + SCROLLING_SUCCESS = 1, + SCROLLING_FAILED = 0, + SCROLLING_NEED_LARGER_MATRICES = -1 }; /* If scroll-conservatively is more than this, never recenter.