[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/pgtk 1710fca: Merge remote-tracking branch 'origin/master' into
From: |
Po Lu |
Subject: |
feature/pgtk 1710fca: Merge remote-tracking branch 'origin/master' into feature/pgtk |
Date: |
Sat, 4 Dec 2021 22:30:27 -0500 (EST) |
branch: feature/pgtk
commit 1710fca446650b25c9656f2a6131785581afa22e
Merge: 360d2d3 8bdea76
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Merge remote-tracking branch 'origin/master' into feature/pgtk
---
doc/lispref/frames.texi | 9 +-
doc/misc/erc.texi | 28 +++-
doc/misc/eshell.texi | 339 +++++++++++++++++++++++++++++++++++---
lisp/emacs-lisp/package.el | 18 +-
lisp/frame.el | 11 +-
lisp/help.el | 3 +-
lisp/mwheel.el | 2 +-
lisp/pixel-scroll.el | 36 ++--
lisp/startup.el | 11 +-
test/lisp/emacs-lisp/seq-tests.el | 24 ++-
10 files changed, 408 insertions(+), 73 deletions(-)
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 1dfd0d4..3c0bf64 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
diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi
index 49ad795..6631d84 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.
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index c01ceb5..ef82c88 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
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 08dfe50..66bbd63 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.
diff --git a/lisp/frame.el b/lisp/frame.el
index f790fa1..00a60e5 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.")
diff --git a/lisp/help.el b/lisp/help.el
index adb2bd8..eb0a782 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))
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index 3458fb6..fbe8daa 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -255,7 +255,7 @@ Also see `mouse-wheel-tilt-scroll'."
(if (featurep 'xinput2)
'wheel-left
(unless (featurep 'x)
- 'mouse-8))
+ 'mouse-6))
"Alternative wheel left event to consider.")
(defvar mouse-wheel-right-event
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index ce2aee6..5d6836c 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."
diff --git a/lisp/startup.el b/lisp/startup.el
index 5d2d830..ab40d02 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)
@@ -1651,7 +1652,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)
diff --git a/test/lisp/emacs-lisp/seq-tests.el
b/test/lisp/emacs-lisp/seq-tests.el
index 8cfa3bd..4b940af 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))