diff --git a/CONTRIBUTE b/CONTRIBUTE
index 9b2af9ccf131..bbf52628620c 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -66,11 +66,15 @@ more reliably, and makes the job of applying the patches easier and less
error-prone. It also allows sending patches whose author is someone
other than the email sender.
-Once the cumulative amount of your submissions exceeds about 15 lines
-of non-trivial code, we will need you to assign to the FSF the
-copyright for your contributions. Ask on emacs-devel@gnu.org, and we
-will send you the necessary form together with the instructions to
-fill and email it, in order to start this legal paperwork.
+Once the cumulative amount of your submissions exceeds a dozen or so
+lines of non-trivial changes, we will need you to assign to the FSF
+the copyright for your contributions. (To see how many lines were
+non-trivially changed, count only added and modified lines in the
+patched code. Consider an added or changed line non-trivial if it
+includes at least one identifier, string, or substantial comment.)
+Ask on emacs-devel@gnu.org, and we will send you the necessary form
+together with the instructions to fill and email it, in order to start
+this legal paperwork.
** Issue tracker (a.k.a. "bug tracker")
diff --git a/admin/cus-test.el b/admin/cus-test.el
index afd5f4ceaeca..30b5f6556170 100644
--- a/admin/cus-test.el
+++ b/admin/cus-test.el
@@ -37,6 +37,13 @@
;;
;; src/emacs -batch -l admin/cus-test.el -f cus-test-noloads
;;
+;; or as a part of the test suite with
+;;
+;; make -C test test-custom-opts
+;; make -C test test-custom-deps
+;; make -C test test-custom-libs
+;; make -C test test-custom-noloads
+;;
;; in the emacs source directory.
;;
;; For interactive use: Load this file. Then
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index 34d12acc3496..f57606dc799a 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -129,6 +129,12 @@ options (that is, single characters) requiring no arguments, and long
options (starting with @samp{--}) whose arguments are specified with
@samp{=}.
+ Dired does not handle files that have names with embedded newline
+characters well. If you have many such files, you may consider adding
+@samp{-b} to @code{dired-listing-switches}. This will quote all
+special characters and allow Dired to handle them better. (You can
+also use the @kbd{C-u C-x d} command to add @samp{-b} temporarily.)
+
@vindex dired-switches-in-mode-line
Dired displays in the mode line an indication of what were the
switches used to invoke @command{ls}. By default, Dired will try to
diff --git a/doc/emacs/m-x.texi b/doc/emacs/m-x.texi
index c51f10a47aaf..d35a83515414 100644
--- a/doc/emacs/m-x.texi
+++ b/doc/emacs/m-x.texi
@@ -58,6 +58,14 @@ Modes}). By default, no commands are excluded, but you can customize
the option @code{read-extended-command-predicate} to exclude those
irrelevant commands from completion results.
+@kindex M-S-x
+ Conversely, Emacs can exclude all commands except those that are
+particularly relevant to the current buffer. The @kbd{M-S-x} (that's
+``meta shift x'') command works just like @kbd{M-x}, but instead of
+listing all (or most) of the commands Emacs knows about, it will only
+list the commands that have been marked as ``belonging'' to the
+current major mode, or any enabled minor modes.
+
To cancel the @kbd{M-x} and not run a command, type @kbd{C-g} instead
of entering the command name. This takes you back to command level.
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 1ad2df95919c..8199ece11016 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -493,7 +493,10 @@ I/O.
Point and the mark, as two numeric arguments, smallest first. This is
the only code letter that specifies two successive arguments rather than
one. This will signal an error if the mark is not set in the buffer
-which is current when the command is invoked. No I/O.
+which is current when the command is invoked. If Transient Mark mode
+is turned on (@pxref{The Mark}) --- as it is by default --- and user
+option @code{mark-even-if-inactive} is @code{nil}, Emacs will signal
+an error even if the mark @emph{is} set, but is inactive. No I/O.
@item s
Arbitrary text, read in the minibuffer and returned as a string
@@ -848,6 +851,15 @@ non-@code{nil} if the command is to be included when completing in
that buffer.
@end deffn
+@deffn Command execute-extended-command-for-buffer prefix-argument
+This is like @code{execute-extended-command}, but limits the commands
+offered for completion to those commands that are of particular
+relevance to the current major mode (and enabled minor modes). This
+includes commands that are tagged with the modes (@pxref{Using
+Interactive}), and also commands that are bound to locally active
+keymaps.
+@end deffn
+
@node Distinguish Interactive
@section Distinguish Interactive Calls
@cindex distinguish interactive calls
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 93e935ccf866..131ad2d9c87f 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1997,7 +1997,7 @@ the beginning of the result if a multi-column character in
If @var{ellipsis} is non-@code{nil}, it should be a string which will
replace the end of @var{string} when it is truncated. In this case,
-more charcaters will be removed from @var{string} to free enough space
+more characters will be removed from @var{string} to free enough space
for @var{ellipsis} to fit within @var{width} columns. However, if
the display width of @var{string} is less than the display width of
@var{ellipsis}, @var{ellipsis} will not be appended to the result. If
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 1e3da8e3a5db..2a9b57f19f33 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -861,6 +861,10 @@ This function returns @var{argument} and has no side effects.
@defun ignore &rest arguments
This function ignores any @var{arguments} and returns @code{nil}.
+@end defun
+
+@defun always &rest arguments
+This function ignores any @var{arguments} and returns @code{t}.
@end defun
Some functions are user-visible @dfn{commands}, which can be called
diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi
index b39373f07271..80f79b67e523 100644
--- a/doc/lispref/markers.texi
+++ b/doc/lispref/markers.texi
@@ -609,8 +609,8 @@ the function @code{use-region-p} for that (@pxref{The Region}).
@defvarx deactivate-mark-hook
These normal hooks are run, respectively, when the mark becomes active
and when it becomes inactive. The hook @code{activate-mark-hook} is
-also run at the end of the command loop if the mark is active and it
-is possible that the region may have changed.
+also run when the region is reactivated, for instance after using a
+command that switches back to a buffer that has an active mark.
@ignore
This piece of command_loop_1, run unless deactivating the mark:
if (current_buffer != prev_buffer || MODIFF != prev_modiff)
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 0c74dbe2aa49..545fd408f88c 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -609,7 +609,7 @@ returned value is a list.
(seq-map-indexed (lambda (elt idx)
(list idx elt))
'(a b c))
-@result{} ((0 a) (b 1) (c 2))
+@result{} ((0 a) (1 b) (2 c))
@end group
@end example
@end defun
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index f305d1a8ee87..c32d711f12a1 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -2557,7 +2557,7 @@ frame visible and, unless @var{alist} contains an
This function tries to display @var{buffer} by finding a window
that is displaying a buffer in a given mode.
-If @var{alist} contains a @code{mode} entry, its value specifes a
+If @var{alist} contains a @code{mode} entry, its value specifies a
major mode (a symbol) or a list of major modes. If @var{alist}
contains no @code{mode} entry, the current major mode of @var{buffer}
is used instead. A window is a candidate if it displays a buffer
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index f26ae6377885..53a3af4b782f 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -323,8 +323,8 @@ Free Software Foundation, and related organizations.
@menu
* Real meaning of copyleft::
-* Guidelines for newsgroup postings::
-* Newsgroup archives::
+* Guidelines for mailing list postings::
+* Mailing list archives::
* Reporting bugs::
* Unsubscribing from Emacs lists::
* Contacting the FSF::
@@ -343,9 +343,10 @@ There has never been a copyright infringement case involving the GPL to
set any precedents. Although legal actions have been brought against
companies for violating the terms of the GPL, so far all have been
settled out of court (in favor of the plaintiffs). Please take any
-discussion regarding this issue to the newsgroup
-@uref{news:gnu.misc.discuss}, which was created to hold the extensive
-flame wars on the subject.
+discussion regarding this issue to
+@uref{https://lists.gnu.org/mailman/listinfo/gnu-misc-discuss, the
+gnu-misc-discuss mailing list}, which was created to hold the
+extensive flame wars on the subject.
RMS writes:
@@ -359,49 +360,60 @@ distribute any version of Emacs or a related program, and give the
recipients the same freedom that you enjoyed.
@end quotation
-@node Guidelines for newsgroup postings
-@section What are appropriate messages for the various Emacs newsgroups?
+@node Guidelines for mailing list postings
+@section What are appropriate messages for the various Emacs mailing lists?
@cindex Newsgroups, appropriate messages for
@cindex GNU newsgroups, appropriate messages for
+@cindex GNU mailing lists, appropriate messages for
@cindex Usenet groups, appropriate messages for
@cindex Mailing lists, appropriate messages for
-@cindex Posting messages to newsgroups
+@cindex Posting messages to mailing lists
@cindex GNU mailing lists
The Emacs mailing lists are described at
@uref{https://savannah.gnu.org/mail/?group=emacs, the Emacs Savannah
-page}. Some of them are gatewayed to newsgroups.
-
-The newsgroup @uref{news:comp.emacs} is for discussion of Emacs programs
-in general. The newsgroup @uref{news:gnu.emacs.help} is specifically
-for GNU Emacs. It therefore makes no sense to cross-post to both
-groups, since only one can be appropriate to any question.
-
-Messages advocating ``non-free'' software are considered unacceptable on
-any of the @code{gnu.*} newsgroups except for @uref{news:gnu.misc.discuss},
-which was created to hold the extensive flame-wars on the subject.
-``Non-free'' software includes any software for which the end user can't
-freely modify the source code and exchange enhancements. Be careful to
-remove the @code{gnu.*} groups from the @samp{Newsgroups:} line when
-posting a followup that recommends such software.
-
-@uref{news:gnu.emacs.bug} is a place where bug reports appear, but avoid
-posting bug reports to this newsgroup directly (@pxref{Reporting bugs}).
-
-@node Newsgroup archives
-@section Where can I get old postings to @uref{news:gnu.emacs.help} and other GNU groups?
-@cindex Archived postings from @code{gnu.emacs.help}
-@cindex Usenet archives for GNU groups
-@cindex Old Usenet postings for GNU groups
+page}.
+
+Messages advocating ``non-free'' software are considered unacceptable
+on any of the GNU mailing lists, except for
+@url{https://lists.gnu.org/mailman/listinfo/gnu-misc-discuss, the
+gnu-misc-discuss mailing list} which was created to hold the extensive
+flame-wars on the subject.
+
+``Non-free'' software includes any software for which the end user
+can't freely modify the source code and exchange enhancements. Be
+careful to remove any GNU mailing lists from @samp{Cc:} when posting a
+reply that recommends such software.
+
+@url{https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs, The
+bug-gnu-emacs list} is a place where bug reports appear, but we
+recommend using the commands @kbd{M-x report-emacs-bug} or @kbd{M-x
+submit-emacs-patch} if at all possible (@pxref{Reporting bugs}).
+
+Some GNU mailing lists are gatewayed to (Usenet) newsgroups.
+For example, sending an email to
+@url{https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs, The
+bug-gnu-emacs list} has the effect of posting on the newsgroup
+@uref{news:gnu.emacs.help}).
+
+Finally, we recommend reading the
+@url{https://www.gnu.org/philosophy/kind-communication.html, GNU Kind
+Communications Guidelines} before posting to any GNU lists or
+newsgroups.
+
+@node Mailing list archives
+@section Where can I read archives for @code{help-gnu-emacs} and other GNU lists?
+@cindex Archived postings from @code{help-gnu-emacs}
+@cindex Old mailing list posts for GNU lists
+@cindex Mailing list archives for GNU lists
The FSF has maintained archives of all of the GNU mailing lists for many
years, although there may be some unintentional gaps in coverage. The
archive can be browsed over the web at
@uref{https://lists.gnu.org/r/, the GNU mail archive}.
-Web-based Usenet search services, such as
-@uref{https://groups.google.com/groups/dir?q=gnu&, Google}, also
-archive the @code{gnu.*} groups.
+Some web-based Usenet search services also archive the @code{gnu.*}
+newsgroups.
@node Reporting bugs
@section Where should I report bugs and other problems with Emacs?
@@ -414,39 +426,25 @@ The correct way to report Emacs bugs is to use the command
@kbd{M-x report-emacs-bug}. It sets up a mail buffer with the
essential information and the correct e-mail address,
@email{bug-gnu-emacs@@gnu.org}.
-Anything sent there also appears in the
-newsgroup @uref{news:gnu.emacs.bug}, but please use e-mail instead of
-news to submit the bug report. This ensures a reliable return address
-so you can be contacted for further details.
Be sure to read the ``Bugs'' section of the Emacs manual before reporting
a bug! The manual describes in detail how to submit a useful bug
report (@pxref{Bugs, , Reporting Bugs, emacs, The GNU Emacs Manual}).
(@xref{Emacs manual}, if you don't know how to read the manual.)
-RMS says:
-
-@quotation
Sending bug reports to
-@url{https://lists.gnu.org/mailman/listinfo/help-gnu-emacs,
-the help-gnu-emacs mailing list}
-(which has the effect of posting on @uref{news:gnu.emacs.help}) is
-undesirable because it takes the time of an unnecessarily large group
-of people, most of whom are just users and have no idea how to fix
-these problem.
-@url{https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs, The
-bug-gnu-emacs list} reaches a much smaller group of people who are
+@url{https://lists.gnu.org/mailman/listinfo/help-gnu-emacs, the
+help-gnu-emacs mailing list} is undesirable because it takes the time
+of an unnecessarily large group of people, most of whom are just users
+and have no idea how to fix these
+problem. @url{https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs,
+The bug-gnu-emacs list} reaches a much smaller group of people who are
more likely to know what to do and have expressed a wish to receive
more messages about Emacs than the others.
-@end quotation
-
-RMS says it is sometimes fine to post to @uref{news:gnu.emacs.help}:
-@quotation
If you have reported a bug and you don't hear about a possible fix,
then after a suitable delay (such as a week) it is okay to post on
-@code{gnu.emacs.help} asking if anyone can help you.
-@end quotation
+@code{help-gnu-emacs@@gnu.org} asking if anyone can help you.
If you are unsure whether you have found a bug, consider the following
non-exhaustive list, courtesy of RMS:
@@ -458,6 +456,11 @@ is a bug. If Lisp code does not do what the documentation says it
does, that is a bug.
@end quotation
+Anything sent to @email{bug-gnu-emacs@@gnu.org} also appears in the
+newsgroup @uref{news:gnu.emacs.bug}, but please use e-mail instead of
+news to submit the bug report. This ensures a reliable return address
+so you can be contacted for further details.
+
@node Unsubscribing from Emacs lists
@section How do I unsubscribe from a mailing list?
@cindex Unsubscribing from GNU mailing lists
@@ -3526,10 +3529,8 @@ installing any nonfree software, we recommend for your freedom's sake
that you stay away from it.
The @uref{https://lists.gnu.org/mailman/listinfo/gnu-emacs-sources,
-GNU Emacs sources mailing list}, which is gatewayed to the
-@uref{news:gnu.emacs.sources, Emacs sources newsgroup} (although the
-connection between the two can be unreliable) is an official place
-where people can post or announce their extensions to Emacs.
+GNU Emacs sources mailing list} is an official place where people can
+post or announce their extensions to Emacs.
The @uref{https://emacswiki.org, Emacs Wiki} contains pointers to some
additional extensions. @uref{https://wikemacs.org, WikEmacs} is an
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 6d602157344b..e745af2a7de5 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -1927,6 +1927,25 @@ file, you must customize @code{ange-ftp-netrc-filename}:
(customize-set-variable 'ange-ftp-netrc-filename "~/.authinfo.gpg")
@end lisp
+In case you do not want to use an authentication file for
+@value{tramp} passwords, use connection-local variables
+@ifinfo
+(@pxref{Connection Variables, , , emacs})
+@end ifinfo
+like this:
+
+@lisp
+@group
+(connection-local-set-profile-variables
+ 'remote-without-auth-sources '((auth-sources . nil)))
+@end group
+
+@group
+(connection-local-set-profiles
+ '(:application tramp) 'remote-without-auth-sources)
+@end group
+@end lisp
+
@anchor{Caching passwords}
@subsection Caching passwords
@@ -2345,10 +2364,16 @@ fi
Another possibility is to check the environment variable
@env{INSIDE_EMACS}. Like for all subprocesses of Emacs, this is set
-to the version of the parent Emacs process, @xref{Interactive Shell, ,
-, emacs}. @value{tramp} adds its own package version to this string,
-which could be used for further tests in an inferior shell. The
-string of that environment variable looks always like
+to the version of the parent Emacs
+@ifinfo
+process, @xref{Interactive Shell, , , emacs}.
+@end ifinfo
+@ifnotinfo
+process.
+@end ifnotinfo
+@value{tramp} adds its own package version to this string, which could
+be used for further tests in an inferior shell. The string of that
+environment variable looks always like
@example
@group
@@ -3473,10 +3498,13 @@ uid=0(root) gid=0(root) groups=0(root)
@cindex @code{gdb}
@cindex @code{perldb}
-@file{gud.el} provides a unified interface to symbolic debuggers
+@file{gud.el} provides a unified interface to symbolic
@ifinfo
-(@ref{Debuggers, , , emacs}).
+debuggers (@pxref{Debuggers, , , emacs}).
@end ifinfo
+@ifnotinfo
+debuggers.
+@end ifnotinfo
@value{tramp} can run debug on remote hosts by calling @code{gdb}
with a remote file name:
@@ -3637,9 +3665,15 @@ minibuffer. Each connection is of the format
Flushing remote connections also cleans the password cache
(@pxref{Password handling}), file cache, connection cache
-(@pxref{Connection caching}), and recentf cache (@pxref{File
-Conveniences, , , emacs}). It also deletes session timers
-(@pxref{Predefined connection information}) and connection buffers.
+(@pxref{Connection caching}), and recentf
+@ifinfo
+cache (@pxref{File Conveniences, , , emacs}).
+@end ifinfo
+@ifnotinfo
+cache.
+@end ifnotinfo
+It also deletes session timers (@pxref{Predefined connection
+information}) and connection buffers.
If @var{keep-debug} is non-@code{nil}, the debug buffer is kept. A
non-@code{nil} @var{keep-password} preserves the password cache.
@@ -4544,10 +4578,16 @@ HISTFILE=/dev/null
@item
Where are remote files trashed to?
-Emacs can trash file instead of deleting them, @ref{Misc File Ops,
-Trashing , , emacs}. Remote files are always trashed to the local
-trash, except remote encrypted files (@pxref{Keeping files
-encrypted}), which are deleted anyway.
+Emacs can trash file instead of deleting
+@ifinfo
+them, @ref{Misc File Ops, Trashing , , emacs}.
+@end ifinfo
+@ifnotinfo
+them.
+@end ifnotinfo
+Remote files are always trashed to the local trash, except remote
+encrypted files (@pxref{Keeping files encrypted}), which are deleted
+anyway.
If Emacs is configured to use the XDG conventions for the trash
directory, remote files cannot be restored with the respective tools,
diff --git a/etc/NEWS b/etc/NEWS
index 7665d4740f9f..2411ddb830eb 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -251,6 +251,13 @@ commands. The new keystrokes are 'C-x x g' ('revert-buffer'),
* Editing Changes in Emacs 28.1
++++
+** New command 'execute-extended-command-for-buffer'.
+This new command, bound to 'M-S-x', works like
+'execute-extended-command', but limits the set of commands to the
+commands that have been determined to be particularly useful with the
+current mode.
+
+++
** New user option 'read-extended-command-predicate'.
This option controls how 'M-x' performs completion of commands when
@@ -479,6 +486,18 @@ independently from the value of 'tab-bar-mode' and 'tab-bar-show'.
---
*** New command 'tab-duplicate'.
+---
+*** 'Mod-9' bound to 'tab-last' now switches to the last tab.
+It also supports a negative argument.
+
+---
+*** 'C-x t N' creates a new tab at the specified absolute position.
+It also supports a negative argument.
+
+---
+*** 'C-x t M' moves the current tab to the specified absolute position.
+It also supports a negative argument.
+
---
*** New user option 'tab-bar-tab-name-format-function'.
@@ -1015,7 +1034,7 @@ separate buffer, or a tooltip.
*** New user option 'eldoc-documentation-strategy'.
The built-in choices available for this user option let users compose
the results of 'eldoc-documentation-functions' in various ways, even
-if some of those functions are sychronous and some asynchchronous.
+if some of those functions are synchronous and some asynchronous.
The user option replaces 'eldoc-documentation-function', which is now
obsolete.
@@ -2305,6 +2324,10 @@ back in Emacs 23.1. The affected functions are: 'make-obsolete',
* Lisp Changes in Emacs 28.1
++++
+** New function 'always'.
+This is identical to 'ignore', but returns t instead.
+
+++
** New forms to declare how completion should happen has been added.
'(declare (completion PREDICATE))' can be used as a general predicate
diff --git a/etc/NEWS.19 b/etc/NEWS.19
index f2cef62971bb..fd91c0842f73 100644
--- a/etc/NEWS.19
+++ b/etc/NEWS.19
@@ -4011,6 +4011,7 @@ The third component is now determined on the basis of the names of the
existing executable files. This means that version.el is not altered
by building Emacs.
+** New macro 'easy-menu-define'
* Changes in 19.22.
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 2cae8b92acec..2b9cbf37c456 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -747,7 +747,7 @@ removed.
For those who hate breaking changes, even though the changes are made
to clean things up; fear not. ATTACH_DIR will still continue to work.
It's just not documented any longer. When you get the chance, run the
-code above to clean things up anyways!
+code above to clean things up anyway!
**** New hooks
Two hooks are added to org-attach:
diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el
index e5bfccdb8ba4..44dc0351d454 100644
--- a/lisp/ansi-color.el
+++ b/lisp/ansi-color.el
@@ -429,7 +429,8 @@ being deleted."
;; positions that overlap regions previously colored; these
;; `codes' should not be applied to that overlap, so we need
;; to know where they should really start.
- (setq ansi-color-context-region (if codes (list codes end-marker)))))
+ (setq ansi-color-context-region
+ (if codes (list codes (copy-marker (point)))))))
;; Clean up our temporary markers.
(unless (eq start-marker (cadr ansi-color-context-region))
(set-marker start-marker nil))
diff --git a/lisp/battery.el b/lisp/battery.el
index 77ad73d15d7a..59f6987ad169 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -246,7 +246,7 @@ seconds."
(add-to-list 'global-mode-string 'battery-mode-line-string t)
(and (eq battery-status-function #'battery-upower)
battery-upower-subscribe
- (battery--upower-subsribe))
+ (battery--upower-subscribe))
(setq battery-update-timer (run-at-time nil battery-update-interval
#'battery-update-handler))
(battery-update))
@@ -634,7 +634,7 @@ Intended as a UPower PropertiesChanged signal handler."
(mapc #'dbus-unregister-object battery--upower-signals)
(setq battery--upower-signals ()))
-(defun battery--upower-subsribe ()
+(defun battery--upower-subscribe ()
"Subscribe to UPower device change signals."
(push (dbus-register-signal :system battery-upower-service
battery-upower-path
diff --git a/lisp/calculator.el b/lisp/calculator.el
index b4c00753e910..00883989b29e 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -20,23 +20,18 @@
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see .
-;;;=====================================================================
;;; Commentary:
-;;
+
;; A calculator for Emacs.
;; Why should you reach for your mouse to get xcalc (calc.exe, gcalc or
;; whatever), when you have Emacs running already?
;;
-;; If this is not part of your Emacs distribution, then simply bind
-;; `calculator' to a key and make it an autoloaded function, e.g.:
-;; (autoload 'calculator "calculator"
-;; "Run the Emacs calculator." t)
+;; You can bind this to a key by adding this to your Init file:
+;;
;; (global-set-key [(control return)] 'calculator)
;;
;; Written by Eli Barzilay, eli@barzilay.org
-;;
-;;;=====================================================================
;;; Customization:
(defgroup calculator nil
@@ -50,19 +45,16 @@
"Run `calculator' electrically, in the echo area.
Electric mode saves some place but changes the way you interact with the
calculator."
- :type 'boolean
- :group 'calculator)
+ :type 'boolean)
(defcustom calculator-use-menu t
"Make `calculator' create a menu.
Note that this requires easymenu. Must be set before loading."
- :type 'boolean
- :group 'calculator)
+ :type 'boolean)
(defcustom calculator-bind-escape nil
"If non-nil, set escape to exit the calculator."
- :type 'boolean
- :group 'calculator)
+ :type 'boolean)
(defcustom calculator-unary-style 'postfix
"Value is either `prefix' or `postfix'.
@@ -75,44 +67,38 @@ This determines the default behavior of unary operators."
It should contain a \"%s\" somewhere that will indicate the i/o radixes;
this will be a two-character string as described in the documentation
for `calculator-mode'."
- :type 'string
- :group 'calculator)
+ :type 'string)
(defcustom calculator-number-digits 3
"The calculator's number of digits used for standard display.
Used by the `calculator-standard-display' function - it will use the
format string \"%.NC\" where this number is N and C is a character given
at runtime."
- :type 'integer
- :group 'calculator)
+ :type 'integer)
(defcustom calculator-radix-grouping-mode t
"Use digit grouping in radix output mode.
If this is set, chunks of `calculator-radix-grouping-digits' characters
will be separated by `calculator-radix-grouping-separator' when in radix
output mode is active (determined by `calculator-output-radix')."
- :type 'boolean
- :group 'calculator)
+ :type 'boolean)
(defcustom calculator-radix-grouping-digits 4
"The number of digits used for grouping display in radix modes.
See `calculator-radix-grouping-mode'."
- :type 'integer
- :group 'calculator)
+ :type 'integer)
(defcustom calculator-radix-grouping-separator "'"
"The separator used in radix grouping display.
See `calculator-radix-grouping-mode'."
- :type 'string
- :group 'calculator)
+ :type 'string)
(defcustom calculator-remove-zeros t
"Non-nil value means delete all redundant zero decimal digits.
If this value is not t and not nil, redundant zeros are removed except
for one.
Used by the `calculator-remove-zeros' function."
- :type '(choice (const t) (const leave-decimal) (const nil))
- :group 'calculator)
+ :type '(choice (const t) (const leave-decimal) (const nil)))
(defcustom calculator-displayer '(std ?n)
"A displayer specification for numerical values.
@@ -135,8 +121,7 @@ a character and G is an optional boolean, in this case the
arguments."
:type '(choice (function) (string) (sexp)
(list (const std) character)
- (list (const std) character boolean))
- :group 'calculator)
+ (list (const std) character boolean)))
(defcustom calculator-displayers
'(((std ?n) "Standard display, decimal point or scientific")
@@ -152,15 +137,13 @@ specification is the same as the values that can be stored in
`calculator-displayer'.
`calculator-rotate-displayer' rotates this list."
- :type 'sexp
- :group 'calculator)
+ :type 'sexp)
(defcustom calculator-paste-decimals t
"If non-nil, convert pasted integers so they have a decimal point.
This makes it possible to paste big integers since they will be read as
floats, otherwise the Emacs reader will fail on them."
- :type 'boolean
- :group 'calculator)
+ :type 'boolean)
(make-obsolete-variable 'calculator-paste-decimals
"it is no longer used." "26.1")
@@ -169,14 +152,12 @@ floats, otherwise the Emacs reader will fail on them."
`calculator-displayer', to format a string before copying it with
`calculator-copy'. If nil, then `calculator-displayer's normal value is
used."
- :type 'boolean
- :group 'calculator)
+ :type 'boolean)
(defcustom calculator-2s-complement nil
"If non-nil, show negative numbers in 2s complement in radix modes.
Otherwise show as a negative number."
- :type 'boolean
- :group 'calculator)
+ :type 'boolean)
(defcustom calculator-mode-hook nil
"List of hook functions for `calculator-mode' to run.
@@ -184,8 +165,7 @@ Note: if `calculator-electric-mode' is on, then this hook will get
activated in the minibuffer -- in that case it should not do much more
than local key settings and other effects that will change things
outside the scope of calculator related code."
- :type 'hook
- :group 'calculator)
+ :type 'hook)
(defcustom calculator-user-registers nil
"An association list of user-defined register bindings.
@@ -200,8 +180,7 @@ before you load calculator."
(when (boundp 'calculator-registers)
(setq calculator-registers
(append val calculator-registers)))
- (setq calculator-user-registers val))
- :group 'calculator)
+ (setq calculator-user-registers val)))
(defcustom calculator-user-operators nil
"A list of additional operators.
@@ -234,8 +213,7 @@ Examples:
Note that this will be either postfix or prefix, according to
`calculator-unary-style'."
- :type '(repeat (list string symbol sexp integer integer))
- :group 'calculator)
+ :type '(repeat (list string symbol sexp integer integer)))
;;;=====================================================================
;;; Code:
diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el
index ba7418faf789..aa3236cf2561 100644
--- a/lisp/calendar/parse-time.el
+++ b/lisp/calendar/parse-time.el
@@ -29,7 +29,7 @@
;; `parse-time-string' parses a time in a string and returns a list of
;; values, just like `decode-time', where unspecified elements in the
-;; string are returned as nil (except unspecfied DST is returned as -1).
+;; string are returned as nil (except unspecified DST is returned as -1).
;; `encode-time' may be applied on these values to obtain an internal
;; time value.
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el
index e3cc9062ed41..369a9f7e713b 100644
--- a/lisp/cedet/ede.el
+++ b/lisp/cedet/ede.el
@@ -1518,7 +1518,7 @@ It does not apply the value to buffers."
;;; FIXME: Could someone look into implementing `project-ignores' for
;;; EDE and/or a faster `project-files'?
-(add-hook 'project-find-functions #'project-try-ede)
+(add-hook 'project-find-functions #'project-try-ede 50)
(provide 'ede)
diff --git a/lisp/cedet/ede/proj-comp.el b/lisp/cedet/ede/proj-comp.el
index ba52784a7a87..397354ad9c00 100644
--- a/lisp/cedet/ede/proj-comp.el
+++ b/lisp/cedet/ede/proj-comp.el
@@ -248,6 +248,7 @@ This will prevent rules from creating duplicate variables or rules."
(defmacro proj-comp-insert-variable-once (varname &rest body)
"Add VARNAME into the current Makefile if it doesn't exist.
Execute BODY in a location where a value can be placed."
+ (declare (indent 1) (debug (sexp body)))
`(let ((addcr t) (v ,varname))
(unless (re-search-backward (concat "^" v "\\s-*=") nil t)
(insert v "=")
@@ -255,7 +256,6 @@ Execute BODY in a location where a value can be placed."
(if addcr (insert "\n"))
(goto-char (point-max)))
))
-(put 'proj-comp-insert-variable-once 'lisp-indent-function 1)
(cl-defmethod ede-proj-makefile-insert-variables ((this ede-compilation-program))
"Insert variables needed by the compiler THIS."
diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el
index dc6173490210..4d94d3432349 100644
--- a/lisp/cedet/semantic/bovine/el.el
+++ b/lisp/cedet/semantic/bovine/el.el
@@ -1,4 +1,4 @@
-;;; semantic/bovine/el.el --- Semantic details for Emacs Lisp
+;;; semantic/bovine/el.el --- Semantic details for Emacs Lisp -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2005, 2007-2021 Free Software Foundation, Inc.
@@ -169,10 +169,10 @@ where:
- FORM is an Elisp form read from the current buffer.
- START and END are the beginning and end location of the
corresponding data in the current buffer."
+ (declare (indent 1))
(let ((sym (make-symbol "sym")))
`(dolist (,sym ',symbols)
(put ,sym 'semantic-elisp-form-parser #',parser))))
-(put 'semantic-elisp-setup-form-parser 'lisp-indent-function 1)
(defmacro semantic-elisp-reuse-form-parser (symbol &rest symbols)
"Reuse the form parser of SYMBOL for forms identified by SYMBOLS.
@@ -210,7 +210,7 @@ Return a bovination list to use."
;;; Form parsers
;;
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(semantic-tag-new-function
(symbol-name (nth 2 form))
nil
@@ -234,7 +234,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(semantic-tag-new-function
(symbol-name (nth 1 form))
nil
@@ -256,7 +256,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(let ((doc (semantic-elisp-form-to-doc-string (nth 3 form))))
(semantic-tag-new-variable
(symbol-name (nth 1 form))
@@ -274,7 +274,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(let ((doc (semantic-elisp-form-to-doc-string (nth 3 form))))
(semantic-tag-new-variable
(symbol-name (nth 1 form))
@@ -290,7 +290,7 @@ Return a bovination list to use."
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(let ((doc (semantic-elisp-form-to-doc-string (nth 3 form))))
(semantic-tag-new-variable
(symbol-name (nth 1 form))
@@ -307,7 +307,7 @@ Return a bovination list to use."
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(let ((doc (semantic-elisp-form-to-doc-string (nth 3 form))))
(semantic-tag
(symbol-name (nth 1 form))
@@ -321,7 +321,7 @@ Return a bovination list to use."
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(semantic-tag-new-function
(symbol-name (cadr (cadr form)))
nil nil
@@ -333,7 +333,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(let* ((a2 (nth 2 form))
(a3 (nth 3 form))
(args (if (listp a2) a2 a3))
@@ -353,7 +353,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(semantic-tag-new-function
(symbol-name (nth 1 form))
nil
@@ -363,7 +363,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(let ((docpart (nthcdr 4 form)))
(semantic-tag-new-type
(symbol-name (nth 1 form))
@@ -381,7 +381,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(let ((slots (nthcdr 2 form)))
;; Skip doc string if present.
(and (stringp (car slots))
@@ -399,7 +399,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(semantic-tag-new-function
(symbol-name (nth 1 form))
nil nil
@@ -410,7 +410,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(let ((args (nth 3 form)))
(semantic-tag-new-function
(symbol-name (nth 1 form))
@@ -424,7 +424,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(semantic-tag-new-variable
(symbol-name (nth 2 form))
nil
@@ -437,7 +437,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(let ((name (nth 1 form)))
(semantic-tag-new-include
(symbol-name (if (eq (car-safe name) 'quote)
@@ -449,7 +449,7 @@ Return a bovination list to use."
)
(semantic-elisp-setup-form-parser
- (lambda (form start end)
+ (lambda (form _start _end)
(let ((name (nth 1 form)))
(semantic-tag-new-package
(symbol-name (if (eq (car-safe name) 'quote)
@@ -500,7 +500,7 @@ into Emacs Lisp's memory."
""))))
(define-mode-local-override semantic-documentation-for-tag
- emacs-lisp-mode (tag &optional nosnarf)
+ emacs-lisp-mode (tag &optional _nosnarf)
"Return the documentation string for TAG.
Optional argument NOSNARF is ignored."
(let ((d (semantic-tag-docstring tag)))
@@ -577,7 +577,7 @@ Override function for `semantic-tag-protection'."
((string= prot "protected") 'protected))))
(define-mode-local-override semantic-tag-static-p
- emacs-lisp-mode (tag &optional parent)
+ emacs-lisp-mode (tag &optional _parent)
"Return non-nil if TAG is static in PARENT class.
Overrides `semantic-nonterminal-static'."
;; This can only be true (theoretically) in a class where it is assigned.
@@ -588,7 +588,7 @@ Overrides `semantic-nonterminal-static'."
;; Emacs lisp is very different from C,C++ which most context parsing
;; functions are written. Support them here.
(define-mode-local-override semantic-up-context emacs-lisp-mode
- (&optional point bounds-type)
+ (&optional _point _bounds-type)
"Move up one context in an Emacs Lisp function.
A Context in many languages is a block with its own local variables.
In Emacs, we will move up lists and stop when one starts with one of
@@ -652,7 +652,7 @@ define-mode-overload\\)\
(define-mode-local-override semantic-get-local-variables emacs-lisp-mode
- (&optional point)
+ (&optional _point)
"Return a list of local variables for POINT.
Scan backwards from point at each successive function. For all occurrences
of `let' or `let*', grab those variable names."
diff --git a/lisp/cedet/semantic/sb.el b/lisp/cedet/semantic/sb.el
index d7cd8e1940c6..debdfd1dc04b 100644
--- a/lisp/cedet/semantic/sb.el
+++ b/lisp/cedet/semantic/sb.el
@@ -1,4 +1,4 @@
-;;; semantic/sb.el --- Semantic tag display for speedbar
+;;; semantic/sb.el --- Semantic tag display for speedbar -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
@@ -73,10 +73,10 @@ use the `speedbar-line-file' to get this info if needed."
(defmacro semantic-sb-with-tag-buffer (tag &rest forms)
"Set the current buffer to the origin of TAG and execute FORMS.
Restore the old current buffer when completed."
+ (declare (indent 1) (debug t))
`(save-excursion
(semantic-sb-tag-set-buffer ,tag)
,@forms))
-(put 'semantic-sb-with-tag-buffer 'lisp-indent-function 1)
;;; Button Generation
;;
@@ -294,7 +294,7 @@ TEXT TOKEN and INDENT are the details."
(t (error "Ooops... not sure what to do")))
(speedbar-center-buffer-smartly))
-(defun semantic-sb-token-jump (text token indent)
+(defun semantic-sb-token-jump (_text token indent)
"Jump to the location specified in token.
TEXT TOKEN and INDENT are the details."
(let ((file
diff --git a/lisp/comint.el b/lisp/comint.el
index 57df6bfb19fe..5c307febe2af 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -104,6 +104,7 @@
(require 'ring)
(require 'ansi-color)
(require 'regexp-opt) ;For regexp-opt-charset.
+(eval-when-compile (require 'subr-x))
;; Buffer Local Variables:
;;============================================================================
@@ -378,7 +379,7 @@ This variable is buffer-local."
"\\(?:" (regexp-opt password-word-equivalents) "\\|Response\\)"
"\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?"
;; "[[:alpha:]]" used to be "for", which fails to match non-English.
- "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::៖][[:blank:]]*\\'")
+ "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::៖][[:space:]]*\\'")
"Regexp matching prompts for passwords in the inferior process.
This is used by `comint-watch-for-password-prompt'."
:version "27.1"
@@ -2430,12 +2431,11 @@ This function could be in the list `comint-output-filter-functions'."
(when (let ((case-fold-search t))
(string-match comint-password-prompt-regexp
(replace-regexp-in-string "\r" "" string)))
- (when (string-match "^[ \n\r\t\v\f\b\a]+" string)
- (setq string (replace-match "" t t string)))
(let ((comint--prompt-recursion-depth (1+ comint--prompt-recursion-depth)))
(if (> comint--prompt-recursion-depth 10)
(message "Password prompt recursion too deep")
- (comint-send-invisible string)))))
+ (comint-send-invisible
+ (string-trim string "[ \n\r\t\v\f\b\a]+" "\n+"))))))
;; Low-level process communication
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 5a52eccbbe3b..1199de183fb4 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -447,7 +447,7 @@ If it is `no-dir', omitting is much faster, but you can only match
against the non-directory part of the file name. Set it to nil if you
need to match the entire file name.")
-;; \017=^O for Omit - other packages can chose other control characters.
+;; \017=^O for Omit - other packages can choose other control characters.
(defvar dired-omit-marker-char ?\017
"Temporary marker used by Dired-Omit.
Should never be used as marker by the user or other packages.")
diff --git a/lisp/dired.el b/lisp/dired.el
index 553fb64da050..4f1c3ded092d 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -60,10 +60,15 @@
May contain all other options that don't contradict `-l';
may contain even `F', `b', `i' and `s'. See also the variable
`dired-ls-F-marks-symlinks' concerning the `F' switch.
+
+If you have files with names with embedded newline characters, adding
+`b' to the switches will allow Dired to handle those files better.
+
Options that include embedded whitespace must be quoted
like this: \"--option=value with spaces\"; you can use
`combine-and-quote-strings' to produce the correct quoting of
each option.
+
On systems such as MS-DOS and MS-Windows, which use `ls' emulation in Lisp,
some of the `ls' switches are not supported; see the doc string of
`insert-directory' in `ls-lisp.el' for more details."
diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el
index 1f5022c27439..b1b2144e3def 100644
--- a/lisp/emacs-lisp/bindat.el
+++ b/lisp/emacs-lisp/bindat.el
@@ -41,23 +41,23 @@
;; Consider the following C structures:
;;
;; struct header {
-;; unsigned long dest_ip;
-;; unsigned long src_ip;
-;; unsigned short dest_port;
-;; unsigned short src_port;
+;; uint32_t dest_ip;
+;; uint32_t src_ip;
+;; uint16_t dest_port;
+;; uint16_t src_port;
;; };
;;
;; struct data {
-;; unsigned char type;
-;; unsigned char opcode;
-;; unsigned long length; /* In little endian order */
+;; uint8_t type;
+;; uint8_t opcode;
+;; uint32_t length; /* In little endian order */
;; unsigned char id[8]; /* nul-terminated string */
;; unsigned char data[/* (length + 3) & ~3 */];
;; };
;;
;; struct packet {
;; struct header header;
-;; unsigned char items;
+;; uint8_t items;
;; unsigned char filler[3];
;; struct data item[/* items */];
;; };
@@ -75,7 +75,7 @@
;; (bindat-spec
;; (type u8)
;; (opcode u8)
-;; (length u16r) ;; little endian order
+;; (length u32r) ;; little endian order
;; (id strz 8)
;; (data vec (length))
;; (align 4)))
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index e0feb95a461e..9f0ba232a4ba 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1348,7 +1348,7 @@ Same format as `byte-optimize--lexvars', with shared structure and contents.")
window-total-height window-total-width window-use-time window-vscroll
window-width zerop))
(side-effect-and-error-free-fns
- '(arrayp atom
+ '(always arrayp atom
bignump bobp bolp bool-vector-p
buffer-end buffer-list buffer-size buffer-string bufferp
car-safe case-table-p cdr-safe char-or-string-p characterp
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 76e7f01ace64..afe94bb03528 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -154,9 +154,7 @@ The return value of this function is not used."
(defalias 'byte-run--set-modes
#'(lambda (f _args &rest val)
(list 'function-put (list 'quote f)
- ''completion-predicate
- `(lambda (_ b)
- (command-completion-with-modes-p ',val b)))))
+ ''command-modes (list 'quote val))))
;; Add any new entries to info node `(elisp)Declare Form'.
(defvar defun-declarations-alist
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 9d80afd774fd..c0683babcf97 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2859,7 +2859,9 @@ If FORM is a lambda or a macro, byte-compile it as a function."
((eq arg '&optional)
(when (memq '&optional (cdr list))
(error "Duplicate &optional")))
- ((memq arg vars)
+ ((and (memq arg vars)
+ ;; Allow repetitions for unused args.
+ (not (string-match "\\`_" (symbol-name arg))))
(byte-compile-warn "repeated variable %s in lambda-list" arg))
(t
(push arg vars))))
@@ -3815,15 +3817,38 @@ discarding."
(cl-assert (or (> (length env) 0)
docstring-exp)) ;Otherwise, we don't need a closure.
(cl-assert (byte-code-function-p fun))
- (byte-compile-form `(make-byte-code
- ',(aref fun 0) ',(aref fun 1)
- (vconcat (vector . ,env) ',(aref fun 2))
- ,@(let ((rest (nthcdr 3 (mapcar (lambda (x) `',x) fun))))
- (if docstring-exp
- `(,(car rest)
- ,docstring-exp
- ,@(cddr rest))
- rest)))))))
+ (byte-compile-form
+ (if (or (not docstring-exp) (stringp docstring-exp))
+ ;; Use symbols V0, V1 ... as placeholders for closure variables:
+ ;; they should be short (to save space in the .elc file), yet
+ ;; distinct when disassembled.
+ (let* ((dummy-vars (mapcar (lambda (i) (intern (format "V%d" i)))
+ (number-sequence 0 (1- (length env)))))
+ (opt-args (mapcar (lambda (i) (aref fun i))
+ (number-sequence 4 (1- (length fun)))))
+ (proto-fun
+ (apply #'make-byte-code
+ (aref fun 0) (aref fun 1)
+ ;; Prepend dummy cells to the constant vector,
+ ;; to get the indices right when disassembling.
+ (vconcat dummy-vars (aref fun 2))
+ (aref fun 3)
+ (if docstring-exp
+ (cons docstring-exp (cdr opt-args))
+ opt-args))))
+ `(make-closure ,proto-fun ,@env))
+ ;; Nontrivial doc string expression: create a bytecode object
+ ;; from small pieces at run time.
+ `(make-byte-code
+ ',(aref fun 0) ',(aref fun 1)
+ (vconcat (vector . ,env) ',(aref fun 2))
+ ,@(let ((rest (nthcdr 3 (mapcar (lambda (x) `',x) fun))))
+ (if docstring-exp
+ `(,(car rest)
+ ,docstring-exp
+ ,@(cddr rest))
+ rest))))
+ ))))
(defun byte-compile-get-closed-var (form)
"Byte-compile the special `internal-get-closed-var' form."
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el
index 7d760ffc57f8..40c17b916f9c 100644
--- a/lisp/emacs-lisp/chart.el
+++ b/lisp/emacs-lisp/chart.el
@@ -187,7 +187,7 @@ Make sure the width/height is correct."
)
"Class used to display an axis which represents different named items.")
-(defclass chart-sequece ()
+(defclass chart-sequence ()
((data :initarg :data
:initform nil)
(name :initarg :name
@@ -583,12 +583,12 @@ SORT-PRED if desired."
))
(iv (eq dir 'vertical)))
(chart-add-sequence nc
- (make-instance 'chart-sequece
+ (make-instance 'chart-sequence
:data namelst
:name nametitle)
(if iv 'x-axis 'y-axis))
(chart-add-sequence nc
- (make-instance 'chart-sequece
+ (make-instance 'chart-sequence
:data numlst
:name numtitle)
(if iv 'y-axis 'x-axis))
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 28ce6b115a4c..84199c161277 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -898,8 +898,8 @@ Outputs to the current buffer."
(list (cl-prin1-to-string (cl--slot-descriptor-name slot))
(cl-prin1-to-string (cl--slot-descriptor-type slot))
(cl-prin1-to-string (cl--slot-descriptor-initform slot))
- (let ((doc (alist-get :documentation
- (cl--slot-descriptor-props slot))))
+ (let ((doc (plist-get (cl--slot-descriptor-props slot)
+ :documentation)))
(if (not doc) ""
(setq has-doc t)
(substitute-command-keys doc)))))
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 459969459482..45e76c751fea 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -88,7 +88,6 @@ using, but only when you also use Edebug."
;; because the byte compiler binds them; as a result, if edebug
;; is first loaded for a require in a compilation, they will be left unbound.
-;;;###autoload
(defcustom edebug-all-defs nil
"If non-nil, evaluating defining forms instruments for Edebug.
This applies to `eval-defun', `eval-region', `eval-buffer', and
@@ -101,11 +100,6 @@ variable. You may wish to make it local to each buffer with
`emacs-lisp-mode-hook'."
:type 'boolean)
-;; edebug-all-defs and edebug-all-forms need to be autoloaded
-;; because the byte compiler binds them; as a result, if edebug
-;; is first loaded for a require in a compilation, they will be left unbound.
-
-;;;###autoload
(defcustom edebug-all-forms nil
"Non-nil means evaluation of all forms will instrument for Edebug.
This doesn't apply to loading or evaluations in the minibuffer.
@@ -457,66 +451,24 @@ the option `edebug-all-forms'."
;; We should somehow arrange to be able to do this
;; without actually replacing the eval-defun command.
-(defun edebug-eval-defun (edebug-it)
- "Evaluate the top-level form containing point, or after point.
-
-If the current defun is actually a call to `defvar', then reset the
-variable using its initial value expression even if the variable
-already has some other value. (Normally `defvar' does not change the
-variable's value if it already has a value.) Treat `defcustom'
-similarly. Reinitialize the face according to `defface' specification.
-
-With a prefix argument, instrument the code for Edebug.
-
-Setting option `edebug-all-defs' to a non-nil value reverses the meaning
+(defun edebug--eval-defun (orig-fun edebug-it)
+ "Setting option `edebug-all-defs' to a non-nil value reverses the meaning
of the prefix argument. Code is then instrumented when this function is
invoked without a prefix argument.
If acting on a `defun' for FUNCTION, and the function was instrumented,
`Edebug: FUNCTION' is printed in the minibuffer. If not instrumented,
-just FUNCTION is printed.
+just FUNCTION is printed."
+ (let* ((edebug-all-forms (not (eq (not edebug-it) (not edebug-all-defs))))
+ (edebug-all-defs edebug-all-forms))
+ (funcall orig-fun nil)))
-If not acting on a `defun', the result of evaluation is displayed in
-the minibuffer."
+(defun edebug-eval-defun (edebug-it)
+ (declare (obsolete "use eval-defun or edebug--eval-defun instead" "28.1"))
(interactive "P")
- (let* ((edebugging (not (eq (not edebug-it) (not edebug-all-defs))))
- (edebug-result)
- (form
- (let ((edebug-all-forms edebugging)
- (edebug-all-defs (eq edebug-all-defs (not edebug-it))))
- (edebug-read-top-level-form))))
- ;; This should be consistent with `eval-defun-1', but not the
- ;; same, since that gets a macroexpanded form.
- (cond ((and (eq (car form) 'defvar)
- (cdr-safe (cdr-safe form)))
- ;; Force variable to be bound.
- (makunbound (nth 1 form)))
- ((and (eq (car form) 'defcustom)
- (default-boundp (nth 1 form)))
- ;; Force variable to be bound.
- ;; FIXME: Shouldn't this use the :setter or :initializer?
- (set-default (nth 1 form) (eval (nth 2 form) lexical-binding)))
- ((eq (car form) 'defface)
- ;; Reset the face.
- (setq face-new-frame-defaults
- (assq-delete-all (nth 1 form) face-new-frame-defaults))
- (put (nth 1 form) 'face-defface-spec nil)
- (put (nth 1 form) 'face-documentation (nth 3 form))
- ;; See comments in `eval-defun-1' for purpose of code below
- (setq form (prog1 `(prog1 ,form
- (put ',(nth 1 form) 'saved-face
- ',(get (nth 1 form) 'saved-face))
- (put ',(nth 1 form) 'customized-face
- ,(nth 2 form)))
- (put (nth 1 form) 'saved-face nil)))))
- (setq edebug-result (eval (eval-sexp-add-defvars form) lexical-binding))
- (if (not edebugging)
- (prog1
- (prin1 edebug-result)
- (let ((str (eval-expression-print-format edebug-result)))
- (if str (princ str))))
- edebug-result)))
-
+ (if (advice-member-p #'edebug--eval-defun 'eval-defun)
+ (eval-defun edebug-it)
+ (edebug--eval-defun #'eval-defun edebug-it)))
;;;###autoload
(defalias 'edebug-defun 'edebug-eval-top-level-form)
@@ -588,12 +540,12 @@ already is one.)"
(defun edebug-install-read-eval-functions ()
(interactive)
(add-function :around load-read-function #'edebug--read)
- (advice-add 'eval-defun :override #'edebug-eval-defun))
+ (advice-add 'eval-defun :around #'edebug--eval-defun))
(defun edebug-uninstall-read-eval-functions ()
(interactive)
(remove-function load-read-function #'edebug--read)
- (advice-remove 'eval-defun #'edebug-eval-defun))
+ (advice-remove 'eval-defun #'edebug--eval-defun))
;;; Edebug internal data
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index c95540ea3cfa..a02406a7b737 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -100,7 +100,7 @@ If the value is a positive number, it is used to calculate a
number of logical lines of documentation that ElDoc is allowed to
put in the echo area. If a positive integer, the number is used
directly, while a float specifies the number of lines as a
-proporting of the echo area frame's height.
+proportion of the echo area frame's height.
If value is the symbol `truncate-sym-name-if-fit' t, the part of
the doc string that represents a symbol's name may be truncated
@@ -692,7 +692,7 @@ following values are allowed:
- `eldoc-documentation-compose-eagerly': calls all functions in
the special hook and display as many of the resulting doc
- strings as possible, as soon as possibl. Preserving the
+ strings as possible, as soon as possible. Preserving the
relative order of doc strings;
- `eldoc-documentation-enthusiast': calls all functions in the
diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el
index d058d3dda0bf..bf9aff67a694 100644
--- a/lisp/emacs-lisp/ert-x.el
+++ b/lisp/emacs-lisp/ert-x.el
@@ -102,15 +102,6 @@ the name of the test and the result of NAME-FORM."
(indent 1))
`(ert--call-with-test-buffer ,name-form (lambda () ,@body)))
-;; We use these `put' forms in addition to the (declare (indent)) in
-;; the defmacro form since the `declare' alone does not lead to
-;; correct indentation before the .el/.elc file is loaded.
-;; Autoloading these `put' forms solves this.
-;;;###autoload
-(progn
- ;; TODO(ohler): Figure out what these mean and make sure they are correct.
- (put 'ert-with-test-buffer 'lisp-indent-function 1))
-
;;;###autoload
(defun ert-kill-all-test-buffers ()
"Kill all test buffers that are still live."
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index e08fa7ac7b30..96c1a02dbcc6 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -81,15 +81,13 @@ Use nil for no limit (caution: backtrace lines can be very long)."
:background "green1")
(((class color) (background dark))
:background "green3"))
- "Face used for expected results in the ERT results buffer."
- :group 'ert)
+ "Face used for expected results in the ERT results buffer.")
(defface ert-test-result-unexpected '((((class color) (background light))
:background "red1")
(((class color) (background dark))
:background "red3"))
- "Face used for unexpected results in the ERT results buffer."
- :group 'ert)
+ "Face used for unexpected results in the ERT results buffer.")
;;; Copies/reimplementations of cl functions.
@@ -224,16 +222,6 @@ it has to be wrapped in `(eval (quote ...))'.
:body (lambda () ,@body)))
',name))))
-;; We use these `put' forms in addition to the (declare (indent)) in
-;; the defmacro form since the `declare' alone does not lead to
-;; correct indentation before the .el/.elc file is loaded.
-;; Autoloading these `put' forms solves this.
-;;;###autoload
-(progn
- ;; TODO(ohler): Figure out what these mean and make sure they are correct.
- (put 'ert-deftest 'lisp-indent-function 2)
- (put 'ert-info 'lisp-indent-function 1))
-
(defvar ert--find-test-regexp
(concat "^\\s-*(ert-deftest"
find-function-space-re
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 90b7b88d58a9..092befa1f2e1 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2802,6 +2802,7 @@ either a full name or nil, and EMAIL is a valid email address."
Letters do not insert themselves; instead, they are commands.
\\
\\{package-menu-mode-map}"
+ :interactive nil
(setq mode-line-process '((package--downloads-in-progress ":Loading")
(package-menu--transaction-status
package-menu--transaction-status)))
@@ -2924,7 +2925,7 @@ Installed obsolete packages are always displayed.")
Also hide packages whose name matches a regexp in user option
`package-hidden-regexps' (a list). To add regexps to this list,
use `package-menu-hide-package'."
- (interactive)
+ (interactive nil package-menu-mode)
(package--ensure-package-menu-mode)
(setq package-menu--hide-packages
(not package-menu--hide-packages))
@@ -3261,7 +3262,7 @@ To unhide a package, type
Type \\[package-menu-toggle-hiding] to toggle package hiding."
(declare (interactive-only "change `package-hidden-regexps' instead."))
- (interactive)
+ (interactive nil package-menu-mode)
(package--ensure-package-menu-mode)
(let* ((name (when (derived-mode-p 'package-menu-mode)
(concat "\\`" (regexp-quote (symbol-name (package-desc-name
@@ -3285,7 +3286,7 @@ Type \\[package-menu-toggle-hiding] to toggle package hiding."
(defun package-menu-describe-package (&optional button)
"Describe the current package.
If optional arg BUTTON is non-nil, describe its associated package."
- (interactive)
+ (interactive nil package-menu-mode)
(let ((pkg-desc (if button (button-get button 'package-desc)
(tabulated-list-get-id))))
(if pkg-desc
@@ -3295,7 +3296,7 @@ If optional arg BUTTON is non-nil, describe its associated package."
;; fixme numeric argument
(defun package-menu-mark-delete (&optional _num)
"Mark a package for deletion and move to the next line."
- (interactive "p")
+ (interactive "p" package-menu-mode)
(package--ensure-package-menu-mode)
(if (member (package-menu-get-status)
'("installed" "dependency" "obsolete" "unsigned"))
@@ -3304,7 +3305,7 @@ If optional arg BUTTON is non-nil, describe its associated package."
(defun package-menu-mark-install (&optional _num)
"Mark a package for installation and move to the next line."
- (interactive "p")
+ (interactive "p" package-menu-mode)
(package--ensure-package-menu-mode)
(if (member (package-menu-get-status) '("available" "avail-obso" "new" "dependency"))
(tabulated-list-put-tag "I" t)
@@ -3312,20 +3313,20 @@ If optional arg BUTTON is non-nil, describe its associated package."
(defun package-menu-mark-unmark (&optional _num)
"Clear any marks on a package and move to the next line."
- (interactive "p")
+ (interactive "p" package-menu-mode)
(package--ensure-package-menu-mode)
(tabulated-list-put-tag " " t))
(defun package-menu-backup-unmark ()
"Back up one line and clear any marks on that package."
- (interactive)
+ (interactive nil package-menu-mode)
(package--ensure-package-menu-mode)
(forward-line -1)
(tabulated-list-put-tag " "))
(defun package-menu-mark-obsolete-for-deletion ()
"Mark all obsolete packages for deletion."
- (interactive)
+ (interactive nil package-menu-mode)
(package--ensure-package-menu-mode)
(save-excursion
(goto-char (point-min))
@@ -3356,7 +3357,7 @@ If optional arg BUTTON is non-nil, describe its associated package."
(defun package-menu-quick-help ()
"Show short key binding help for `package-menu-mode'.
The full list of keys can be viewed with \\[describe-mode]."
- (interactive)
+ (interactive nil package-menu-mode)
(package--ensure-package-menu-mode)
(message (mapconcat #'package--prettify-quick-help-key
package--quick-help-keys "\n")))
@@ -3452,7 +3453,7 @@ call will upgrade the package.
If there's an async refresh operation in progress, the flags will
be placed as part of `package-menu--post-refresh' instead of
immediately."
- (interactive)
+ (interactive nil package-menu-mode)
(package--ensure-package-menu-mode)
(if (not package--downloads-in-progress)
(package-menu--mark-upgrades-1)
@@ -3546,7 +3547,7 @@ packages list, respectively."
Packages marked for installation are downloaded and installed;
packages marked for deletion are removed.
Optional argument NOQUERY non-nil means do not ask the user to confirm."
- (interactive)
+ (interactive nil package-menu-mode)
(package--ensure-package-menu-mode)
(let (install-list delete-list cmd pkg-desc)
(save-excursion
@@ -3791,7 +3792,8 @@ strings. If ARCHIVE is nil or the empty string, show all
packages."
(interactive (list (completing-read-multiple
"Filter by archive (comma separated): "
- (mapcar #'car package-archives))))
+ (mapcar #'car package-archives)))
+ package-menu-mode)
(package--ensure-package-menu-mode)
(let ((re (if (listp archive)
(regexp-opt archive)
@@ -3812,7 +3814,8 @@ DESCRIPTION.
When called interactively, prompt for DESCRIPTION.
If DESCRIPTION is nil or the empty string, show all packages."
- (interactive (list (read-regexp "Filter by description (regexp)")))
+ (interactive (list (read-regexp "Filter by description (regexp)"))
+ package-menu-mode)
(package--ensure-package-menu-mode)
(if (or (not description) (string-empty-p description))
(package-menu--generate t t)
@@ -3833,10 +3836,11 @@ strings. If KEYWORD is nil or the empty string, show all
packages."
(interactive (list (completing-read-multiple
"Keywords (comma separated): "
- (package-all-keywords))))
+ (package-all-keywords)))
+ package-menu-mode)
+ (package--ensure-package-menu-mode)
(when (stringp keyword)
(setq keyword (list keyword)))
- (package--ensure-package-menu-mode)
(if (not keyword)
(package-menu--generate t t)
(package-menu--filter-by (lambda (pkg-desc)
@@ -3855,7 +3859,8 @@ When called interactively, prompt for NAME-OR-DESCRIPTION.
If NAME-OR-DESCRIPTION is nil or the empty string, show all
packages."
- (interactive (list (read-regexp "Filter by name or description (regexp)")))
+ (interactive (list (read-regexp "Filter by name or description (regexp)"))
+ package-menu-mode)
(package--ensure-package-menu-mode)
(if (or (not name-or-description) (string-empty-p name-or-description))
(package-menu--generate t t)
@@ -3874,7 +3879,8 @@ Display only packages with name that matches regexp NAME.
When called interactively, prompt for NAME.
If NAME is nil or the empty string, show all packages."
- (interactive (list (read-regexp "Filter by name (regexp)")))
+ (interactive (list (read-regexp "Filter by name (regexp)"))
+ package-menu-mode)
(package--ensure-package-menu-mode)
(if (or (not name) (string-empty-p name))
(package-menu--generate t t)
@@ -3904,7 +3910,8 @@ packages."
"incompat"
"installed"
"new"
- "unsigned"))))
+ "unsigned")))
+ package-menu-mode)
(package--ensure-package-menu-mode)
(if (or (not status) (string-empty-p status))
(package-menu--generate t t)
@@ -3939,7 +3946,9 @@ If VERSION is nil or the empty string, show all packages."
('< "< less than")
('> "> greater than"))
"): "))
- choice))))
+ choice)))
+ package-menu-mode)
+ (package--ensure-package-menu-mode)
(unless (equal predicate 'quit)
(if (or (not version) (string-empty-p version))
(package-menu--generate t t)
@@ -3957,7 +3966,7 @@ If VERSION is nil or the empty string, show all packages."
(defun package-menu-filter-marked ()
"Filter \"*Packages*\" buffer by non-empty upgrade mark.
Unlike other filters, this leaves the marks intact."
- (interactive)
+ (interactive nil package-menu-mode)
(package--ensure-package-menu-mode)
(widen)
(let (found-entries mark pkg-id entry marks)
@@ -3985,7 +3994,7 @@ Unlike other filters, this leaves the marks intact."
(defun package-menu-filter-upgradable ()
"Filter \"*Packages*\" buffer to show only upgradable packages."
- (interactive)
+ (interactive nil package-menu-mode)
(let ((pkgs (mapcar #'car (package-menu--find-upgrades))))
(package-menu--filter-by
(lambda (pkg)
@@ -3994,7 +4003,7 @@ Unlike other filters, this leaves the marks intact."
(defun package-menu-clear-filter ()
"Clear any filter currently applied to the \"*Packages*\" buffer."
- (interactive)
+ (interactive nil package-menu-mode)
(package--ensure-package-menu-mode)
(package-menu--generate t t))
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index d3928fa5051f..c7288b7fa2a5 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -642,7 +642,7 @@ MATCH is the pattern that needs to be matched, of the form:
(defun pcase--split-pred (vars upat pat)
"Indicate the overlap or mutual-exclusion between UPAT and PAT.
-More specifically retuns a pair (A . B) where A indicates whether PAT
+More specifically returns a pair (A . B) where A indicates whether PAT
can match when UPAT has matched, and B does the same for the case
where UPAT failed to match.
A and B can be one of:
@@ -784,7 +784,7 @@ Otherwise, it defers to REST which is a list of branches of the form
\(ELSE-MATCH ELSE-CODE . ELSE-VARS)."
;; Depending on the order in which we choose to check each of the MATCHES,
;; the resulting tree may be smaller or bigger. So in general, we'd want
- ;; to be careful to chose the "optimal" order. But predicate
+ ;; to be careful to choose the "optimal" order. But predicate
;; patterns make this harder because they create dependencies
;; between matches. So we don't bother trying to reorder anything.
(cond
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index ce8d98df8074..455fcac701f4 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -217,8 +217,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
;; Define the local "\C-c" keymap
(defvar reb-mode-map
- (let ((map (make-sparse-keymap))
- (menu-map (make-sparse-keymap)))
+ (let ((map (make-sparse-keymap)))
(define-key map "\C-c\C-c" 'reb-toggle-case)
(define-key map "\C-c\C-q" 'reb-quit)
(define-key map "\C-c\C-w" 'reb-copy)
@@ -228,43 +227,37 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
(define-key map "\C-c\C-e" 'reb-enter-subexp-mode)
(define-key map "\C-c\C-b" 'reb-change-target-buffer)
(define-key map "\C-c\C-u" 'reb-force-update)
- (define-key map [menu-bar reb-mode] (cons "Re-Builder" menu-map))
- (define-key menu-map [rq]
- '(menu-item "Quit" reb-quit
- :help "Quit the RE Builder mode"))
- (define-key menu-map [div1] '(menu-item "--"))
- (define-key menu-map [rt]
- '(menu-item "Case sensitive" reb-toggle-case
- :button (:toggle . (with-current-buffer
- reb-target-buffer
- (null case-fold-search)))
- :help "Toggle case sensitivity of searches for RE Builder target buffer"))
- (define-key menu-map [rb]
- '(menu-item "Change target buffer..." reb-change-target-buffer
- :help "Change the target buffer and display it in the target window"))
- (define-key menu-map [rs]
- '(menu-item "Change syntax..." reb-change-syntax
- :help "Change the syntax used by the RE Builder"))
- (define-key menu-map [div2] '(menu-item "--"))
- (define-key menu-map [re]
- '(menu-item "Enter subexpression mode" reb-enter-subexp-mode
- :help "Enter the subexpression mode in the RE Builder"))
- (define-key menu-map [ru]
- '(menu-item "Force update" reb-force-update
- :help "Force an update in the RE Builder target window without a match limit"))
- (define-key menu-map [rn]
- '(menu-item "Go to next match" reb-next-match
- :help "Go to next match in the RE Builder target window"))
- (define-key menu-map [rp]
- '(menu-item "Go to previous match" reb-prev-match
- :help "Go to previous match in the RE Builder target window"))
- (define-key menu-map [div3] '(menu-item "--"))
- (define-key menu-map [rc]
- '(menu-item "Copy current RE" reb-copy
- :help "Copy current RE into the kill ring for later insertion"))
map)
"Keymap used by the RE Builder.")
+(easy-menu-define reb-mode-menu reb-mode-map
+ "Menu for the RE Builder."
+ '("Re-Builder"
+ ["Copy current RE" reb-copy
+ :help "Copy current RE into the kill ring for later insertion"]
+ "---"
+ ["Go to previous match" reb-prev-match
+ :help "Go to previous match in the RE Builder target window"]
+ ["Go to next match" reb-next-match
+ :help "Go to next match in the RE Builder target window"]
+ ["Force update" reb-force-update
+ :help "Force an update in the RE Builder target window without a match limit"]
+ ["Enter subexpression mode" reb-enter-subexp-mode
+ :help "Enter the subexpression mode in the RE Builder"]
+ "---"
+ ["Change syntax..." reb-change-syntax
+ :help "Change the syntax used by the RE Builder"]
+ ["Change target buffer..." reb-change-target-buffer
+ :help "Change the target buffer and display it in the target window"]
+ ["Case sensitive" reb-toggle-case
+ :style toggle
+ :selected (with-current-buffer reb-target-buffer
+ (null case-fold-search))
+ :help "Toggle case sensitivity of searches for RE Builder target buffer"]
+ "---"
+ ["Quit" reb-quit
+ :help "Quit the RE Builder mode"]))
+
(define-derived-mode reb-mode nil "RE Builder"
"Major mode for interactively building Regular Expressions."
(setq-local blink-matching-paren nil)
@@ -368,7 +361,6 @@ matching parts of the target buffer will be highlighted."
(defun reb-change-target-buffer (buf)
"Change the target buffer and display it in the target window."
(interactive "bSet target buffer to: ")
-
(let ((buffer (get-buffer buf)))
(if (not buffer)
(error "No such buffer")
@@ -381,7 +373,6 @@ matching parts of the target buffer will be highlighted."
(defun reb-force-update ()
"Force an update in the RE Builder target window without a match limit."
(interactive)
-
(let ((reb-auto-match-limit nil))
(reb-update-overlays
(if reb-subexp-mode reb-subexp-displayed nil))))
@@ -389,7 +380,6 @@ matching parts of the target buffer will be highlighted."
(defun reb-quit ()
"Quit the RE Builder mode."
(interactive)
-
(setq reb-subexp-mode nil
reb-subexp-displayed nil)
(reb-delete-overlays)
@@ -399,7 +389,6 @@ matching parts of the target buffer will be highlighted."
(defun reb-next-match ()
"Go to next match in the RE Builder target window."
(interactive)
-
(reb-assert-buffer-in-window)
(with-selected-window reb-target-window
(if (not (re-search-forward reb-regexp (point-max) t))
@@ -411,7 +400,6 @@ matching parts of the target buffer will be highlighted."
(defun reb-prev-match ()
"Go to previous match in the RE Builder target window."
(interactive)
-
(reb-assert-buffer-in-window)
(with-selected-window reb-target-window
(let ((p (point)))
@@ -426,7 +414,6 @@ matching parts of the target buffer will be highlighted."
(defun reb-toggle-case ()
"Toggle case sensitivity of searches for RE Builder target buffer."
(interactive)
-
(with-current-buffer reb-target-buffer
(setq case-fold-search (not case-fold-search)))
(reb-update-modestring)
@@ -435,7 +422,6 @@ matching parts of the target buffer will be highlighted."
(defun reb-copy ()
"Copy current RE into the kill ring for later insertion."
(interactive)
-
(reb-update-regexp)
(let ((re (with-output-to-string
(print (reb-target-binding reb-regexp)))))
@@ -503,7 +489,6 @@ Optional argument SYNTAX must be specified if called non-interactively."
(defun reb-do-update (&optional subexp)
"Update matches in the RE Builder target window.
If SUBEXP is non-nil mark only the corresponding sub-expressions."
-
(reb-assert-buffer-in-window)
(reb-update-regexp)
(reb-update-overlays subexp))
@@ -541,7 +526,6 @@ optional fourth argument FORCE is non-nil."
(defun reb-assert-buffer-in-window ()
"Assert that `reb-target-buffer' is displayed in `reb-target-window'."
-
(if (not (eq reb-target-buffer (window-buffer reb-target-window)))
(set-window-buffer reb-target-window reb-target-buffer)))
@@ -560,7 +544,6 @@ optional fourth argument FORCE is non-nil."
(defun reb-display-subexp (&optional subexp)
"Highlight only subexpression SUBEXP in the RE Builder."
(interactive)
-
(setq reb-subexp-displayed
(or subexp (string-to-number (format "%c" last-command-event))))
(reb-update-modestring)
@@ -568,7 +551,6 @@ optional fourth argument FORCE is non-nil."
(defun reb-kill-buffer ()
"When the RE Builder buffer is killed make sure no overlays stay around."
-
(when (reb-mode-buffer-p)
(reb-delete-overlays)))
@@ -600,7 +582,6 @@ optional fourth argument FORCE is non-nil."
(defun reb-insert-regexp ()
"Insert current RE."
-
(let ((re (or (reb-target-binding reb-regexp)
(reb-empty-regexp))))
(cond ((eq reb-re-syntax 'read)
@@ -636,7 +617,6 @@ Return t if the (cooked) expression changed."
;; And now the real core of the whole thing
(defun reb-count-subexps (re)
"Return number of sub-expressions in the regexp RE."
-
(let ((i 0) (beg 0))
(while (string-match "\\\\(" re beg)
(setq i (1+ i)
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index b29b870061d2..58584f300c9c 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -890,7 +890,7 @@ Return (REGEXP . PRECEDENCE)."
(* (or (seq "[:" (+ (any "a-z")) ":]")
(not (any "]"))))
"]")
- anything
+ (not (any "*+?^$[\\"))
(seq "\\"
(or anything
(seq (any "sScC_") anything)
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index be2d7c0fd8aa..b734fd15a246 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -1,4 +1,4 @@
-;;; cua-rect.el --- CUA unified rectangle support
+;;; cua-rect.el --- CUA unified rectangle support -*- lexical-binding: t; -*-
;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
@@ -575,6 +575,7 @@ Set undo boundary if UNDO is non-nil.
Rectangle is padded if PAD = t or numeric and (cua--rectangle-virtual-edges)
Perform auto-tabify after operation if TABIFY is non-nil.
Mark is kept if keep-clear is 'keep and cleared if keep-clear is 'clear."
+ (declare (indent 4))
(let* ((inhibit-field-text-motion t)
(start (cua--rectangle-top))
(end (cua--rectangle-bot))
@@ -645,8 +646,6 @@ Mark is kept if keep-clear is 'keep and cleared if keep-clear is 'clear."
(cua--keep-active)))
(setq cua--buffer-and-point-before-command nil)))
-(put 'cua--rectangle-operation 'lisp-indent-function 4)
-
(defun cua--delete-rectangle ()
(let ((lines 0))
(if (not (cua--rectangle-virtual-edges))
@@ -1220,6 +1219,7 @@ The numbers are formatted according to the FORMAT string."
;;; Replace/rearrange text in current rectangle
(defun cua--rectangle-aux-replace (width adjust keep replace pad format-fct &optional setup-fct)
+ (declare (indent 4))
;; Process text inserted by calling SETUP-FCT or current rectangle if nil.
;; Then call FORMAT-FCT on text (if non-nil); takes two args: start and end.
;; Fill to WIDTH characters if > 0 or fill to current width if == 0.
@@ -1279,8 +1279,6 @@ The numbers are formatted according to the FORMAT string."
(if keep
(cua--rectangle-resized)))))
-(put 'cua--rectangle-aux-replace 'lisp-indent-function 4)
-
(defun cua--left-fill-rectangle (_start _end)
(beginning-of-line)
(while (< (point) (point-max))
diff --git a/lisp/finder.el b/lisp/finder.el
index 15c3fcbac797..2c3869b5089c 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -90,24 +90,21 @@ Each element has the form (KEYWORD . DESCRIPTION).")
(define-key map "p" 'previous-line)
(define-key map "q" 'finder-exit)
(define-key map "d" 'finder-list-keywords)
-
- (define-key map [menu-bar finder-mode]
- (cons "Finder" menu-map))
- (define-key menu-map [finder-exit]
- '(menu-item "Quit" finder-exit
- :help "Exit Finder mode"))
- (define-key menu-map [finder-summary]
- '(menu-item "Summary" finder-summary
- :help "Summary item on current line in a finder buffer"))
- (define-key menu-map [finder-list-keywords]
- '(menu-item "List keywords" finder-list-keywords
- :help "Display descriptions of the keywords in the Finder buffer"))
- (define-key menu-map [finder-select]
- '(menu-item "Select" finder-select
- :help "Select item on current line in a finder buffer"))
map)
"Keymap used in `finder-mode'.")
+(easy-menu-define finder-mode-menu finder-mode-map
+ "Menu for `finder-mode'."
+ '("Finder"
+ ["Select" finder-select
+ :help "Select item on current line in a finder buffer"]
+ ["List keywords" finder-list-keywords
+ :help "Display descriptions of the keywords in the Finder buffer"]
+ ["Summary" finder-summary
+ :help "Summary item on current line in a finder buffer"]
+ ["Quit" finder-exit
+ :help "Exit Finder mode"]))
+
(defvar finder-mode-syntax-table
(let ((st (make-syntax-table emacs-lisp-mode-syntax-table)))
(modify-syntax-entry ?\; ". " st)
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index d7b1c06114ba..339bff9d67a0 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -365,7 +365,7 @@ This variable can also be set per-server."
"A list of strings representing expandable search keys.
\"Expandable\" simply means the key can be abbreviated while
typing in search queries, ie \"subject\" could be entered as
-\"subj\" or even \"su\", though \"s\" is ambigous between
+\"subj\" or even \"su\", though \"s\" is ambiguous between
\"subject\" and \"since\".
Ambiguous abbreviations will raise an error."
@@ -402,7 +402,7 @@ The search \"language\" is essentially a series of key:value
expressions. Key is most often a mail header, but there are
other keys. Value is a string, quoted if it contains spaces.
Key and value are separated by a colon, no space. Expressions
-are implictly ANDed; the \"or\" keyword can be used to
+are implicitly ANDed; the \"or\" keyword can be used to
OR. \"not\" will negate the following expression, or keys can be
prefixed with a \"-\". The \"near\" operator will work for
engines that understand it; other engines will convert it to
@@ -448,7 +448,7 @@ auto-completion of contact names and addresses for keys like
Date values (any key in `gnus-search-date-keys') can be provided
in any format that `parse-time-string' can parse (note that this
can produce weird results). Dates with missing bits will be
-interpreted as the most recent occurance thereof (ie \"march 03\"
+interpreted as the most recent occurence thereof (ie \"march 03\"
is the most recent March 3rd). Lastly, relative specifications
such as 1d (one day ago) are understood. This also accepts w, m,
and y. m is assumed to be 30 days.
@@ -646,7 +646,7 @@ gnus-*-mark marks, and return an appropriate string."
"Return a string from the current buffer.
If DELIMITED is non-nil, assume the next character is a delimiter
character, and return everything between point and the next
-occurance of the delimiter, including the delimiters themselves.
+occurence of the delimiter, including the delimiters themselves.
If TRIM is non-nil, do not return the delimiters. Otherwise,
return one word."
;; This function cannot handle nested delimiters, as it's not a
@@ -789,7 +789,7 @@ the files in ARTLIST by that search key.")
(raw-queries-p
:initform (symbol-value 'gnus-search-imap-raw-queries-p)))
:documentation
- "The base IMAP search engine, using an IMAP server's search capabilites.
+ "The base IMAP search engine, using an IMAP server's search capabilities.
This backend may be subclassed to handle particular IMAP servers'
quirks.")
@@ -1082,7 +1082,7 @@ Responsible for handling and, or, and parenthetical expressions.")
(cl-defmethod gnus-search-imap-search-command ((engine gnus-search-imap)
(query string))
"Create the IMAP search command for QUERY.
-Currenly takes into account support for the LITERAL+ capability.
+Currently takes into account support for the LITERAL+ capability.
Other capabilities could be tested here."
(with-slots (literal-plus) engine
(when literal-plus
@@ -1672,8 +1672,8 @@ and \"-\" before marks."
(cl-defmethod gnus-search-transform-expression ((engine gnus-search-mairix)
(expr (head or)))
"Handle Mairix \"or\" statement.
-Mairix only accepts \"or\" expressions on homogenous keys. We
-cast \"or\" expressions on heterogenous keys as \"and\", which
+Mairix only accepts \"or\" expressions on homogeneous keys. We
+cast \"or\" expressions on heterogeneous keys as \"and\", which
isn't quite right, but it's the best we can do. For date keys,
only keep one of the terms."
(let ((term1 (caadr expr))
diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el
index fffa2d27312c..1daa8aa673bb 100644
--- a/lisp/gnus/nnselect.el
+++ b/lisp/gnus/nnselect.el
@@ -33,7 +33,7 @@
;; turn be a vector of three elements: a real prefixed group name, an
;; article number in that group, and an integer score. The score is
;; not used by nnselect but may be used by other code to help in
-;; sorting. Most functions will just chose a fixed number, such as
+;; sorting. Most functions will just choose a fixed number, such as
;; 100, for this score.
;; For example the search function `gnus-search-run-query' applied to
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index ceb6bc090157..724469509483 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1026,7 +1026,7 @@ it is displayed along with the global value."
(princ (if file-name
(progn
(princ (format-message
- " is a variable defined in `%s'.\n"
+ " is a variable defined in `%s'.\n\n"
(if (eq file-name 'C-source)
"C source code"
(help-fns-short-filename file-name))))
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 79710a180732..6fd3d40fe3c5 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -54,14 +54,30 @@
["Show Help for Symbol" help-follow-symbol
:help "Show the docs for the symbol at point"]
["Previous Topic" help-go-back
- :help "Go back to previous topic in this help buffer"]
+ :help "Go back to previous topic in this help buffer"
+ :active help-xref-stack]
["Next Topic" help-go-forward
- :help "Go back to next topic in this help buffer"]
+ :help "Go back to next topic in this help buffer"
+ :active help-xref-forward-stack]
["Move to Previous Button" backward-button
:help "Move to the Previous Button in the help buffer"]
["Move to Next Button" forward-button
:help "Move to the Next Button in the help buffer"]))
+(defvar help-mode-tool-bar-map
+ (let ((map (make-sparse-keymap)))
+ (tool-bar-local-item "close" 'quit-window 'quit map
+ :label "Quit help."
+ :vert-only t)
+ (define-key-after map [separator-1] menu-bar-separator)
+ (tool-bar-local-item "search" 'isearch-forward 'search map
+ :label "Search" :vert-only t)
+ (tool-bar-local-item-from-menu 'help-go-back "left-arrow" map help-mode-map
+ :rtl "right-arrow" :vert-only t)
+ (tool-bar-local-item-from-menu 'help-go-forward "right-arrow" map help-mode-map
+ :rtl "left-arrow" :vert-only t)
+ map))
+
(defvar-local help-xref-stack nil
"A stack of ways by which to return to help buffers after following xrefs.
Used by `help-follow' and `help-xref-go-back'.
@@ -317,6 +333,8 @@ Commands:
\\{help-mode-map}"
(setq-local revert-buffer-function
#'help-mode-revert-buffer)
+ (setq-local tool-bar-map
+ help-mode-tool-bar-map)
(setq-local bookmark-make-record-function
#'help-bookmark-make-record))
@@ -458,8 +476,7 @@ that."
(with-current-buffer (or buffer (current-buffer))
(save-excursion
(goto-char (point-min))
- ;; Skip the header-type info, though it might be useful to parse
- ;; it at some stage (e.g. "function in `library'").
+ ;; Skip the first bit, which has already been buttonized.
(forward-paragraph)
(let ((old-modified (buffer-modified-p)))
(let ((stab (syntax-table))
@@ -778,8 +795,8 @@ help buffer by other means."
(&optional no-file no-context posn))
(defun help-bookmark-make-record ()
- "Create and return a help-mode bookmark record.
-Implements `bookmark-make-record-function' for help-mode buffers."
+ "Create and return a `help-mode' bookmark record.
+Implements `bookmark-make-record-function' for `help-mode' buffers."
(unless (car help-xref-stack-item)
(error "Cannot create bookmark - help command not known"))
`(,@(bookmark-make-record-default 'NO-FILE 'NO-CONTEXT)
@@ -792,7 +809,7 @@ Implements `bookmark-make-record-function' for help-mode buffers."
;;;###autoload
(defun help-bookmark-jump (bookmark)
- "Jump to help-mode bookmark BOOKMARK.
+ "Jump to `help-mode' bookmark BOOKMARK.
Handler function for record returned by `help-bookmark-make-record'.
BOOKMARK is a bookmark name or a bookmark record."
(let ((help-fn (bookmark-prop-get bookmark 'help-fn))
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index ec0a559c8dba..7384abf3b239 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -858,7 +858,9 @@ was inserted."
(setq image-transform-rotation
(or (exif-orientation
(ignore-error exif-error
- (exif-parse-buffer)))
+ ;; exif-parse-buffer can move point, so preserve it.
+ (save-excursion
+ (exif-parse-buffer))))
0.0)))
;; Swap width and height when changing orientation
;; between portrait and landscape.
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index 580bd293e731..55449599fe97 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -278,14 +278,13 @@ Optional 5th argument NIL-FOR-TOO-LONG non-nil means return nil
CODING-SYSTEMS is a list of coding systems. See `set-coding-system-priority'.
This affects the implicit sorting of lists of coding systems returned by
operations such as `find-coding-systems-region'."
+ (declare (indent 1) (debug t))
(let ((current (make-symbol "current")))
`(let ((,current (coding-system-priority-list)))
(apply #'set-coding-system-priority ,coding-systems)
(unwind-protect
(progn ,@body)
(apply #'set-coding-system-priority ,current)))))
-;;;###autoload(put 'with-coding-priority 'lisp-indent-function 1)
-(put 'with-coding-priority 'edebug-form-spec t)
;;;###autoload
(defun detect-coding-with-language-environment (from to lang-env)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index c571ea946706..8266c4b7a01f 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -3356,7 +3356,7 @@ the word mode."
(defun isearch-lazy-count-format (&optional suffix-p)
"Format the current match number and the total number of matches.
-When SUFFIX-P is non-nil, the returned string is indended for
+When SUFFIX-P is non-nil, the returned string is intended for
isearch-message-suffix prompt. Otherwise, for isearch-message-prefix."
(let ((format-string (if suffix-p
lazy-count-suffix-format
diff --git a/lisp/json.el b/lisp/json.el
index 1f1f608eabae..f20123fcfbc9 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -438,7 +438,8 @@ Initialized lazily by `json-encode-string'.")
;; This seems to afford decent performance gains.
(setq-local inhibit-modification-hooks t)
(setq json--string-buffer (current-buffer))))
- (insert ?\" (substring-no-properties string)) ; see bug#43549
+ ;; Strip `read-only' property (bug#43549).
+ (insert ?\" (substring-no-properties string))
(goto-char (1+ (point-min)))
(while (re-search-forward (rx json--escape) nil 'move)
(let ((char (preceding-char)))
@@ -452,14 +453,20 @@ Initialized lazily by `json-encode-string'.")
;; Empty buffer for next invocation.
(delete-and-extract-region (point-min) (point-max)))))
+(defun json--encode-stringlike (object)
+ "Return OBJECT encoded as a JSON string, or nil if not possible."
+ (cond ((stringp object) (json-encode-string object))
+ ((keywordp object) (json-encode-string
+ (substring (symbol-name object) 1)))
+ ((symbolp object) (json-encode-string (symbol-name object)))))
+
(defun json-encode-key (object)
"Return a JSON representation of OBJECT.
If the resulting JSON object isn't a valid JSON object key,
this signals `json-key-format'."
- (let ((encoded (json-encode object)))
- (unless (stringp (json-read-from-string encoded))
- (signal 'json-key-format (list object)))
- encoded))
+ ;; Encoding must be a JSON string.
+ (or (json--encode-stringlike object)
+ (signal 'json-key-format (list object))))
;;; Objects
@@ -652,11 +659,10 @@ become JSON objects."
;; Array encoding
(defun json-encode-array (array)
- "Return a JSON representation of ARRAY."
+ "Return a JSON representation of ARRAY.
+ARRAY can also be a list."
(if (and json-encoding-pretty-print
- (if (listp array)
- array
- (> (length array) 0)))
+ (not (length= array 0)))
(concat
"["
(json--with-indentation
@@ -737,15 +743,9 @@ you will get the following structure returned:
OBJECT should have a structure like one returned by `json-read'.
If an error is detected during encoding, an error based on
`json-error' is signaled."
- (cond ((eq object t) (json-encode-keyword object))
- ((eq object json-null) (json-encode-keyword object))
- ((eq object json-false) (json-encode-keyword object))
- ((stringp object) (json-encode-string object))
- ((keywordp object) (json-encode-string
- (substring (symbol-name object) 1)))
+ (cond ((json-encode-keyword object))
((listp object) (json-encode-list object))
- ((symbolp object) (json-encode-string
- (symbol-name object)))
+ ((json--encode-stringlike object))
((numberp object) (json-encode-number object))
((arrayp object) (json-encode-array object))
((hash-table-p object) (json-encode-hash-table object))
@@ -774,6 +774,8 @@ With prefix argument MINIMIZE, minimize it instead."
(json-null :json-null)
;; Ensure that ordering is maintained.
(json-object-type 'alist)
+ ;; Ensure that keys survive roundtrip (bug#24252, bug#42545).
+ (json-key-type 'string)
(orig-buf (current-buffer))
error)
;; Strategy: Repeatedly `json-read' from the original buffer and
diff --git a/lisp/man.el b/lisp/man.el
index 1fded38e72d9..abb9bbad8fd9 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1024,7 +1024,7 @@ to auto-complete your input based on the installed manual pages."
;;;###autoload
(defun man-follow (man-args)
"Get a Un*x manual page of the item under point and put it in a buffer."
- (interactive (list (Man-default-man-entry)))
+ (interactive (list (Man-default-man-entry)) man-common)
(if (or (not man-args)
(string= man-args ""))
(error "No item under point")
@@ -1143,7 +1143,7 @@ Return the buffer in which the manpage will appear."
(defun Man-update-manpage ()
"Reformat current manpage by calling the man command again synchronously."
- (interactive)
+ (interactive nil man-common)
(when (eq Man-arguments nil)
;;this shouldn't happen unless it is not in a Man buffer."
(error "Man-arguments not initialized"))
@@ -1239,7 +1239,7 @@ See the variable `Man-notify-method' for the different notification behaviors."
(defun Man-fontify-manpage ()
"Convert overstriking and underlining to the correct fonts.
Same for the ANSI bold and normal escape sequences."
- (interactive)
+ (interactive nil man-common)
(goto-char (point-min))
;; Fontify ANSI escapes.
(let ((ansi-color-apply-face-function #'ansi-color-apply-text-property-face)
@@ -1355,7 +1355,7 @@ default type, `Man-xref-man-page' is used for the buttons."
Normally skip any jobs that should have been done by the sed script,
but when called interactively, do those jobs even if the sed
script would have done them."
- (interactive "p")
+ (interactive "p" man-common)
(if (or interactive (not Man-sed-script))
(progn
(goto-char (point-min))
@@ -1527,7 +1527,14 @@ manpage command."
(defvar bookmark-make-record-function)
-(define-derived-mode Man-mode special-mode "Man"
+(define-derived-mode man-common special-mode "Man Shared"
+ "Parent mode for `Man-mode' like modes.
+This mode is here to be inherited by modes that need to use
+commands from `Man-mode'. Used by `woman'.
+(In itself, this mode currently does nothing.)"
+ :interactive nil)
+
+(define-derived-mode Man-mode man-common "Man"
"A mode for browsing Un*x manual pages.
The following man commands are available in the buffer. Try
@@ -1723,7 +1730,7 @@ The following key bindings are currently in effect in the buffer:
(defun Man-next-section (n)
"Move point to Nth next section (default 1)."
- (interactive "p")
+ (interactive "p" man-common)
(let ((case-fold-search nil)
(start (point)))
(if (looking-at Man-heading-regexp)
@@ -1739,7 +1746,7 @@ The following key bindings are currently in effect in the buffer:
(defun Man-previous-section (n)
"Move point to Nth previous section (default 1)."
- (interactive "p")
+ (interactive "p" man-common)
(let ((case-fold-search nil))
(if (looking-at Man-heading-regexp)
(forward-line -1))
@@ -1756,8 +1763,7 @@ Returns t if section is found, nil otherwise."
(if (re-search-forward (concat "^" section) (point-max) t)
(progn (beginning-of-line) t)
(goto-char curpos)
- nil)
- ))
+ nil)))
(defvar Man--last-section nil)
@@ -1771,7 +1777,8 @@ Returns t if section is found, nil otherwise."
(prompt (concat "Go to section (default " default "): "))
(chosen (completing-read prompt Man--sections
nil nil nil nil default)))
- (list chosen)))
+ (list chosen))
+ man-common)
(setq Man--last-section section)
(unless (Man-find-section section)
(error "Section %s not found" section)))
@@ -1780,7 +1787,7 @@ Returns t if section is found, nil otherwise."
(defun Man-goto-see-also-section ()
"Move point to the \"SEE ALSO\" section.
Actually the section moved to is described by `Man-see-also-regexp'."
- (interactive)
+ (interactive nil man-common)
(if (not (Man-find-section Man-see-also-regexp))
(error "%s" (concat "No " Man-see-also-regexp
" section found in the current manpage"))))
@@ -1834,7 +1841,8 @@ Specify which REFERENCE to use; default is based on word at point."
(prompt (concat "Refer to (default " default "): "))
(chosen (completing-read prompt Man--refpages
nil nil nil nil defaults)))
- chosen))))
+ chosen)))
+ man-common)
(if (not Man--refpages)
(error "Can't find any references in the current manpage")
(setq Man--last-refpage reference)
@@ -1843,7 +1851,7 @@ Specify which REFERENCE to use; default is based on word at point."
(defun Man-kill ()
"Kill the buffer containing the manpage."
- (interactive)
+ (interactive nil man-common)
(quit-window t))
(defun Man-goto-page (page &optional noerror)
@@ -1854,7 +1862,8 @@ Specify which REFERENCE to use; default is based on word at point."
(if (= (length Man-page-list) 1)
(error "You're looking at the only manpage in the buffer")
(list (read-minibuffer (format "Go to manpage [1-%d]: "
- (length Man-page-list)))))))
+ (length Man-page-list))))))
+ man-common)
(if (and (not Man-page-list) (not noerror))
(error "Not a man page buffer"))
(when Man-page-list
@@ -1876,7 +1885,7 @@ Specify which REFERENCE to use; default is based on word at point."
(defun Man-next-manpage ()
"Find the next manpage entry in the buffer."
- (interactive)
+ (interactive nil man-common)
(if (= (length Man-page-list) 1)
(error "This is the only manpage in the buffer"))
(if (< Man-current-page (length Man-page-list))
@@ -1887,7 +1896,7 @@ Specify which REFERENCE to use; default is based on word at point."
(defun Man-previous-manpage ()
"Find the previous manpage entry in the buffer."
- (interactive)
+ (interactive nil man-common)
(if (= (length Man-page-list) 1)
(error "This is the only manpage in the buffer"))
(if (> Man-current-page 1)
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index af6f2f1ab02b..dd953ee9df7e 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -1,4 +1,4 @@
-;;; mh-acros.el --- macros used in MH-E
+;;; mh-acros.el --- macros used in MH-E -*- lexical-binding: t; -*-
;; Copyright (C) 2004, 2006-2021 Free Software Foundation, Inc.
@@ -49,20 +49,19 @@
;;;###mh-autoload
(defmacro mh-do-in-gnu-emacs (&rest body)
"Execute BODY if in GNU Emacs."
- (declare (debug t))
+ (declare (debug t) (indent defun))
(unless (featurep 'xemacs) `(progn ,@body)))
-(put 'mh-do-in-gnu-emacs 'lisp-indent-hook 'defun)
;;;###mh-autoload
(defmacro mh-do-in-xemacs (&rest body)
"Execute BODY if in XEmacs."
- (declare (debug t))
+ (declare (debug t) (indent defun))
(when (featurep 'xemacs) `(progn ,@body)))
-(put 'mh-do-in-xemacs 'lisp-indent-hook 'defun)
;;;###mh-autoload
(defmacro mh-funcall-if-exists (function &rest args)
"Call FUNCTION with ARGS as parameters if it exists."
+ (declare (debug (symbolp body)))
;; FIXME: Not clear when this should be used. If the function happens
;; not to exist at compile-time (e.g. because the corresponding package
;; wasn't loaded), then it won't ever be used :-(
@@ -75,25 +74,24 @@
"Create function NAME.
If FUNCTION exists, then NAME becomes an alias for FUNCTION.
Otherwise, create function NAME with ARG-LIST and BODY."
+ (declare (indent defun) (doc-string 4)
+ (debug (&define name symbolp sexp def-body)))
`(defalias ',name
(if (fboundp ',function)
',function
(lambda ,arg-list ,@body))))
-(put 'defun-mh 'lisp-indent-function 'defun)
-(put 'defun-mh 'doc-string-elt 4)
;;;###mh-autoload
(defmacro defmacro-mh (name macro arg-list &rest body)
"Create macro NAME.
If MACRO exists, then NAME becomes an alias for MACRO.
Otherwise, create macro NAME with ARG-LIST and BODY."
+ (declare (indent defun) (doc-string 4)
+ (debug (&define name symbolp sexp def-body)))
(let ((defined-p (fboundp macro)))
(if defined-p
`(defalias ',name ',macro)
`(defmacro ,name ,arg-list ,@body))))
-(put 'defmacro-mh 'lisp-indent-function 'defun)
-(put 'defmacro-mh 'doc-string-elt 4)
-
;;; Miscellaneous
@@ -127,7 +125,7 @@ Execute BODY, which can modify the folder buffer without having to
worry about file locking or the read-only flag, and return its result.
If SAVE-MODIFICATION-FLAG is non-nil, the buffer's modification flag
is unchanged, otherwise it is cleared."
- (declare (debug t))
+ (declare (debug t) (indent defun))
(setq save-modification-flag (car save-modification-flag)) ; CL style
`(prog1
(let ((mh-folder-updating-mod-flag (buffer-modified-p))
@@ -139,14 +137,13 @@ is unchanged, otherwise it is cleared."
(mh-set-folder-modified-p mh-folder-updating-mod-flag)))
,@(if (not save-modification-flag)
'((mh-set-folder-modified-p nil)))))
-(put 'with-mh-folder-updating 'lisp-indent-hook 'defun)
;;;###mh-autoload
(defmacro mh-in-show-buffer (show-buffer &rest body)
"Format is (mh-in-show-buffer (SHOW-BUFFER) &body BODY).
Display buffer SHOW-BUFFER in other window and execute BODY in it.
Stronger than `save-excursion', weaker than `save-window-excursion'."
- (declare (debug t))
+ (declare (debug t) (indent defun))
(setq show-buffer (car show-buffer)) ; CL style
`(let ((mh-in-show-buffer-saved-window (selected-window)))
(switch-to-buffer-other-window ,show-buffer)
@@ -155,7 +152,6 @@ Stronger than `save-excursion', weaker than `save-window-excursion'."
(progn
,@body)
(select-window mh-in-show-buffer-saved-window))))
-(put 'mh-in-show-buffer 'lisp-indent-hook 'defun)
;;;###mh-autoload
(defmacro mh-do-at-event-location (event &rest body)
@@ -163,7 +159,7 @@ Stronger than `save-excursion', weaker than `save-window-excursion'."
After BODY has been executed return to original window.
The modification flag of the buffer in the event window is
preserved."
- (declare (debug t))
+ (declare (debug t) (indent defun))
(let ((event-window (make-symbol "event-window"))
(event-position (make-symbol "event-position"))
(original-window (make-symbol "original-window"))
@@ -190,7 +186,6 @@ preserved."
(goto-char ,original-position)
(set-marker ,original-position nil)
(select-window ,original-window))))))
-(put 'mh-do-at-event-location 'lisp-indent-hook 'defun)
@@ -209,7 +204,7 @@ VAR is bound to the message on the current line as we loop
starting from BEGIN till END. In each step BODY is executed.
If VAR is nil then the loop is executed without any binding."
- (declare (debug (symbolp body)))
+ (declare (debug (symbolp body)) (indent defun))
(unless (symbolp var)
(error "Can not bind the non-symbol %s" var))
(let ((binding-needed-flag var))
@@ -221,7 +216,6 @@ If VAR is nil then the loop is executed without any binding."
(let ,(if binding-needed-flag `((,var (mh-get-msg-num t))) ())
,@body))
(forward-line 1)))))
-(put 'mh-iterate-on-messages-in-region 'lisp-indent-hook 'defun)
;;;###mh-autoload
(defmacro mh-iterate-on-range (var range &rest body)
@@ -235,7 +229,7 @@ a string. In each iteration, BODY is executed.
The parameter RANGE is usually created with
`mh-interactive-range' in order to provide a uniform interface to
MH-E functions."
- (declare (debug (symbolp body)))
+ (declare (debug (symbolp body)) (indent defun))
(unless (symbolp var)
(error "Can not bind the non-symbol %s" var))
(let ((binding-needed-flag var)
@@ -263,7 +257,6 @@ MH-E functions."
(when (gethash v ,seq-hash-table)
(let ,(if binding-needed-flag `((,var v)) ())
,@body))))))))
-(put 'mh-iterate-on-range 'lisp-indent-hook 'defun)
(defmacro mh-dlet* (binders &rest body)
"Like `let*' but always dynamically scoped."
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 07bf03b30ee6..6d657afa3ed3 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -1,4 +1,4 @@
-;;; mh-compat.el --- make MH-E compatible with various versions of Emacs
+;;; mh-compat.el --- make MH-E compatible with various versions of Emacs -*- lexical-binding: t; -*-
;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
@@ -83,6 +83,7 @@ This is an analogue of a dynamically scoped `let' that operates on
the function cell of FUNCs rather than their value cell.
\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
+ (declare (indent 1) (debug ((&rest (sexp sexp &rest form)) &rest form)))
(if (fboundp 'cl-letf)
`(cl-letf ,(mapcar (lambda (binding)
`((symbol-function ',(car binding))
@@ -90,9 +91,6 @@ the function cell of FUNCs rather than their value cell.
bindings)
,@body)
`(flet ,bindings ,@body)))
-(put 'mh-flet 'lisp-indent-function 1)
-(put 'mh-flet 'edebug-form-spec
- '((&rest (sexp sexp &rest form)) &rest form))
(defun mh-display-color-cells (&optional display)
"Return the number of color cells supported by DISPLAY.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 2eb7fbaa20c0..eaf8eb556513 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -1,4 +1,4 @@
-;;; mh-e.el --- GNU Emacs interface to the MH mail system
+;;; mh-e.el --- GNU Emacs interface to the MH mail system -*- lexical-binding: t; -*-
;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2021 Free
;; Software Foundation, Inc.
@@ -695,9 +695,8 @@ See documentation for `defgroup' for a description of the arguments
SYMBOL, MEMBERS, DOC and ARGS.
This macro is used by Emacs versions that lack the :package-version
keyword, introduced in Emacs 22."
- (declare (doc-string 3))
+ (declare (doc-string 3) (indent defun))
`(defgroup ,symbol ,members ,doc ,@(mh-strip-package-version args)))
-(put 'defgroup-mh 'lisp-indent-function 'defun)
(defmacro defcustom-mh (symbol value doc &rest args)
"Declare SYMBOL as a customizable variable that defaults to VALUE.
@@ -705,9 +704,8 @@ See documentation for `defcustom' for a description of the arguments
SYMBOL, VALUE, DOC and ARGS.
This macro is used by Emacs versions that lack the :package-version
keyword, introduced in Emacs 22."
- (declare (doc-string 3))
+ (declare (doc-string 3) (indent defun))
`(defcustom ,symbol ,value ,doc ,@(mh-strip-package-version args)))
-(put 'defcustom-mh 'lisp-indent-function 'defun)
(defmacro defface-mh (face spec doc &rest args)
"Declare FACE as a customizable face that defaults to SPEC.
@@ -715,9 +713,8 @@ See documentation for `defface' for a description of the arguments
FACE, SPEC, DOC and ARGS.
This macro is used by Emacs versions that lack the :package-version
keyword, introduced in Emacs 22."
- (declare (doc-string 3))
+ (declare (doc-string 3) (indent defun))
`(defface ,face ,spec ,doc ,@(mh-strip-package-version args)))
-(put 'defface-mh 'lisp-indent-function 'defun)
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index 9ad843c3259a..1d25b1473235 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -136,7 +136,7 @@ displayed."
(show-window (get-buffer-window mh-show-buffer))
(display-mime-buttons-flag mh-display-buttons-for-inline-parts-flag))
(if (not (eq (next-window (minibuffer-window)) (selected-window)))
- (delete-other-windows)) ; force ourself to the top window
+ (delete-other-windows)) ; force ourselves to the top window
(mh-in-show-buffer (mh-show-buffer)
(setq mh-display-buttons-for-inline-parts-flag display-mime-buttons-flag)
(if (and show-window
diff --git a/lisp/net/dictionary-connection.el b/lisp/net/dictionary-connection.el
index 8ad4fe4e6379..83125742be35 100644
--- a/lisp/net/dictionary-connection.el
+++ b/lisp/net/dictionary-connection.el
@@ -23,9 +23,9 @@
;;; Commentary:
;; dictionary-connection allows to handle TCP-based connections in
-;; client mode where text-based information are exchanged. There is
+;; client mode where text-based information is exchanged. There is
;; special support for handling CR LF (and the usual CR LF . CR LF
-;; terminater).
+;; terminator).
;;; Code:
@@ -68,7 +68,7 @@
(defun dictionary-connection-open (server port)
"Open a connection to SERVER at PORT.
-A data structure identifing the connection is returned"
+A data structure identifying the connection is returned"
(let ((process-buffer (generate-new-buffer (format " connection to %s:%s"
server
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 6f086053b6a0..c6af4e66e396 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -127,9 +127,9 @@ by the choice value:
The found word exactly matches the searched word.
-- Similiar sounding
+- Similar sounding
- The found word sounds similiar to the searched word. For this match type
+ The found word sounds similar to the searched word. For this match type
the soundex algorithm defined by Donald E. Knuth is used. It will only
works with english words and the algorithm is not very reliable (i.e.,
the soundex algorithm is quite simple).
@@ -148,7 +148,7 @@ by the choice value:
dictionary server."
:group 'dictionary
:type '(choice (const :tag "Exact match" "exact")
- (const :tag "Similiar sounding" "soundex")
+ (const :tag "Similar sounding" "soundex")
(const :tag "Levenshtein distance one" "lev")
(string :tag "User choice"))
:version "28.1")
@@ -419,7 +419,7 @@ This is a quick reference to this mode describing the default key bindings:
;;;###autoload
(defun dictionary ()
- "Create a new dictonary buffer and install `dictionary-mode'."
+ "Create a new dictionary buffer and install `dictionary-mode'."
(interactive)
(let ((buffer (or (and dictionary-use-single-buffer
(get-buffer "*Dictionary*"))
@@ -568,7 +568,7 @@ The connection takes the proxy setting in customization group
answer)))
(defun dictionary-split-string (string)
- "Split STRING constiting of space-separated words into elements.
+ "Split STRING consisting of space-separated words into elements.
This function knows about the special meaning of quotes (\")"
(let ((list))
(while (and string (> (length string) 0))
@@ -894,7 +894,7 @@ The word is taken from the buffer, the DICTIONARY is given as argument."
(unless (dictionary-check-reply reply 110)
(error "Unknown server answer: %s"
(dictionary-reply reply)))
- (dictionary-display-dictionarys))))
+ (dictionary-display-dictionaries))))
(defun dictionary-simple-split-string (string &optional pattern)
"Return a list of substrings of STRING which are separated by PATTERN.
@@ -909,7 +909,7 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
start (match-end 0)))
(nreverse (cons (substring string start) parts))))
-(defun dictionary-display-dictionarys ()
+(defun dictionary-display-dictionaries ()
"Handle the display of all dictionaries existing on the server."
(dictionary-pre-buffer)
(insert "Please select your default dictionary:\n\n")
@@ -1171,7 +1171,7 @@ allows editing it."
;; if called by pressing the button
(unless word
(setq word (read-string "Search word: " nil 'dictionary-word-history)))
- ;; just in case non-interactivly called
+ ;; just in case non-interactively called
(unless dictionary
(setq dictionary dictionary-default-dictionary))
(dictionary-new-search (cons word dictionary)))
@@ -1249,10 +1249,10 @@ allows editing it."
;;; Tooltip support
-;; Add a mode indicater named "Dict"
+;; Add a mode indicator named "Dict"
(defvar dictionary-tooltip-mode
nil
- "Indicates wheather the dictionary tooltip mode is active.")
+ "Indicates whether the dictionary tooltip mode is active.")
(nconc minor-mode-alist '((dictionary-tooltip-mode " Dict")))
(defcustom dictionary-tooltip-dictionary
diff --git a/lisp/net/dns.el b/lisp/net/dns.el
index 2045d4dfca19..90776e3c6f2b 100644
--- a/lisp/net/dns.el
+++ b/lisp/net/dns.el
@@ -332,7 +332,7 @@ Parses \"/etc/resolv.conf\" or calls \"nslookup\"."
(setq dns-servers (nreverse dns-servers))))
(when (executable-find "nslookup")
(with-temp-buffer
- (call-process "nslookup" nil t nil "localhost")
+ (call-process "nslookup" nil t nil "-retry=0" "-timeout=2" "localhost")
(goto-char (point-min))
(when (re-search-forward
"^Address:[ \t]*\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\|[[:xdigit:]:]*\\)" nil t)
@@ -492,19 +492,22 @@ If REVERSE, look up an IP address."
(dns-get-txt-answer (dns-get 'answers result))
(dns-get 'data answer))))))))))
+;;;###autoload
(defun dns-query (name &optional type full reverse)
"Query a DNS server for NAME of TYPE.
If FULL, return the entire record returned.
If REVERSE, look up an IP address."
- (let ((result nil))
- (dns-query-asynchronous
- name
- (lambda (response)
- (setq result (list response)))
- type full reverse)
- ;; Loop until we get the callback.
- (while (not result)
- (sleep-for 0.01))
+ (let* ((result nil)
+ (query-started
+ (dns-query-asynchronous
+ name
+ (lambda (response)
+ (setq result (list response)))
+ type full reverse)))
+ (if query-started
+ ;; Loop until we get the callback.
+ (while (not result)
+ (sleep-for 0.01)))
(car result)))
(provide 'dns)
diff --git a/lisp/net/eudcb-macos-contacts.el b/lisp/net/eudcb-macos-contacts.el
index 66a684dfc59d..b07016c12299 100644
--- a/lisp/net/eudcb-macos-contacts.el
+++ b/lisp/net/eudcb-macos-contacts.el
@@ -108,7 +108,7 @@ RETURN-ATTRS is a list of attributes to return, defaulting to
(defun eudc-macos-contacts-set-server (dummy)
"Set the EUDC server to macOS Contacts app.
The server in DUMMY is not actually used, since this backend
-always and implicitly connetcs to an instance of the Contacts app
+always and implicitly connects to an instance of the Contacts app
running on the local host."
(interactive)
(eudc-set-server dummy 'macos-contacts)
diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el
index b95cd0febcdf..3097c9a671e1 100644
--- a/lisp/net/mailcap.el
+++ b/lisp/net/mailcap.el
@@ -332,7 +332,7 @@ whose car is a symbol, it is `eval'uated to yield the validity. If it
is a string or list of strings, it represents a shell command to run
to return a true or false shell value for the validity.
-The last matching entry in this structure takes presedence over
+The last matching entry in this structure takes precedence over
preceding entries.")
(put 'mailcap-mime-data 'risky-local-variable t)
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index cf55f66e780d..a2d4d89ee554 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -1626,7 +1626,7 @@ Return t if a new feed was activated, nil otherwise."
(interactive
(list (let ((completion-ignore-case t))
(completing-read
- "Jump to feed: "
+ "Jump to feed/group: "
(append '("new" "obsolete" "immortal" "all")
(mapcar #'car (append newsticker-url-list
newsticker-url-list-defaults)))
@@ -1852,28 +1852,34 @@ of the shift. If MOVE-GROUP is nil the currently selected feed
`newsticker--treeview-current-feed' is shifted, if it is t then
the current feed's parent group is shifted.."
(let* ((cur-feed newsticker--treeview-current-feed)
- (thing (if move-group
- (newsticker--group-find-parent-group cur-feed)
+ (thing (if (and move-group
+ (not (newsticker--group-get-group cur-feed)))
+ (car (newsticker--group-find-parent-group cur-feed))
cur-feed))
(parent-group (newsticker--group-find-parent-group
- (if move-group (car thing) thing))))
+ ;;(if move-group (car thing) thing)
+ thing)))
(unless parent-group
(error "Group not found!"))
(let* ((siblings (cdr parent-group))
- (pos (cl-position thing siblings :test 'equal))
+ (pos (cl-position thing siblings :test
+ (lambda (o1 o2)
+ (equal (if (listp o1) (car o1) o1)
+ (if (listp o2) (car o2) o2)))))
(tpos (+ pos delta ))
(new-pos (max 0 (min (length siblings) tpos)))
(beg (cl-subseq siblings 0 (min pos new-pos)))
(end (cl-subseq siblings (+ 1 (max pos new-pos))))
(p (elt siblings new-pos)))
(when (not (= pos new-pos))
- (setcdr parent-group
- (cl-concatenate 'list
- beg
- (if (> delta 0)
- (list p thing)
- (list thing p))
- end))
+ (let ((th (or (newsticker--group-get-group thing) thing)))
+ (setcdr parent-group
+ (cl-concatenate 'list
+ beg
+ (if (> delta 0)
+ (list p th)
+ (list th p))
+ end)))
(newsticker--treeview-tree-update)
(newsticker-treeview-update)
(newsticker-treeview-jump cur-feed)))))
diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el
index ca100267f672..595d63331a4a 100644
--- a/lisp/net/sieve.el
+++ b/lisp/net/sieve.el
@@ -1,4 +1,4 @@
-;;; sieve.el --- Utilities to manage sieve scripts
+;;; sieve.el --- Utilities to manage sieve scripts -*- lexical-binding: t; -*-
;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
@@ -69,13 +69,11 @@
(defcustom sieve-new-script ""
"Name of name script indicator."
- :type 'string
- :group 'sieve)
+ :type 'string)
(defcustom sieve-buffer "*sieve*"
"Name of sieve management buffer."
- :type 'string
- :group 'sieve)
+ :type 'string)
(defcustom sieve-template "\
require \"fileinto\";
@@ -91,8 +89,7 @@ require \"fileinto\";
# }
"
"Template sieve script."
- :type 'string
- :group 'sieve)
+ :type 'string)
;; Internal variables:
@@ -104,31 +101,36 @@ require \"fileinto\";
;; Sieve-manage mode:
+;; This function is defined by `easy-menu-define' but it's only done
+;; at run time and the compiler is not aware of it.
+;; FIXME: This is arguably a bug/problem in `easy-menu-define'.
+(declare-function sieve-manage-mode-menu "sieve")
+
(defvar sieve-manage-mode-map
(let ((map (make-sparse-keymap)))
;; various
- (define-key map "?" 'sieve-help)
- (define-key map "h" 'sieve-help)
+ (define-key map "?" #'sieve-help)
+ (define-key map "h" #'sieve-help)
;; activating
- (define-key map "m" 'sieve-activate)
- (define-key map "u" 'sieve-deactivate)
- (define-key map "\M-\C-?" 'sieve-deactivate-all)
+ (define-key map "m" #'sieve-activate)
+ (define-key map "u" #'sieve-deactivate)
+ (define-key map "\M-\C-?" #'sieve-deactivate-all)
;; navigation keys
- (define-key map "\C-p" 'sieve-prev-line)
- (define-key map [up] 'sieve-prev-line)
- (define-key map "\C-n" 'sieve-next-line)
- (define-key map [down] 'sieve-next-line)
- (define-key map " " 'sieve-next-line)
- (define-key map "n" 'sieve-next-line)
- (define-key map "p" 'sieve-prev-line)
- (define-key map "\C-m" 'sieve-edit-script)
- (define-key map "f" 'sieve-edit-script)
- (define-key map "o" 'sieve-edit-script-other-window)
- (define-key map "r" 'sieve-remove)
- (define-key map "q" 'sieve-bury-buffer)
- (define-key map "Q" 'sieve-manage-quit)
- (define-key map [(down-mouse-2)] 'sieve-edit-script)
- (define-key map [(down-mouse-3)] 'sieve-manage-mode-menu)
+ (define-key map "\C-p" #'sieve-prev-line)
+ (define-key map [up] #'sieve-prev-line)
+ (define-key map "\C-n" #'sieve-next-line)
+ (define-key map [down] #'sieve-next-line)
+ (define-key map " " #'sieve-next-line)
+ (define-key map "n" #'sieve-next-line)
+ (define-key map "p" #'sieve-prev-line)
+ (define-key map "\C-m" #'sieve-edit-script)
+ (define-key map "f" #'sieve-edit-script)
+ ;; (define-key map "o" #'sieve-edit-script-other-window)
+ (define-key map "r" #'sieve-remove)
+ (define-key map "q" #'sieve-bury-buffer)
+ (define-key map "Q" #'sieve-manage-quit)
+ (define-key map [(down-mouse-2)] #'sieve-edit-script)
+ (define-key map [(down-mouse-3)] #'sieve-manage-mode-menu)
map)
"Keymap for `sieve-manage-mode'.")
@@ -159,8 +161,8 @@ require \"fileinto\";
(interactive)
(bury-buffer))
-(defun sieve-activate (&optional pos)
- (interactive "d")
+(defun sieve-activate (&optional _pos)
+ (interactive)
(let ((name (sieve-script-at-point)) err)
(when (or (null name) (string-equal name sieve-new-script))
(error "No sieve script at point"))
@@ -171,20 +173,20 @@ require \"fileinto\";
(message "Activating script %s...done" name)
(message "Activating script %s...failed: %s" name (nth 2 err)))))
-(defun sieve-deactivate-all (&optional pos)
- (interactive "d")
- (let ((name (sieve-script-at-point)) err)
- (message "Deactivating scripts...")
- (setq err (sieve-manage-setactive "" sieve-manage-buffer))
+(defun sieve-deactivate-all (&optional _pos)
+ (interactive)
+ (message "Deactivating scripts...")
+ (let (;; (name (sieve-script-at-point))
+ (err (sieve-manage-setactive "" sieve-manage-buffer)))
(sieve-refresh-scriptlist)
(if (sieve-manage-ok-p err)
(message "Deactivating scripts...done")
(message "Deactivating scripts...failed: %s" (nth 2 err)))))
-(defalias 'sieve-deactivate 'sieve-deactivate-all)
+(defalias 'sieve-deactivate #'sieve-deactivate-all)
-(defun sieve-remove (&optional pos)
- (interactive "d")
+(defun sieve-remove (&optional _pos)
+ (interactive)
(let ((name (sieve-script-at-point)) err)
(when (or (null name) (string-equal name sieve-new-script))
(error "No sieve script at point"))
@@ -195,8 +197,8 @@ require \"fileinto\";
(sieve-refresh-scriptlist)
(message "Removing sieve script %s...done" name)))
-(defun sieve-edit-script (&optional pos)
- (interactive "d")
+(defun sieve-edit-script (&optional _pos)
+ (interactive)
(let ((name (sieve-script-at-point)))
(unless name
(error "No sieve script at point"))
@@ -224,11 +226,11 @@ require \"fileinto\";
(defmacro sieve-change-region (&rest body)
"Turns off sieve-region before executing BODY, then re-enables it after.
Used to bracket operations which move point in the sieve-buffer."
+ (declare (indent 0) (debug t))
`(progn
(sieve-highlight nil)
,@body
(sieve-highlight t)))
-(put 'sieve-change-region 'lisp-indent-function 0)
(defun sieve-next-line (&optional arg)
(interactive)
diff --git a/lisp/net/socks.el b/lisp/net/socks.el
index 96fafc826b82..1da1d31d6785 100644
--- a/lisp/net/socks.el
+++ b/lisp/net/socks.el
@@ -390,6 +390,8 @@
proc)))
(defun socks-send-command (proc command atype address port)
+ "Send COMMAND to SOCKS service PROC for proxying ADDRESS and PORT.
+When ATYPE indicates an IP, param ADDRESS must be given as raw bytes."
(let ((addr (cond
((or (= atype socks-address-type-v4)
(= atype socks-address-type-v6))
@@ -528,7 +530,7 @@
(setq host (socks-nslookup-host host))
(if (not (listp host))
(error "Could not get IP address for: %s" host))
- (setq host (apply #'format "%c%c%c%c" host))
+ (setq host (apply #'unibyte-string host))
socks-address-type-v4)
(t
socks-address-type-name))))
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 4519c34d36e8..69359553e445 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1928,7 +1928,7 @@ If ARGUMENT is non-nil, use it as argument for
;; Check whether we still have the same smbclient version.
;; Otherwise, we must delete the connection cache, because
- ;; capabilities migh have changed.
+ ;; capabilities might have changed.
(unless (or argument (processp p))
(let ((default-directory (tramp-compat-temporary-file-directory))
(command (concat tramp-smb-program " -V")))
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index 0602943db207..1bc905cee2dd 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -546,7 +546,7 @@ Many aspects this mode can be customized using
(when (and nxml-default-buffer-file-coding-system
(not (local-variable-p 'buffer-file-coding-system)))
(setq buffer-file-coding-system nxml-default-buffer-file-coding-system))
- ;; When starting a new file, insert the XML declaraction.
+ ;; When starting a new file, insert the XML declaration.
(when (and nxml-auto-insert-xml-declaration-flag
(zerop (buffer-size)))
(nxml-insert-xml-declaration)))
diff --git a/lisp/obsolete/abbrevlist.el b/lisp/obsolete/abbrevlist.el
index 1d517dbd1164..c9c0956903f2 100644
--- a/lisp/obsolete/abbrevlist.el
+++ b/lisp/obsolete/abbrevlist.el
@@ -1,4 +1,4 @@
-;;; abbrevlist.el --- list one abbrev table alphabetically ordered
+;;; abbrevlist.el --- list one abbrev table alphabetically ordered -*- lexical-binding: t; -*-
;; Copyright (C) 1986, 1992, 2001-2021 Free Software Foundation, Inc.
;; Suggested by a previous version by Gildea.
@@ -38,7 +38,7 @@
(function (lambda (abbrev)
(setq abbrev-list (cons abbrev abbrev-list))))
abbrev-table)
- (setq abbrev-list (sort abbrev-list 'string-lessp))
+ (setq abbrev-list (sort abbrev-list #'string-lessp))
(while abbrev-list
(if (> (+ first-column 40) (window-width))
(progn
diff --git a/lisp/obsolete/bruce.el b/lisp/obsolete/bruce.el
index 398f315c5d41..4aa6cd200e7a 100644
--- a/lisp/obsolete/bruce.el
+++ b/lisp/obsolete/bruce.el
@@ -1,4 +1,4 @@
-;;; bruce.el --- bruce phrase utility for overloading the Communications
+;;; bruce.el --- bruce phrase utility for overloading the Communications -*- lexical-binding: t; -*-
;;; Decency Act snoops, if any.
;; Copyright (C) 1988, 1993, 1997, 2001-2021 Free Software Foundation,
@@ -113,13 +113,11 @@
(defcustom bruce-phrases-file "~/bruce.lines"
"Keep your favorite phrases here."
- :type 'file
- :group 'bruce)
+ :type 'file)
(defcustom bruce-phrase-default-count 15
"Default number of phrases to insert."
- :type 'integer
- :group 'bruce)
+ :type 'integer)
;;;###autoload
(defun bruce ()
diff --git a/lisp/obsolete/cc-compat.el b/lisp/obsolete/cc-compat.el
index 96b036e892c8..037a8e9e87c3 100644
--- a/lisp/obsolete/cc-compat.el
+++ b/lisp/obsolete/cc-compat.el
@@ -1,4 +1,4 @@
-;;; cc-compat.el --- cc-mode compatibility with c-mode.el confusion
+;;; cc-compat.el --- cc-mode compatibility with c-mode.el confusion -*- lexical-binding: t; -*-
;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
@@ -156,7 +156,7 @@ This is in addition to c-continued-statement-offset.")
(if bracep 0 c-indent-level)))))
-(defun cc-substatement-open-offset (langelem)
+(defun cc-substatement-open-offset (_langelem)
(+ c-continued-statement-offset c-continued-brace-offset))
diff --git a/lisp/obsolete/cl-compat.el b/lisp/obsolete/cl-compat.el
index 4abedf3e6273..619bc06122b7 100644
--- a/lisp/obsolete/cl-compat.el
+++ b/lisp/obsolete/cl-compat.el
@@ -1,4 +1,4 @@
-;;; cl-compat.el --- Common Lisp extensions for GNU Emacs Lisp (compatibility)
+;;; cl-compat.el --- Common Lisp extensions for GNU Emacs Lisp (compatibility) -*- lexical-binding: t; -*-
;; Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
@@ -46,31 +46,23 @@
;;; Code:
-;; This used to be:
-;; (or (featurep 'cl) (require 'cl))
-;; which just has the effect of fooling the byte-compiler into not
-;; loading cl when compiling. However, that leads to some bogus
-;; compiler warnings. Loading cl when compiling cannot do any harm,
-;; because for a long time bootstrap-emacs contained 'cl, due to being
-;; dumped from uncompiled files that eval-when-compile'd cl. So every
-;; file was compiled with 'cl loaded.
-(require 'cl)
+(require 'cl-lib)
;;; Keyword routines not supported by new package.
(defmacro defkeyword (x &optional doc)
- (list* 'defconst x (list 'quote x) (and doc (list doc))))
+ (cl-list* 'defconst x (list 'quote x) (and doc (list doc))))
(defun keyword-of (sym)
(or (keywordp sym) (keywordp (intern (format ":%s" sym)))))
-;;; Multiple values. Note that the new package uses a different
-;;; convention for multiple values. The following definitions
-;;; emulate the old convention; all function names have been changed
-;;; by capitalizing the first letter: Values, Multiple-value-*,
-;;; to avoid conflict with the new-style definitions in cl-macs.
+;; Multiple values. Note that the new package uses a different
+;; convention for multiple values. The following definitions
+;; emulate the old convention; all function names have been changed
+;; by capitalizing the first letter: Values, Multiple-value-*,
+;; to avoid conflict with the new-style definitions in cl-macs.
(defvar *mvalues-values* nil)
@@ -79,7 +71,7 @@
(car val-forms))
(defun Values-list (val-forms)
- (apply 'values val-forms))
+ (apply #'cl-values val-forms))
(defmacro Multiple-value-list (form)
(list 'let* (list '(*mvalues-values* nil) (list '*mvalues-temp* form))
@@ -95,7 +87,7 @@
(defmacro Multiple-value-bind (vars form &rest body)
(declare (indent 2))
- (list* 'multiple-value-bind vars (list 'Multiple-value-list form) body))
+ (cl-list* 'multiple-value-bind vars (list 'Multiple-value-list form) body))
(defmacro Multiple-value-setq (vars form)
(declare (indent 2))
@@ -103,17 +95,16 @@
(defmacro Multiple-value-prog1 (form &rest body)
(declare (indent 1))
- (list 'prog1 form (list* 'let '((*mvalues-values* nil)) body)))
+ (list 'prog1 form (cl-list* 'let '((*mvalues-values* nil)) body)))
;;; Routines for parsing keyword arguments.
(defun build-klist (arglist keys &optional allow-others)
- (let ((res (Multiple-value-call 'mapcar* 'cons (unzip-lists arglist))))
+ (let ((res (Multiple-value-call #'cl-mapcar 'cons (unzip-lists arglist))))
(or allow-others
- (with-suppressed-warnings ((obsolete set-difference))
- (let ((bad (set-difference (mapcar 'car res) keys)))
- (if bad (error "Bad keywords: %s not in %s" bad keys)))))
+ (let ((bad (cl-set-difference (mapcar #'car res) keys)))
+ (if bad (error "Bad keywords: %s not in %s" bad keys))))
res))
(defun extract-from-klist (klist key &optional def)
@@ -131,18 +122,16 @@
(funcall (or test 'eql) item elt))))
(defun safe-idiv (a b)
- (with-suppressed-warnings ((obsolete signum))
- (let* ((q (/ (abs a) (abs b)))
- (s (* (signum a) (signum b))))
- (Values q (- a (* s q b)) s))))
+ (let* ((q (/ (abs a) (abs b)))
+ (s (* (cl-signum a) (cl-signum b))))
+ (Values q (- a (* s q b)) s)))
;; Internal routines.
(defun pair-with-newsyms (oldforms)
- (with-suppressed-warnings ((obsolete mapcar*))
- (let ((newsyms (mapcar (lambda (x) (make-symbol "--cl-var--")) oldforms)))
- (Values (mapcar* 'list newsyms oldforms) newsyms))))
+ (let ((newsyms (mapcar (lambda (_) (make-symbol "--cl-var--")) oldforms)))
+ (Values (cl-mapcar #'list newsyms oldforms) newsyms)))
(defun zip-lists (evens odds)
(cl-mapcan 'list evens odds))
@@ -154,7 +143,7 @@
(Values (nreverse e) (nreverse o))))
(defun reassemble-argslists (list)
- (let ((n (apply 'min (mapcar 'length list))) (res nil))
+ (let ((n (apply #'min (mapcar #'length list))) (res nil))
(while (>= (setq n (1- n)) 0)
(setq res (cons (mapcar (function (lambda (x) (elt x n))) list) res)))
res))
diff --git a/lisp/obsolete/cl.el b/lisp/obsolete/cl.el
index 95af29bb87f6..f91cfaa34c39 100644
--- a/lisp/obsolete/cl.el
+++ b/lisp/obsolete/cl.el
@@ -331,7 +331,7 @@ The two cases that are handled are:
(cddr f))))
(if (and cl-closure-vars
(cl--expr-contains-any body cl-closure-vars))
- (let* ((new (mapcar 'cl-gensym cl-closure-vars))
+ (let* ((new (mapcar #'cl-gensym cl-closure-vars))
(sub (cl-pairlis cl-closure-vars new)) (decls nil))
(while (or (stringp (car body))
(eq (car-safe (car body)) 'interactive))
@@ -446,7 +446,7 @@ will not work - use `labels' instead" (symbol-name (car x))))
;; FIXME This affects the rest of the file, when it
;; should be restricted to the flet body.
(and (boundp 'byte-compile-function-environment)
- (push (cons (car x) (eval func))
+ (push (cons (car x) (eval func t))
byte-compile-function-environment)))
(list `(symbol-function ',(car x)) func)))
bindings)
@@ -630,10 +630,10 @@ You can replace this macro with `gv-letplace'."
;;; Additional compatibility code.
;; For names that were clean but really aren't needed any more.
-(define-obsolete-function-alias 'cl-macroexpand 'macroexpand "24.3")
+(define-obsolete-function-alias 'cl-macroexpand #'macroexpand "24.3")
(define-obsolete-variable-alias 'cl-macro-environment
'macroexpand-all-environment "24.3")
-(define-obsolete-function-alias 'cl-macroexpand-all 'macroexpand-all "24.3")
+(define-obsolete-function-alias 'cl-macroexpand-all #'macroexpand-all "24.3")
;;; Hash tables.
;; This is just kept for compatibility with code byte-compiled by Emacs-20.
@@ -652,22 +652,22 @@ You can replace this macro with `gv-letplace'."
(defvar cl-builtin-maphash (symbol-function 'maphash))
(make-obsolete-variable 'cl-builtin-maphash nil "24.3")
-(define-obsolete-function-alias 'cl-map-keymap 'map-keymap "24.3")
-(define-obsolete-function-alias 'cl-copy-tree 'copy-tree "24.3")
-(define-obsolete-function-alias 'cl-gethash 'gethash "24.3")
-(define-obsolete-function-alias 'cl-puthash 'puthash "24.3")
-(define-obsolete-function-alias 'cl-remhash 'remhash "24.3")
-(define-obsolete-function-alias 'cl-clrhash 'clrhash "24.3")
-(define-obsolete-function-alias 'cl-maphash 'maphash "24.3")
-(define-obsolete-function-alias 'cl-make-hash-table 'make-hash-table "24.3")
-(define-obsolete-function-alias 'cl-hash-table-p 'hash-table-p "24.3")
-(define-obsolete-function-alias 'cl-hash-table-count 'hash-table-count "24.3")
+(define-obsolete-function-alias 'cl-map-keymap #'map-keymap "24.3")
+(define-obsolete-function-alias 'cl-copy-tree #'copy-tree "24.3")
+(define-obsolete-function-alias 'cl-gethash #'gethash "24.3")
+(define-obsolete-function-alias 'cl-puthash #'puthash "24.3")
+(define-obsolete-function-alias 'cl-remhash #'remhash "24.3")
+(define-obsolete-function-alias 'cl-clrhash #'clrhash "24.3")
+(define-obsolete-function-alias 'cl-maphash #'maphash "24.3")
+(define-obsolete-function-alias 'cl-make-hash-table #'make-hash-table "24.3")
+(define-obsolete-function-alias 'cl-hash-table-p #'hash-table-p "24.3")
+(define-obsolete-function-alias 'cl-hash-table-count #'hash-table-count "24.3")
(define-obsolete-function-alias 'cl-map-keymap-recursively
- 'cl--map-keymap-recursively "24.3")
-(define-obsolete-function-alias 'cl-map-intervals 'cl--map-intervals "24.3")
-(define-obsolete-function-alias 'cl-map-extents 'cl--map-overlays "24.3")
-(define-obsolete-function-alias 'cl-set-getf 'cl--set-getf "24.3")
+ #'cl--map-keymap-recursively "24.3")
+(define-obsolete-function-alias 'cl-map-intervals #'cl--map-intervals "24.3")
+(define-obsolete-function-alias 'cl-map-extents #'cl--map-overlays "24.3")
+(define-obsolete-function-alias 'cl-set-getf #'cl--set-getf "24.3")
(defun cl-maclisp-member (item list)
(declare (obsolete member "24.3"))
diff --git a/lisp/obsolete/complete.el b/lisp/obsolete/complete.el
index 735e1e0b6a66..1c1167db89bd 100644
--- a/lisp/obsolete/complete.el
+++ b/lisp/obsolete/complete.el
@@ -1,4 +1,4 @@
-;;; complete.el --- partial completion mechanism plus other goodies
+;;; complete.el --- partial completion mechanism plus other goodies -*- lexical-binding: t; -*-
;; Copyright (C) 1990-1993, 1999-2021 Free Software Foundation, Inc.
@@ -102,14 +102,12 @@ If non-nil and non-t, the first character is taken literally only for file name
completion."
:type '(choice (const :tag "delimiter" nil)
(const :tag "literal" t)
- (other :tag "find-file" find-file))
- :group 'partial-completion)
+ (other :tag "find-file" find-file)))
(defcustom PC-meta-flag t
"If non-nil, TAB means PC completion and M-TAB means normal completion.
Otherwise, TAB means normal completion and M-TAB means Partial Completion."
- :type 'boolean
- :group 'partial-completion)
+ :type 'boolean)
(defcustom PC-word-delimiters "-_. "
"A string of characters treated as word delimiters for completion.
@@ -119,19 +117,16 @@ If `^' is in this string, it must not come first.
If `-' is in this string, it must come first or right after `]'.
In other words, if S is this string, then `[S]' must be a valid Emacs regular
expression (not containing character ranges like `a-z')."
- :type 'string
- :group 'partial-completion)
+ :type 'string)
(defcustom PC-include-file-path '("/usr/include" "/usr/local/include")
"A list of directories in which to look for include files.
If nil, means use the colon-separated path in the variable $INCPATH instead."
- :type '(repeat directory)
- :group 'partial-completion)
+ :type '(repeat directory))
(defcustom PC-disable-includes nil
"If non-nil, include-file support in \\[find-file] is disabled."
- :type 'boolean
- :group 'partial-completion)
+ :type 'boolean)
(defvar PC-default-bindings t
"If non-nil, default partial completion key bindings are suppressed.")
@@ -146,36 +141,36 @@ If nil, means use the colon-separated path in the variable $INCPATH instead."
(cond ((not bind)
;; These bindings are the default bindings. It would be better to
;; restore the previous bindings.
- (define-key read-expression-map "\e\t" 'lisp-complete-symbol)
+ (define-key read-expression-map "\e\t" #'completion-at-point)
- (define-key completion-map "\t" 'minibuffer-complete)
- (define-key completion-map " " 'minibuffer-complete-word)
- (define-key completion-map "?" 'minibuffer-completion-help)
+ (define-key completion-map "\t" #'minibuffer-complete)
+ (define-key completion-map " " #'minibuffer-complete-word)
+ (define-key completion-map "?" #'minibuffer-completion-help)
- (define-key must-match-map "\r" 'minibuffer-complete-and-exit)
- (define-key must-match-map "\n" 'minibuffer-complete-and-exit)
+ (define-key must-match-map "\r" #'minibuffer-complete-and-exit)
+ (define-key must-match-map "\n" #'minibuffer-complete-and-exit)
(define-key global-map [remap lisp-complete-symbol] nil))
(PC-default-bindings
- (define-key read-expression-map "\e\t" 'PC-lisp-complete-symbol)
+ (define-key read-expression-map "\e\t" #'PC-lisp-complete-symbol)
- (define-key completion-map "\t" 'PC-complete)
- (define-key completion-map " " 'PC-complete-word)
- (define-key completion-map "?" 'PC-completion-help)
+ (define-key completion-map "\t" #'PC-complete)
+ (define-key completion-map " " #'PC-complete-word)
+ (define-key completion-map "?" #'PC-completion-help)
- (define-key completion-map "\e\t" 'PC-complete)
- (define-key completion-map "\e " 'PC-complete-word)
- (define-key completion-map "\e\r" 'PC-force-complete-and-exit)
- (define-key completion-map "\e\n" 'PC-force-complete-and-exit)
- (define-key completion-map "\e?" 'PC-completion-help)
+ (define-key completion-map "\e\t" #'PC-complete)
+ (define-key completion-map "\e " #'PC-complete-word)
+ (define-key completion-map "\e\r" #'PC-force-complete-and-exit)
+ (define-key completion-map "\e\n" #'PC-force-complete-and-exit)
+ (define-key completion-map "\e?" #'PC-completion-help)
- (define-key must-match-map "\r" 'PC-complete-and-exit)
- (define-key must-match-map "\n" 'PC-complete-and-exit)
+ (define-key must-match-map "\r" #'PC-complete-and-exit)
+ (define-key must-match-map "\n" #'PC-complete-and-exit)
- (define-key must-match-map "\e\r" 'PC-complete-and-exit)
- (define-key must-match-map "\e\n" 'PC-complete-and-exit)
+ (define-key must-match-map "\e\r" #'PC-complete-and-exit)
+ (define-key must-match-map "\e\n" #'PC-complete-and-exit)
- (define-key global-map [remap lisp-complete-symbol] 'PC-lisp-complete-symbol)))))
+ (define-key global-map [remap lisp-complete-symbol] #'PC-lisp-complete-symbol)))))
(defvar PC-do-completion-end nil
"Internal variable used by `PC-do-completion'.")
@@ -212,14 +207,15 @@ see), so that if it is neither nil nor t, Emacs shows the `*Completions*'
buffer only on the second attempt to complete. That is, if TAB finds nothing
to complete, the first TAB just says \"Next char not unique\" and the
second TAB brings up the `*Completions*' buffer."
- :global t :group 'partial-completion
+ :global t
;; Deal with key bindings...
(PC-bindings partial-completion-mode)
;; Deal with include file feature...
(cond ((not partial-completion-mode)
- (remove-hook 'find-file-not-found-functions 'PC-look-for-include-file))
+ (remove-hook 'find-file-not-found-functions
+ #'PC-look-for-include-file))
((not PC-disable-includes)
- (add-hook 'find-file-not-found-functions 'PC-look-for-include-file)))
+ (add-hook 'find-file-not-found-functions #'PC-look-for-include-file)))
;; Adjust the completion selection in *Completion* buffers to the way
;; we work. The default minibuffer completion code only completes the
;; text before point and leaves the text after point alone (new in
@@ -229,9 +225,9 @@ second TAB brings up the `*Completions*' buffer."
;; to trick choose-completion into replacing the whole minibuffer text
;; rather than only the text before point. --Stef
(funcall
- (if partial-completion-mode 'add-hook 'remove-hook)
+ (if partial-completion-mode #'add-hook #'remove-hook)
'choose-completion-string-functions
- (lambda (choice buffer &rest ignored)
+ (lambda (_choice buffer &rest _)
;; When completing M-: (lisp- ) with point before the ), it is
;; not appropriate to go to point-max (unlike the filename case).
(if (and (not PC-goto-end)
@@ -648,7 +644,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
(when (string-match regex x)
(push x p)))
(setq basestr (try-completion "" p)))
- (setq basestr (mapconcat 'list str "-"))
+ (setq basestr (mapconcat #'list str "-"))
(delete-region beg end)
(setq end (+ beg (length basestr)))
(insert basestr))))
@@ -672,7 +668,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
(setq PC-ignored-regexp
(concat "\\("
(mapconcat
- 'regexp-quote
+ #'regexp-quote
(setq PC-ignored-extensions
completion-ignored-extensions)
"\\|")
@@ -815,7 +811,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
(eq mode 'help))
(let ((prompt-end (minibuffer-prompt-end)))
(with-output-to-temp-buffer "*Completions*"
- (display-completion-list (sort helpposs 'string-lessp))
+ (display-completion-list (sort helpposs #'string-lessp))
(setq PC-do-completion-end end
PC-goto-end goto-end)
(with-current-buffer standard-output
@@ -1093,7 +1089,7 @@ absolute rather than relative to some directory on the SEARCH-PATH."
file-lists))))
(setq search-path (cdr search-path))))
;; Compress out duplicates while building complete list (slloooow!)
- (let ((sorted (sort (apply 'nconc file-lists)
+ (let ((sorted (sort (apply #'nconc file-lists)
(lambda (x y) (not (string-lessp x y)))))
compressed)
(while sorted
diff --git a/lisp/obsolete/crisp.el b/lisp/obsolete/crisp.el
index 91ff899c84d5..69bf3ed12bcf 100644
--- a/lisp/obsolete/crisp.el
+++ b/lisp/obsolete/crisp.el
@@ -1,4 +1,4 @@
-;;; crisp.el --- CRiSP/Brief Emacs emulator
+;;; crisp.el --- CRiSP/Brief Emacs emulator -*- lexical-binding: t; -*-
;; Copyright (C) 1997-1999, 2001-2021 Free Software Foundation, Inc.
@@ -66,63 +66,63 @@
(defvar crisp-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map [(f1)] 'other-window)
+ (define-key map [(f1)] #'other-window)
- (define-key map [(f2) (down)] 'enlarge-window)
- (define-key map [(f2) (left)] 'shrink-window-horizontally)
- (define-key map [(f2) (right)] 'enlarge-window-horizontally)
- (define-key map [(f2) (up)] 'shrink-window)
- (define-key map [(f3) (down)] 'split-window-below)
- (define-key map [(f3) (right)] 'split-window-right)
+ (define-key map [(f2) (down)] #'enlarge-window)
+ (define-key map [(f2) (left)] #'shrink-window-horizontally)
+ (define-key map [(f2) (right)] #'enlarge-window-horizontally)
+ (define-key map [(f2) (up)] #'shrink-window)
+ (define-key map [(f3) (down)] #'split-window-below)
+ (define-key map [(f3) (right)] #'split-window-right)
- (define-key map [(f4)] 'delete-window)
- (define-key map [(control f4)] 'delete-other-windows)
+ (define-key map [(f4)] #'delete-window)
+ (define-key map [(control f4)] #'delete-other-windows)
- (define-key map [(f5)] 'search-forward-regexp)
- (define-key map [(f19)] 'search-forward-regexp)
- (define-key map [(meta f5)] 'search-backward-regexp)
+ (define-key map [(f5)] #'search-forward-regexp)
+ (define-key map [(f19)] #'search-forward-regexp)
+ (define-key map [(meta f5)] #'search-backward-regexp)
- (define-key map [(f6)] 'query-replace)
+ (define-key map [(f6)] #'query-replace)
- (define-key map [(f7)] 'start-kbd-macro)
- (define-key map [(meta f7)] 'end-kbd-macro)
+ (define-key map [(f7)] #'start-kbd-macro)
+ (define-key map [(meta f7)] #'end-kbd-macro)
- (define-key map [(f8)] 'call-last-kbd-macro)
- (define-key map [(meta f8)] 'save-kbd-macro)
+ (define-key map [(f8)] #'call-last-kbd-macro)
+ ;;(define-key map [(meta f8)] #'save-kbd-macro) ;FIXME:Unknown command?
- (define-key map [(f9)] 'find-file)
- (define-key map [(meta f9)] 'load-library)
+ (define-key map [(f9)] #'find-file)
+ (define-key map [(meta f9)] #'load-library)
- (define-key map [(f10)] 'execute-extended-command)
- (define-key map [(meta f10)] 'compile)
+ (define-key map [(f10)] #'execute-extended-command)
+ (define-key map [(meta f10)] #'compile)
- (define-key map [(SunF37)] 'kill-buffer)
- (define-key map [(kp-add)] 'crisp-copy-line)
- (define-key map [(kp-subtract)] 'crisp-kill-line)
+ (define-key map [(SunF37)] #'kill-buffer)
+ (define-key map [(kp-add)] #'crisp-copy-line)
+ (define-key map [(kp-subtract)] #'crisp-kill-line)
;; just to cover all the bases (GNU Emacs, for instance)
- (define-key map [(f24)] 'crisp-kill-line)
- (define-key map [(insert)] 'crisp-yank-clipboard)
- (define-key map [(f16)] 'crisp-set-clipboard) ; copy on Sun5 kbd
- (define-key map [(f20)] 'crisp-kill-region) ; cut on Sun5 kbd
- (define-key map [(f18)] 'crisp-yank-clipboard) ; paste on Sun5 kbd
+ (define-key map [(f24)] #'crisp-kill-line)
+ (define-key map [(insert)] #'crisp-yank-clipboard)
+ (define-key map [(f16)] #'crisp-set-clipboard) ; copy on Sun5 kbd
+ (define-key map [(f20)] #'crisp-kill-region) ; cut on Sun5 kbd
+ (define-key map [(f18)] #'crisp-yank-clipboard) ; paste on Sun5 kbd
- (define-key map [(control f)] 'fill-paragraph-or-region)
+ ;; (define-key map [(control f)] #'fill-paragraph-or-region)
(define-key map [(meta d)] (lambda ()
(interactive)
(beginning-of-line) (kill-line)))
- (define-key map [(meta e)] 'find-file)
- (define-key map [(meta g)] 'goto-line)
- (define-key map [(meta h)] 'help)
- (define-key map [(meta i)] 'overwrite-mode)
- (define-key map [(meta j)] 'bookmark-jump)
- (define-key map [(meta l)] 'crisp-mark-line)
- (define-key map [(meta m)] 'set-mark-command)
- (define-key map [(meta n)] 'bury-buffer)
- (define-key map [(meta p)] 'crisp-unbury-buffer)
- (define-key map [(meta u)] 'undo)
- (define-key map [(f14)] 'undo)
- (define-key map [(meta w)] 'save-buffer)
- (define-key map [(meta x)] 'crisp-meta-x-wrapper)
+ (define-key map [(meta e)] #'find-file)
+ (define-key map [(meta g)] #'goto-line)
+ (define-key map [(meta h)] #'help)
+ (define-key map [(meta i)] #'overwrite-mode)
+ (define-key map [(meta j)] #'bookmark-jump)
+ (define-key map [(meta l)] #'crisp-mark-line)
+ (define-key map [(meta m)] #'set-mark-command)
+ (define-key map [(meta n)] #'bury-buffer)
+ (define-key map [(meta p)] #'crisp-unbury-buffer)
+ (define-key map [(meta u)] #'undo)
+ (define-key map [(f14)] #'undo)
+ (define-key map [(meta w)] #'save-buffer)
+ (define-key map [(meta x)] #'crisp-meta-x-wrapper)
(define-key map [(meta ?0)] (lambda ()
(interactive)
(bookmark-set "0")))
@@ -154,21 +154,21 @@
(interactive)
(bookmark-set "9")))
- (define-key map [(shift delete)] 'kill-word)
- (define-key map [(shift backspace)] 'backward-kill-word)
- (define-key map [(control left)] 'backward-word)
- (define-key map [(control right)] 'forward-word)
+ (define-key map [(shift delete)] #'kill-word)
+ (define-key map [(shift backspace)] #'backward-kill-word)
+ (define-key map [(control left)] #'backward-word)
+ (define-key map [(control right)] #'forward-word)
- (define-key map [(home)] 'crisp-home)
+ (define-key map [(home)] #'crisp-home)
(define-key map [(control home)] (lambda ()
(interactive)
(move-to-window-line 0)))
- (define-key map [(meta home)] 'beginning-of-line)
- (define-key map [(end)] 'crisp-end)
+ (define-key map [(meta home)] #'beginning-of-line)
+ (define-key map [(end)] #'crisp-end)
(define-key map [(control end)] (lambda ()
(interactive)
(move-to-window-line -1)))
- (define-key map [(meta end)] 'end-of-line)
+ (define-key map [(meta end)] #'end-of-line)
map)
"Local keymap for CRiSP emulation mode.
All the bindings are done here instead of globally to try and be
@@ -179,8 +179,7 @@ nice to the world.")
(defcustom crisp-mode-mode-line-string " *CRiSP*"
"String to display in the mode line when CRiSP emulation mode is enabled."
- :type 'string
- :group 'crisp)
+ :type 'string)
;;;###autoload
(defcustom crisp-mode nil
@@ -190,20 +189,18 @@ indicates CRiSP mode is enabled.
Setting this variable directly does not take effect;
use either M-x customize or the function `crisp-mode'."
- :set (lambda (symbol value) (crisp-mode (if value 1 0)))
- :initialize 'custom-initialize-default
+ :set (lambda (_symbol value) (crisp-mode (if value 1 0)))
+ :initialize #'custom-initialize-default
:require 'crisp
:version "20.4"
- :type 'boolean
- :group 'crisp)
+ :type 'boolean)
(defcustom crisp-override-meta-x t
"Controls overriding the normal Emacs M-x key binding in the CRiSP emulator.
Normally the CRiSP emulator rebinds M-x to `save-buffers-exit-emacs', and
provides the usual M-x functionality on the F10 key. If this variable
is non-nil, M-x will exit Emacs."
- :type 'boolean
- :group 'crisp)
+ :type 'boolean)
(defcustom crisp-load-scroll-all nil
"Controls loading of the Scroll Lock in the CRiSP emulator.
@@ -212,18 +209,15 @@ package when enabling the CRiSP emulator.
If this variable is nil when you start the CRiSP emulator, it
does not load the scroll-all package."
- :type 'boolean
- :group 'crisp)
+ :type 'boolean)
(defcustom crisp-load-hook nil
"Hooks to run after loading the CRiSP emulator package."
- :type 'hook
- :group 'crisp)
+ :type 'hook)
(defcustom crisp-mode-hook nil
"Hook run by the function `crisp-mode'."
- :type 'hook
- :group 'crisp)
+ :type 'hook)
(defconst crisp-version "1.34"
"The version of the CRiSP emulator.")
@@ -370,11 +364,11 @@ normal CRiSP binding) and when it is nil M-x will run
(if crisp-load-scroll-all
(require 'scroll-all))
(if (featurep 'scroll-all)
- (define-key crisp-mode-map [(meta f1)] 'scroll-all-mode))))
+ (define-key crisp-mode-map [(meta f1)] #'scroll-all-mode))))
;; People might use Apropos on `brief'.
;;;###autoload
-(defalias 'brief-mode 'crisp-mode)
+(defalias 'brief-mode #'crisp-mode)
(run-hooks 'crisp-load-hook)
(provide 'crisp)
diff --git a/lisp/obsolete/cust-print.el b/lisp/obsolete/cust-print.el
index c7342b61ae79..01fcd38199c8 100644
--- a/lisp/obsolete/cust-print.el
+++ b/lisp/obsolete/cust-print.el
@@ -1,4 +1,4 @@
-;;; cust-print.el --- handles print-level and print-circle
+;;; cust-print.el --- handles print-level and print-circle -*- lexical-binding: t; -*-
;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc.
@@ -118,9 +118,6 @@
;; Emacs 18 doesn't have defalias.
;; Provide def for byte compiler.
-(eval-and-compile
- (or (fboundp 'defalias) (fset 'defalias 'fset)))
-
;; Variables:
;;=========================================================
@@ -141,8 +138,7 @@ If non-nil, components at levels equal to or greater than `print-level'
are printed simply as `#'. The object to be printed is at level 0,
and if the object is a list or vector, its top-level components are at
level 1."
- :type '(choice (const nil) integer)
- :group 'cust-print)
+ :type '(choice (const nil) integer))
(defcustom print-circle nil
@@ -157,14 +153,12 @@ If non-nil, shared substructures anywhere in the structure are printed
with `#N=' before the first occurrence (in the order of the print
representation) and `#N#' in place of each subsequent occurrence,
where N is a positive decimal integer."
- :type 'boolean
- :group 'cust-print)
+ :type 'boolean)
(defcustom custom-print-vectors nil
"Non-nil if printing of vectors should obey `print-level' and `print-length'."
- :type 'boolean
- :group 'cust-print)
+ :type 'boolean)
;; Custom printers
@@ -201,7 +195,7 @@ Any pair that has the same PREDICATE is first removed."
(cust-print-update-custom-printers))
-(defun cust-print-use-custom-printer (object)
+(defun cust-print-use-custom-printer (_object)
;; Default function returns nil.
nil)
@@ -231,11 +225,11 @@ Any pair that has the same PREDICATE is first removed."
(defalias (car symbol-pair)
(symbol-function (car (cdr symbol-pair)))))
-(defun cust-print-original-princ (object &optional stream)) ; dummy def
+(defun cust-print-original-princ (_object &optional _stream) nil) ; dummy def
;; Save emacs routines.
(if (not (fboundp 'cust-print-original-prin1))
- (mapc 'cust-print-set-function-cell
+ (mapc #'cust-print-set-function-cell
'((cust-print-original-prin1 prin1)
(cust-print-original-princ princ)
(cust-print-original-print print)
@@ -243,14 +237,15 @@ Any pair that has the same PREDICATE is first removed."
(cust-print-original-format format)
(cust-print-original-message message)
(cust-print-original-error error))))
-
+(declare-function cust-print-original-format "cust-print")
+(declare-function cust-print-original-message "cust-print")
(defun custom-print-install ()
"Replace print functions with general, customizable, Lisp versions.
The Emacs subroutines are saved away, and you can reinstall them
by running `custom-print-uninstall'."
(interactive)
- (mapc 'cust-print-set-function-cell
+ (mapc #'cust-print-set-function-cell
'((prin1 custom-prin1)
(princ custom-princ)
(print custom-print)
@@ -264,7 +259,7 @@ by running `custom-print-uninstall'."
(defun custom-print-uninstall ()
"Reset print functions to their Emacs subroutines."
(interactive)
- (mapc 'cust-print-set-function-cell
+ (mapc #'cust-print-set-function-cell
'((prin1 cust-print-original-prin1)
(princ cust-print-original-princ)
(print cust-print-original-print)
@@ -275,22 +270,20 @@ by running `custom-print-uninstall'."
))
t)
-(defalias 'custom-print-funcs-installed-p 'custom-print-installed-p)
+(defalias 'custom-print-funcs-installed-p #'custom-print-installed-p)
(defun custom-print-installed-p ()
"Return t if custom-print is currently installed, nil otherwise."
(eq (symbol-function 'custom-prin1) (symbol-function 'prin1)))
-(put 'with-custom-print-funcs 'edebug-form-spec '(body))
-(put 'with-custom-print 'edebug-form-spec '(body))
-
-(defalias 'with-custom-print-funcs 'with-custom-print)
(defmacro with-custom-print (&rest body)
"Temporarily install the custom print package while executing BODY."
+ (declare (debug t))
`(unwind-protect
(progn
(custom-print-install)
,@body)
(custom-print-uninstall)))
+(defalias 'with-custom-print-funcs #'with-custom-print)
;; Lisp replacements for prin1 and princ, and for some subrs that use them
@@ -369,7 +362,7 @@ vector, or symbol args. The format specification for such args should
be `%s' in any case, so a string argument will also work. The string
is generated with `custom-prin1-to-string', which quotes quotable
characters."
- (apply 'cust-print-original-format fmt
+ (apply #'cust-print-original-format fmt
(mapcar (function (lambda (arg)
(if (or (listp arg) (vectorp arg) (symbolp arg))
(custom-prin1-to-string arg)
@@ -393,7 +386,7 @@ See `custom-format' for the details."
;; because the echo area requires special handling
;; to avoid duplicating the output.
;; cust-print-original-message does it right.
- (apply 'cust-print-original-message fmt
+ (apply #'cust-print-original-message fmt
(mapcar (function (lambda (arg)
(if (or (listp arg) (vectorp arg) (symbolp arg))
(custom-prin1-to-string arg)
@@ -406,7 +399,7 @@ See `custom-format' for the details."
This is the custom-print replacement for the standard `error'.
See `custom-format' for the details."
- (signal 'error (list (apply 'custom-format fmt args))))
+ (signal 'error (list (apply #'custom-format fmt args))))
@@ -417,9 +410,9 @@ See `custom-format' for the details."
(defvar circle-table)
(defvar cust-print-current-level)
-(defun cust-print-original-printer (object)) ; One of the standard printers.
-(defun cust-print-low-level-prin (object)) ; Used internally.
-(defun cust-print-prin (object)) ; Call this to print recursively.
+(defun cust-print-original-printer (_object) nil) ; One of the standard printers.
+(defun cust-print-low-level-prin (_object) nil) ; Used internally.
+(defun cust-print-prin (_object) nil) ; Call this to print recursively.
(defun cust-print-top-level (object stream emacs-printer)
;; Set up for printing.
diff --git a/lisp/obsolete/erc-compat.el b/lisp/obsolete/erc-compat.el
index 203ef079c140..3a1699adac95 100644
--- a/lisp/obsolete/erc-compat.el
+++ b/lisp/obsolete/erc-compat.el
@@ -1,4 +1,4 @@
-;;; erc-compat.el --- ERC compatibility code for XEmacs
+;;; erc-compat.el --- ERC compatibility code for XEmacs -*- lexical-binding: t; -*-
;; Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
@@ -31,7 +31,7 @@
(require 'format-spec)
;;;###autoload(autoload 'erc-define-minor-mode "erc-compat")
-(defalias 'erc-define-minor-mode 'define-minor-mode)
+(defalias 'erc-define-minor-mode #'define-minor-mode)
(put 'erc-define-minor-mode 'edebug-form-spec 'define-minor-mode)
(defun erc-decode-coding-string (s coding-system)
@@ -73,7 +73,7 @@ are placed.
Note that this should end with a directory separator.")
(defun erc-replace-match-subexpression-in-string
- (newtext string match subexp start &optional fixedcase literal)
+ (newtext string _match subexp _start &optional fixedcase literal)
"Replace the subexpression SUBEXP of the last match in STRING with NEWTEXT.
MATCH is the text which matched the subexpression (see `match-string').
START is the beginning position of the last match (see `match-beginning').
diff --git a/lisp/obsolete/erc-hecomplete.el b/lisp/obsolete/erc-hecomplete.el
index fce79f7f34ff..36b08d56f7b3 100644
--- a/lisp/obsolete/erc-hecomplete.el
+++ b/lisp/obsolete/erc-hecomplete.el
@@ -1,4 +1,4 @@
-;;; erc-hecomplete.el --- Provides Nick name completion for ERC
+;;; erc-hecomplete.el --- Provides Nick name completion for ERC -*- lexical-binding: t; -*-
;; Copyright (C) 2001-2002, 2004, 2006-2021 Free Software Foundation,
;; Inc.
@@ -39,8 +39,8 @@
;;;###autoload (autoload 'erc-hecomplete-mode "erc-hecomplete" nil t)
(define-erc-module hecomplete nil
"Complete nick at point."
- ((add-hook 'erc-complete-functions 'erc-hecomplete))
- ((remove-hook 'erc-complete-functions 'erc-hecomplete)))
+ ((add-hook 'erc-complete-functions #'erc-hecomplete))
+ ((remove-hook 'erc-complete-functions #'erc-hecomplete)))
(defun erc-hecomplete ()
"Complete nick at point.
@@ -70,15 +70,13 @@ or you may use an arbitrary lisp expression."
erc-nick-completion-exclude-myself)
(repeat :tag "List" (string :tag "Nick"))
function
- sexp)
- :group 'erc-hecomplete)
+ sexp))
(defcustom erc-nick-completion-ignore-case t
"Non-nil means don't consider case significant in nick completion.
Case will be automatically corrected when non-nil.
For instance if you type \"dely TAB\" the word completes and changes to
\"delYsid\"."
- :group 'erc-hecomplete
:type 'boolean)
(defun erc-nick-completion-exclude-myself ()
@@ -95,7 +93,6 @@ typing \"f o TAB\" will directly give you foobar. Use this with
(defcustom erc-nick-completion-postfix ": "
"When `erc-complete' is used in the first word after the prompt,
add this string when a unique expansion was found."
- :group 'erc-hecomplete
:type 'string)
(defun erc-command-list ()
diff --git a/lisp/obsolete/eudcb-ph.el b/lisp/obsolete/eudcb-ph.el
index c7212e3fdb7d..187879ce2f76 100644
--- a/lisp/obsolete/eudcb-ph.el
+++ b/lisp/obsolete/eudcb-ph.el
@@ -1,4 +1,4 @@
-;;; eudcb-ph.el --- Emacs Unified Directory Client - CCSO PH/QI Backend
+;;; eudcb-ph.el --- Emacs Unified Directory Client - CCSO PH/QI Backend -*- lexical-binding: t; -*-
;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
@@ -69,7 +69,7 @@ defaulting to `eudc-default-return-attributes'."
query
" "))
(if return-fields
- (concat " return " (mapconcat 'symbol-name return-fields " ")))))
+ (concat " return " (mapconcat #'symbol-name return-fields " ")))))
(and (> (length request) 6)
(eudc-ph-do-request request)
(eudc-ph-parse-query-result return-fields))))
@@ -189,7 +189,7 @@ SERVER is either a string naming the server or a list (NAME PORT)."
(with-current-buffer (process-buffer process)
(eudc-ph-send-command process "quit")
(eudc-ph-read-response process)
- (run-at-time 2 nil 'delete-process process)))
+ (run-at-time 2 nil #'delete-process process)))
(defun eudc-ph-send-command (process command)
(goto-char (point-max))
diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el
index 8848c89c62f5..baed8be76631 100644
--- a/lisp/obsolete/fast-lock.el
+++ b/lisp/obsolete/fast-lock.el
@@ -1,4 +1,4 @@
-;;; fast-lock.el --- automagic text properties caching for fast Font Lock mode
+;;; fast-lock.el --- automagic text properties caching for fast Font Lock mode -*- lexical-binding: t; -*-
;; Copyright (C) 1994-1998, 2001-2021 Free Software Foundation, Inc.
@@ -190,18 +190,6 @@
(defvar font-lock-face-list)
(eval-when-compile
- ;; We use this to preserve or protect things when modifying text properties.
- (defmacro save-buffer-state (varlist &rest body)
- "Bind variables according to VARLIST and eval BODY restoring buffer state."
- `(let* (,@(append varlist
- '((modified (buffer-modified-p)) (buffer-undo-list t)
- (inhibit-read-only t) (inhibit-point-motion-hooks t)
- (inhibit-modification-hooks t)
- deactivate-mark buffer-file-name buffer-file-truename)))
- ,@body
- (when (and (not modified) (buffer-modified-p))
- (set-buffer-modified-p nil))))
- (put 'save-buffer-state 'lisp-indent-function 1)
;;
;; We use this to verify that a face should be saved.
(defmacro fast-lock-save-facep (face)
@@ -244,8 +232,7 @@ for buffers in Rmail mode, and size is irrelevant otherwise."
(symbol :tag "name"))
(radio :tag "Size"
(const :tag "none" nil)
- (integer :tag "size")))))
- :group 'fast-lock)
+ (integer :tag "size"))))))
(defcustom fast-lock-cache-directories '("~/.emacs-flc")
; - `internal', keep each file's Font Lock cache file in the same file.
@@ -271,8 +258,7 @@ to avoid the possibility of using the cache of another user."
:type '(repeat (radio (directory :tag "directory")
(cons :tag "Matching"
(regexp :tag "regexp")
- (directory :tag "directory"))))
- :group 'fast-lock)
+ (directory :tag "directory")))))
(put 'fast-lock-cache-directories 'risky-local-variable t)
(defcustom fast-lock-save-events '(kill-buffer kill-emacs)
@@ -282,23 +268,20 @@ If concurrent editing sessions use the same associated cache file for a file's
buffer, then you should add `save-buffer' to this list."
:type '(set (const :tag "buffer saving" save-buffer)
(const :tag "buffer killing" kill-buffer)
- (const :tag "emacs killing" kill-emacs))
- :group 'fast-lock)
+ (const :tag "emacs killing" kill-emacs)))
(defcustom fast-lock-save-others t
"If non-nil, save Font Lock cache files irrespective of file owner.
If nil, means only buffer files known to be owned by you can have associated
Font Lock cache files saved. Ownership may be unknown for networked files."
- :type 'boolean
- :group 'fast-lock)
+ :type 'boolean)
(defcustom fast-lock-verbose font-lock-verbose
"If non-nil, means show status messages for cache processing.
If a number, only buffers greater than this size have processing messages."
:type '(choice (const :tag "never" nil)
(other :tag "always" t)
- (integer :tag "size"))
- :group 'fast-lock)
+ (integer :tag "size")))
(defvar fast-lock-save-faces
(when (featurep 'xemacs)
@@ -455,8 +438,7 @@ See `fast-lock-mode'."
;; Flag so that a cache will be saved later even if the file is never saved.
(setq fast-lock-cache-timestamp nil))
-(defalias 'fast-lock-after-unfontify-buffer
- 'ignore)
+(defalias 'fast-lock-after-unfontify-buffer #'ignore)
;; Miscellaneous Functions:
@@ -473,7 +455,7 @@ See `fast-lock-mode'."
(defun fast-lock-save-caches-before-kill-emacs ()
;; Do `fast-lock-save-cache's if `kill-emacs' is on `fast-lock-save-events'.
(when (memq 'kill-emacs fast-lock-save-events)
- (mapcar 'fast-lock-save-cache (buffer-list))))
+ (mapcar #'fast-lock-save-cache (buffer-list))))
(defun fast-lock-cache-directory (directory create)
"Return usable directory based on DIRECTORY.
@@ -534,7 +516,7 @@ See `fast-lock-cache-directory'."
(function (lambda (c) (or (cdr (assq c chars-alist)) (list c))))))
(concat
(file-name-as-directory (expand-file-name directory))
- (mapconcat 'char-to-string (apply 'append (mapcar mapchars bufile)) "")
+ (mapconcat #'char-to-string (apply #'append (mapcar mapchars bufile)) "")
".flc"))))
;; Font Lock Cache Processing Functions:
@@ -581,7 +563,7 @@ See `fast-lock-cache-directory'."
(defun fast-lock-cache-data (version timestamp
syntactic-keywords syntactic-properties
keywords face-properties
- &rest ignored)
+ &rest _ignored)
;; Find value of syntactic keywords in case it is a symbol.
(setq font-lock-syntactic-keywords (font-lock-eval-keywords
font-lock-syntactic-keywords))
@@ -708,86 +690,26 @@ See `fast-lock-get-face-properties'."
"Add `syntax-table' and `face' text properties to the current buffer.
Any existing `syntax-table' and `face' text properties are removed first.
See `fast-lock-get-face-properties'."
- (save-buffer-state (plist regions)
- (save-restriction
- (widen)
- (font-lock-unfontify-region (point-min) (point-max))
- ;;
- ;; Set the `syntax-table' property for each start/end region.
- (while syntactic-properties
- (setq plist (list 'syntax-table (car (car syntactic-properties)))
- regions (cdr (car syntactic-properties))
- syntactic-properties (cdr syntactic-properties))
- (while regions
- (add-text-properties (nth 0 regions) (nth 1 regions) plist)
- (setq regions (nthcdr 2 regions))))
- ;;
- ;; Set the `face' property for each start/end region.
- (while face-properties
- (setq plist (list 'face (car (car face-properties)))
- regions (cdr (car face-properties))
- face-properties (cdr face-properties))
- (while regions
- (add-text-properties (nth 0 regions) (nth 1 regions) plist)
- (setq regions (nthcdr 2 regions)))))))
+ (with-silent-modifications
+ (let ((inhibit-point-motion-hooks t))
+ (save-restriction
+ (widen)
+ (font-lock-unfontify-region (point-min) (point-max))
+ ;;
+ ;; Set the `syntax-table' property for each start/end region.
+ (pcase-dolist (`(,plist . ,regions) syntactic-properties)
+ (while regions
+ (add-text-properties (nth 0 regions) (nth 1 regions) plist)
+ (setq regions (nthcdr 2 regions))))
+ ;;
+ ;; Set the `face' property for each start/end region.
+ (pcase-dolist (`(,plist . ,regions) face-properties)
+ (while regions
+ (add-text-properties (nth 0 regions) (nth 1 regions) plist)
+ (setq regions (nthcdr 2 regions))))))))
;; Functions for XEmacs:
-(when (featurep 'xemacs)
- ;;
- ;; It would be better to use XEmacs' `map-extents' over extents with a
- ;; `font-lock' property, but `face' properties are on different extents.
- (defun fast-lock-get-face-properties ()
- "Return a list of `face' text properties in the current buffer.
-Each element of the list is of the form (VALUE START1 END1 START2 END2 ...)
-where VALUE is a `face' property value and STARTx and ENDx are positions.
-Only those `face' VALUEs in `fast-lock-save-faces' are returned."
- (save-restriction
- (widen)
- (let ((properties ()) cell)
- (map-extents
- (function (lambda (extent ignore)
- (let ((value (extent-face extent)))
- ;; We're only interested if it's one of `fast-lock-save-faces'.
- (when (and value (fast-lock-save-facep value))
- (let ((start (extent-start-position extent))
- (end (extent-end-position extent)))
- ;; Make or add to existing list of regions with the same
- ;; `face' property value.
- (if (setq cell (assoc value properties))
- (setcdr cell (cons start (cons end (cdr cell))))
- (push (list value start end) properties))))
- ;; Return nil to keep `map-extents' going.
- nil))))
- properties)))
- ;;
- ;; XEmacs does not support the `syntax-table' text property.
- (defalias 'fast-lock-get-syntactic-properties
- 'ignore)
- ;;
- ;; Make extents just like XEmacs' font-lock.el does.
- (defun fast-lock-add-properties (syntactic-properties face-properties)
- "Set `face' text properties in the current buffer.
-Any existing `face' text properties are removed first.
-See `fast-lock-get-face-properties'."
- (save-restriction
- (widen)
- (font-lock-unfontify-region (point-min) (point-max))
- ;; Set the `face' property, etc., for each start/end region.
- (while face-properties
- (let ((face (car (car face-properties)))
- (regions (cdr (car face-properties))))
- (while regions
- (font-lock-set-face (nth 0 regions) (nth 1 regions) face)
- (setq regions (nthcdr 2 regions)))
- (setq face-properties (cdr face-properties))))
- ;; XEmacs does not support the `syntax-table' text property.
- ))
- ;;
- ;; XEmacs 19.12 font-lock.el's `font-lock-fontify-buffer' runs a hook.
- (add-hook 'font-lock-after-fontify-buffer-hook
- 'fast-lock-after-fontify-buffer))
-
(unless (boundp 'font-lock-syntactic-keywords)
(defvar font-lock-syntactic-keywords nil))
@@ -795,14 +717,14 @@ See `fast-lock-get-face-properties'."
(defvar font-lock-inhibit-thing-lock nil))
(unless (fboundp 'font-lock-compile-keywords)
- (defalias 'font-lock-compile-keywords 'identity))
+ (defalias 'font-lock-compile-keywords #'identity))
(unless (fboundp 'font-lock-eval-keywords)
(defun font-lock-eval-keywords (keywords)
(if (symbolp keywords)
(font-lock-eval-keywords (if (fboundp keywords)
(funcall keywords)
- (eval keywords)))
+ (eval keywords t)))
keywords)))
(unless (fboundp 'font-lock-value-in-major-mode)
@@ -817,10 +739,10 @@ See `fast-lock-get-face-properties'."
;; Install ourselves:
-(add-hook 'after-save-hook 'fast-lock-save-cache-after-save-file)
-(add-hook 'kill-buffer-hook 'fast-lock-save-cache-before-kill-buffer)
+(add-hook 'after-save-hook #'fast-lock-save-cache-after-save-file)
+(add-hook 'kill-buffer-hook #'fast-lock-save-cache-before-kill-buffer)
(unless noninteractive
- (add-hook 'kill-emacs-hook 'fast-lock-save-caches-before-kill-emacs))
+ (add-hook 'kill-emacs-hook #'fast-lock-save-caches-before-kill-emacs))
;;;###autoload
(when (fboundp 'add-minor-mode)
diff --git a/lisp/obsolete/gs.el b/lisp/obsolete/gs.el
index 6ab3fc593802..5a82c6b05f02 100644
--- a/lisp/obsolete/gs.el
+++ b/lisp/obsolete/gs.el
@@ -1,4 +1,4 @@
-;;; gs.el --- interface to Ghostscript
+;;; gs.el --- interface to Ghostscript -*- lexical-binding: t; -*-
;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
@@ -205,7 +205,7 @@ the form \"WINDOW-ID PIXMAP-ID\". Value is non-nil if successful."
(gs-set-ghostview-window-prop frame spec img-width img-height)
(gs-set-ghostview-colors-window-prop frame pixel-colors)
(setenv "GHOSTVIEW" window-and-pixmap-id)
- (setq gs (apply 'start-process "gs" "*GS*" gs-program
+ (setq gs (apply #'start-process "gs" "*GS*" gs-program
(gs-options gs-device file)))
(set-process-query-on-exit-flag gs nil)
gs)
diff --git a/lisp/obsolete/gulp.el b/lisp/obsolete/gulp.el
index 0fbaa1cc4f88..6ec2f4f772cb 100644
--- a/lisp/obsolete/gulp.el
+++ b/lisp/obsolete/gulp.el
@@ -1,4 +1,4 @@
-;;; gulp.el --- ask for updates for Lisp packages
+;;; gulp.el --- ask for updates for Lisp packages -*- lexical-binding: t; -*-
;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
@@ -37,18 +37,15 @@
(defcustom gulp-discard "^;+ *Maintainer: *\\(FSF\\|emacs-devel@gnu\\.org\\) *$"
"The regexp matching the packages not requiring the request for updates."
:version "24.4" ; added emacs-devel
- :type 'regexp
- :group 'gulp)
+ :type 'regexp)
(defcustom gulp-tmp-buffer "*gulp*"
"The name of the temporary buffer."
- :type 'string
- :group 'gulp)
+ :type 'string)
(defcustom gulp-max-len 2000
"Distance into a Lisp source file to scan for keywords."
- :type 'integer
- :group 'gulp)
+ :type 'integer)
(defcustom gulp-request-header
(concat
@@ -57,8 +54,7 @@ I'm going to start pretesting a new version of GNU Emacs soon, so I'd
like to ask if you have any updates for the Emacs packages you work on.
You're listed as the maintainer of the following package(s):\n\n")
"The starting text of a gulp message."
- :type 'string
- :group 'gulp)
+ :type 'string)
(defcustom gulp-request-end
(concat
@@ -75,8 +71,7 @@ of information to include.
Thanks.")
"The closing text in a gulp message."
- :type 'string
- :group 'gulp)
+ :type 'string)
(declare-function mail-subject "sendmail" ())
(declare-function mail-send "sendmail" ())
diff --git a/lisp/obsolete/html2text.el b/lisp/obsolete/html2text.el
index f01561bd12c7..be0553cb3aee 100644
--- a/lisp/obsolete/html2text.el
+++ b/lisp/obsolete/html2text.el
@@ -1,4 +1,4 @@
-;;; html2text.el --- a simple html to plain text converter -*- coding: utf-8 -*-
+;;; html2text.el --- a simple html to plain text converter -*- lexical-binding: t; -*-
;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
diff --git a/lisp/obsolete/info-edit.el b/lisp/obsolete/info-edit.el
index c8a187c08eeb..c53616d80e77 100644
--- a/lisp/obsolete/info-edit.el
+++ b/lisp/obsolete/info-edit.el
@@ -36,7 +36,7 @@
(define-obsolete-variable-alias 'Info-edit-map 'Info-edit-mode-map "24.1")
(defvar Info-edit-mode-map (let ((map (make-sparse-keymap)))
(set-keymap-parent map text-mode-map)
- (define-key map "\C-c\C-c" 'Info-cease-edit)
+ (define-key map "\C-c\C-c" #'Info-cease-edit)
map)
"Local keymap used within `e' command of Info.")
diff --git a/lisp/obsolete/iswitchb.el b/lisp/obsolete/iswitchb.el
index 58cada137472..a7fd6ccb5f59 100644
--- a/lisp/obsolete/iswitchb.el
+++ b/lisp/obsolete/iswitchb.el
@@ -1,4 +1,4 @@
-;;; iswitchb.el --- switch between buffers using substrings
+;;; iswitchb.el --- switch between buffers using substrings -*- lexical-binding: t; -*-
;; Copyright (C) 1996-1997, 2000-2021 Free Software Foundation, Inc.
@@ -258,8 +258,7 @@
"Non-nil if searching of buffer names should ignore case.
If this is non-nil but the user input has any upper case letters, matching
is temporarily case sensitive."
- :type 'boolean
- :group 'iswitchb)
+ :type 'boolean)
(defcustom iswitchb-buffer-ignore
'("^ ")
@@ -267,8 +266,7 @@ is temporarily case sensitive."
For example, traditional behavior is not to list buffers whose names begin
with a space, for which the regexp is `^ '. See the source file for
example functions that filter buffer names."
- :type '(repeat (choice regexp function))
- :group 'iswitchb)
+ :type '(repeat (choice regexp function)))
(put 'iswitchb-buffer-ignore 'risky-local-variable t)
(defcustom iswitchb-max-to-show nil
@@ -277,8 +275,7 @@ If this value is N, and N is greater than the number of matching
buffers, the first N/2 and the last N/2 matching buffers are
shown. This can greatly speed up iswitchb if you have a
multitude of buffers open."
- :type '(choice (const :tag "Show all" nil) integer)
- :group 'iswitchb)
+ :type '(choice (const :tag "Show all" nil) integer))
(defcustom iswitchb-use-virtual-buffers nil
"If non-nil, refer to past buffers when none match.
@@ -289,8 +286,7 @@ enabled if this variable is configured to a non-nil value."
:set (function
(lambda (sym value)
(if value (recentf-mode 1))
- (set sym value)))
- :group 'iswitchb)
+ (set sym value))))
(defvar iswitchb-virtual-buffers nil)
@@ -299,8 +295,7 @@ enabled if this variable is configured to a non-nil value."
The most useful values are `iswitchb-completion-help', which pops up a
window with completion alternatives, or `iswitchb-next-match' or
`iswitchb-prev-match', which cycle the buffer list."
- :type 'hook
- :group 'iswitchb)
+ :type 'hook)
;; Examples for setting the value of iswitchb-buffer-ignore
;;(defun iswitchb-ignore-c-mode (name)
@@ -328,46 +323,38 @@ Possible values:
(const display)
(const otherframe)
(const maybe-frame)
- (const always-frame))
- :group 'iswitchb)
+ (const always-frame)))
(defcustom iswitchb-regexp nil
"Non-nil means that `iswitchb' will do regexp matching.
Value can be toggled within `iswitchb' using `iswitchb-toggle-regexp'."
- :type 'boolean
- :group 'iswitchb)
+ :type 'boolean)
(defcustom iswitchb-newbuffer t
"Non-nil means create new buffer if no buffer matches substring.
See also `iswitchb-prompt-newbuffer'."
- :type 'boolean
- :group 'iswitchb)
+ :type 'boolean)
(defcustom iswitchb-prompt-newbuffer t
"Non-nil means prompt user to confirm before creating new buffer.
See also `iswitchb-newbuffer'."
- :type 'boolean
- :group 'iswitchb)
+ :type 'boolean)
(defcustom iswitchb-use-faces t
"Non-nil means use font-lock faces for showing first match."
- :type 'boolean
- :group 'iswitchb)
+ :type 'boolean)
(defcustom iswitchb-use-frame-buffer-list nil
"Non-nil means use the currently selected frame's buffer list."
- :type 'boolean
- :group 'iswitchb)
+ :type 'boolean)
(defcustom iswitchb-make-buflist-hook nil
"Hook to run when list of matching buffers is created."
- :type 'hook
- :group 'iswitchb)
+ :type 'hook)
(defcustom iswitchb-delim ","
"Delimiter to put between buffer names when displaying results."
- :type 'string
- :group 'iswitchb)
+ :type 'string)
(defcustom iswitchb-all-frames 'visible
"Argument to pass to `walk-windows' when iswitchb is finding buffers.
@@ -375,8 +362,7 @@ See documentation of `walk-windows' for useful values."
:type '(choice (const :tag "Selected frame only" nil)
(const :tag "All existing frames" t)
(const :tag "All visible frames" visible)
- (const :tag "All frames on this terminal" 0))
- :group 'iswitchb)
+ (const :tag "All frames on this terminal" 0)))
(defcustom iswitchb-minibuffer-setup-hook nil
"Iswitchb-specific customization of minibuffer setup.
@@ -387,37 +373,32 @@ For instance:
\\='\(lambda () (set (make-local-variable \\='max-mini-window-height) 3)))
will constrain the minibuffer to a maximum height of 3 lines when
iswitchb is running."
- :type 'hook
- :group 'iswitchb)
+ :type 'hook)
(defface iswitchb-single-match
'((t
(:inherit font-lock-comment-face)))
"Iswitchb face for single matching buffer name."
- :version "22.1"
- :group 'iswitchb)
+ :version "22.1")
(defface iswitchb-current-match
'((t
(:inherit font-lock-function-name-face)))
"Iswitchb face for current matching buffer name."
- :version "22.1"
- :group 'iswitchb)
+ :version "22.1")
(defface iswitchb-virtual-matches
'((t
(:inherit font-lock-builtin-face)))
"Iswitchb face for matching virtual buffer names.
See also `iswitchb-use-virtual-buffers'."
- :version "22.1"
- :group 'iswitchb)
+ :version "22.1")
(defface iswitchb-invalid-regexp
'((t
(:inherit font-lock-warning-face)))
"Iswitchb face for indicating invalid regexp. "
- :version "22.1"
- :group 'iswitchb)
+ :version "22.1")
;; Do we need the variable iswitchb-use-mycompletion?
@@ -465,18 +446,18 @@ interfere with other minibuffer usage.")
(defvar iswitchb-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map minibuffer-local-map)
- (define-key map "?" 'iswitchb-completion-help)
- (define-key map "\C-s" 'iswitchb-next-match)
- (define-key map "\C-r" 'iswitchb-prev-match)
- (define-key map [?\C-.] 'iswitchb-next-match)
- (define-key map [?\C-,] 'iswitchb-prev-match)
- (define-key map "\t" 'iswitchb-complete)
- (define-key map "\C-j" 'iswitchb-select-buffer-text)
- (define-key map "\C-t" 'iswitchb-toggle-regexp)
- (define-key map "\C-x\C-f" 'iswitchb-find-file)
- (define-key map "\C-c" 'iswitchb-toggle-case)
- (define-key map "\C-k" 'iswitchb-kill-buffer)
- (define-key map "\C-m" 'iswitchb-exit-minibuffer)
+ (define-key map "?" #'iswitchb-completion-help)
+ (define-key map "\C-s" #'iswitchb-next-match)
+ (define-key map "\C-r" #'iswitchb-prev-match)
+ (define-key map [?\C-.] #'iswitchb-next-match)
+ (define-key map [?\C-,] #'iswitchb-prev-match)
+ (define-key map "\t" #'iswitchb-complete)
+ (define-key map "\C-j" #'iswitchb-select-buffer-text)
+ (define-key map "\C-t" #'iswitchb-toggle-regexp)
+ (define-key map "\C-x\C-f" #'iswitchb-find-file)
+ (define-key map "\C-c" #'iswitchb-toggle-case)
+ (define-key map "\C-k" #'iswitchb-kill-buffer)
+ (define-key map "\C-m" #'iswitchb-exit-minibuffer)
map)
"Minibuffer keymap for `iswitchb-buffer'.")
@@ -596,17 +577,17 @@ the selection process begins. Used by isearchb.el."
(let ((map (copy-keymap minibuffer-local-map))
buf-sel iswitchb-final-text
icomplete-mode) ; prevent icomplete starting up
- (define-key map "?" 'iswitchb-completion-help)
- (define-key map "\C-s" 'iswitchb-next-match)
- (define-key map "\C-r" 'iswitchb-prev-match)
- (define-key map "\t" 'iswitchb-complete)
- (define-key map "\C-j" 'iswitchb-select-buffer-text)
- (define-key map "\C-t" 'iswitchb-toggle-regexp)
- (define-key map "\C-x\C-f" 'iswitchb-find-file)
- (define-key map "\C-n" 'iswitchb-toggle-ignore)
- (define-key map "\C-c" 'iswitchb-toggle-case)
- (define-key map "\C-k" 'iswitchb-kill-buffer)
- (define-key map "\C-m" 'iswitchb-exit-minibuffer)
+ (define-key map "?" #'iswitchb-completion-help)
+ (define-key map "\C-s" #'iswitchb-next-match)
+ (define-key map "\C-r" #'iswitchb-prev-match)
+ (define-key map "\t" #'iswitchb-complete)
+ (define-key map "\C-j" #'iswitchb-select-buffer-text)
+ (define-key map "\C-t" #'iswitchb-toggle-regexp)
+ (define-key map "\C-x\C-f" #'iswitchb-find-file)
+ (define-key map "\C-n" #'iswitchb-toggle-ignore)
+ (define-key map "\C-c" #'iswitchb-toggle-case)
+ (define-key map "\C-k" #'iswitchb-kill-buffer)
+ (define-key map "\C-m" #'iswitchb-exit-minibuffer)
(setq iswitchb-mode-map map)
(run-hooks 'iswitchb-define-mode-map-hook)
@@ -946,9 +927,9 @@ If `iswitchb-change-word-sub' cannot be found in WORD, return nil."
(if iswitchb-regexp
subs
(regexp-quote subs)))
- (setq res (mapcar 'iswitchb-word-matching-substring lis))
+ (setq res (mapcar #'iswitchb-word-matching-substring lis))
(setq res (delq nil res)) ;; remove any nil elements (shouldn't happen)
- (setq alist (mapcar 'iswitchb-makealist res)) ;; could use an OBARRAY
+ (setq alist (mapcar #'iswitchb-makealist res)) ;; could use an OBARRAY
;; try-completion returns t if there is an exact match.
(let ((completion-ignore-case (iswitchb-case)))
@@ -1148,43 +1129,6 @@ For details of keybindings, do `\\[describe-function] iswitchb'."
(setq iswitchb-method 'otherframe)
(iswitchb))
-;;; XEmacs hack for showing default buffer
-
-;; The first time we enter the minibuffer, Emacs puts up the default
-;; buffer to switch to, but XEmacs doesn't -- presumably there is a
-;; subtle difference in the two versions of post-command-hook. The
-;; default is shown for both whenever we delete all of our text
-;; though, indicating its just a problem the first time we enter the
-;; function. To solve this, we use another entry hook for emacs to
-;; show the default the first time we enter the minibuffer.
-
-(defun iswitchb-init-XEmacs-trick ()
- "Display default buffer when first entering minibuffer.
-This is a hack for XEmacs, and should really be handled by `iswitchb-exhibit'."
- (if (iswitchb-entryfn-p)
- (progn
- (iswitchb-exhibit)
- (goto-char (point-min)))))
-
-;; add this hook for XEmacs only.
-(if (featurep 'xemacs)
- (add-hook 'iswitchb-minibuffer-setup-hook
- 'iswitchb-init-XEmacs-trick))
-
-;;; XEmacs / backspace key
-;; For some reason, if the backspace key is pressed in XEmacs, the
-;; line gets confused, so I've added a simple key definition to make
-;; backspace act like the normal delete key.
-
-(defun iswitchb-xemacs-backspacekey ()
- "Bind backspace to `backward-delete-char'."
- (define-key iswitchb-mode-map '[backspace] 'backward-delete-char)
- (define-key iswitchb-mode-map '[(meta backspace)] 'backward-kill-word))
-
-(if (featurep 'xemacs)
- (add-hook 'iswitchb-define-mode-map-hook
- 'iswitchb-xemacs-backspacekey))
-
;;; ICOMPLETE TYPE CODE
(defun iswitchb-exhibit ()
@@ -1273,7 +1217,7 @@ Modified from `icomplete-completions'."
iswitchb-virtual-buffers)))
(setq head (cdr head)))
(setq iswitchb-virtual-buffers (nreverse iswitchb-virtual-buffers)
- comps (mapcar 'car iswitchb-virtual-buffers))
+ comps (mapcar #'car iswitchb-virtual-buffers))
(let ((comp comps))
(while comp
(put-text-property 0 (length (car comp))
@@ -1323,8 +1267,9 @@ Modified from `icomplete-completions'."
(most-len (length most))
most-is-exact
(alternatives
- (mapconcat (if most 'iswitchb-output-completion
- 'identity) comps iswitchb-delim)))
+ (mapconcat (if most #'iswitchb-output-completion
+ #'identity)
+ comps iswitchb-delim)))
(concat
@@ -1356,8 +1301,8 @@ Modified from `icomplete-completions'."
Copied from `icomplete-minibuffer-setup-hook'."
(when (iswitchb-entryfn-p)
(set (make-local-variable 'iswitchb-use-mycompletion) t)
- (add-hook 'pre-command-hook 'iswitchb-pre-command nil t)
- (add-hook 'post-command-hook 'iswitchb-post-command nil t)
+ (add-hook 'pre-command-hook #'iswitchb-pre-command nil t)
+ (add-hook 'post-command-hook #'iswitchb-post-command nil t)
(run-hooks 'iswitchb-minibuffer-setup-hook)))
(defun iswitchb-pre-command ()
@@ -1416,10 +1361,10 @@ See the variable `iswitchb-case' for details."
Iswitchb mode is a global minor mode that enables switching
between buffers using substrings. See `iswitchb' for details."
- nil nil iswitchb-global-map :global t :group 'iswitchb
+ nil nil iswitchb-global-map :global t
(if iswitchb-mode
- (add-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)
- (remove-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)))
+ (add-hook 'minibuffer-setup-hook #'iswitchb-minibuffer-setup)
+ (remove-hook 'minibuffer-setup-hook #'iswitchb-minibuffer-setup)))
(provide 'iswitchb)
diff --git a/lisp/obsolete/landmark.el b/lisp/obsolete/landmark.el
index ae15109beaa2..cc4fd19c389e 100644
--- a/lisp/obsolete/landmark.el
+++ b/lisp/obsolete/landmark.el
@@ -163,51 +163,50 @@
(defcustom landmark-mode-hook nil
"If non-nil, its value is called on entry to Landmark mode."
- :type 'hook
- :group 'landmark)
+ :type 'hook)
(defvar landmark-mode-map
(let ((map (make-sparse-keymap)))
;; Key bindings for cursor motion.
- (define-key map "y" 'landmark-move-nw) ; y
- (define-key map "u" 'landmark-move-ne) ; u
- (define-key map "b" 'landmark-move-sw) ; b
- (define-key map "n" 'landmark-move-se) ; n
- (define-key map "h" 'backward-char) ; h
- (define-key map "l" 'forward-char) ; l
- (define-key map "j" 'landmark-move-down) ; j
- (define-key map "k" 'landmark-move-up) ; k
-
- (define-key map [kp-7] 'landmark-move-nw)
- (define-key map [kp-9] 'landmark-move-ne)
- (define-key map [kp-1] 'landmark-move-sw)
- (define-key map [kp-3] 'landmark-move-se)
- (define-key map [kp-4] 'backward-char)
- (define-key map [kp-6] 'forward-char)
- (define-key map [kp-2] 'landmark-move-down)
- (define-key map [kp-8] 'landmark-move-up)
-
- (define-key map "\C-n" 'landmark-move-down) ; C-n
- (define-key map "\C-p" 'landmark-move-up) ; C-p
+ (define-key map "y" #'landmark-move-nw) ; y
+ (define-key map "u" #'landmark-move-ne) ; u
+ (define-key map "b" #'landmark-move-sw) ; b
+ (define-key map "n" #'landmark-move-se) ; n
+ (define-key map "h" #'backward-char) ; h
+ (define-key map "l" #'forward-char) ; l
+ (define-key map "j" #'landmark-move-down) ; j
+ (define-key map "k" #'landmark-move-up) ; k
+
+ (define-key map [kp-7] #'landmark-move-nw)
+ (define-key map [kp-9] #'landmark-move-ne)
+ (define-key map [kp-1] #'landmark-move-sw)
+ (define-key map [kp-3] #'landmark-move-se)
+ (define-key map [kp-4] #'backward-char)
+ (define-key map [kp-6] #'forward-char)
+ (define-key map [kp-2] #'landmark-move-down)
+ (define-key map [kp-8] #'landmark-move-up)
+
+ (define-key map "\C-n" #'landmark-move-down) ; C-n
+ (define-key map "\C-p" #'landmark-move-up) ; C-p
;; Key bindings for entering Human moves.
- (define-key map "X" 'landmark-human-plays) ; X
- (define-key map "x" 'landmark-human-plays) ; x
-
- (define-key map " " 'landmark-start-robot) ; SPC
- (define-key map [down-mouse-1] 'landmark-start-robot)
- (define-key map [drag-mouse-1] 'landmark-click)
- (define-key map [mouse-1] 'landmark-click)
- (define-key map [down-mouse-2] 'landmark-click)
- (define-key map [mouse-2] 'landmark-mouse-play)
- (define-key map [drag-mouse-2] 'landmark-mouse-play)
-
- (define-key map [remap previous-line] 'landmark-move-up)
- (define-key map [remap next-line] 'landmark-move-down)
- (define-key map [remap beginning-of-line] 'landmark-beginning-of-line)
- (define-key map [remap end-of-line] 'landmark-end-of-line)
- (define-key map [remap undo] 'landmark-human-takes-back)
- (define-key map [remap advertised-undo] 'landmark-human-takes-back)
+ (define-key map "X" #'landmark-human-plays) ; X
+ (define-key map "x" #'landmark-human-plays) ; x
+
+ (define-key map " " #'landmark-start-robot) ; SPC
+ (define-key map [down-mouse-1] #'landmark-start-robot)
+ (define-key map [drag-mouse-1] #'landmark-click)
+ (define-key map [mouse-1] #'landmark-click)
+ (define-key map [down-mouse-2] #'landmark-click)
+ (define-key map [mouse-2] #'landmark-mouse-play)
+ (define-key map [drag-mouse-2] #'landmark-mouse-play)
+
+ (define-key map [remap previous-line] #'landmark-move-up)
+ (define-key map [remap next-line] #'landmark-move-down)
+ (define-key map [remap beginning-of-line] #'landmark-beginning-of-line)
+ (define-key map [remap end-of-line] #'landmark-end-of-line)
+ (define-key map [remap undo] #'landmark-human-takes-back)
+ (define-key map [remap advertised-undo] #'landmark-human-takes-back)
map)
"Local keymap to use in Landmark mode.")
@@ -219,14 +218,12 @@
(defface landmark-font-lock-face-O '((((class color)) :foreground "red")
(t :weight bold))
"Face to use for Emacs's O."
- :version "22.1"
- :group 'landmark)
+ :version "22.1")
(defface landmark-font-lock-face-X '((((class color)) :foreground "green")
(t :weight bold))
"Face to use for your X."
- :version "22.1"
- :group 'landmark)
+ :version "22.1")
(defvar landmark-font-lock-keywords
'(("O" . 'landmark-font-lock-face-O)
@@ -1132,12 +1129,10 @@ this program to add a random element to the way moves were made.")
"If non-nil, print \"One moment please\" when a new board is generated.
The drawback of this is you don't see how many moves the last run took
because it is overwritten by \"One moment please\"."
- :type 'boolean
- :group 'landmark)
+ :type 'boolean)
(defcustom landmark-output-moves t
"If non-nil, output number of moves so far on a move-by-move basis."
- :type 'boolean
- :group 'landmark)
+ :type 'boolean)
(defun landmark-weights-debug ()
@@ -1153,7 +1148,7 @@ because it is overwritten by \"One moment please\"."
(defun landmark-print-distance ()
(insert (format "tree: %S \n" (landmark-calc-distance-of-robot-from 'landmark-tree)))
- (mapc 'landmark-print-distance-int landmark-directions))
+ (mapc #'landmark-print-distance-int landmark-directions))
;;(setq direction 'landmark-n)
@@ -1166,10 +1161,10 @@ because it is overwritten by \"One moment please\"."
(defun landmark-nslify-wts ()
(interactive)
- (let ((l (apply 'append (mapcar 'landmark-nslify-wts-int landmark-directions))))
+ (let ((l (apply #'append (mapcar #'landmark-nslify-wts-int landmark-directions))))
(insert (format "set data_value WTS \n %s \n" l))
(insert (format "/* max: %S min: %S */"
- (eval (cons 'max l)) (eval (cons 'min l))))))
+ (apply #'max l) (apply #'min l)))))
(defun landmark-print-wts-int (direction)
(mapc (lambda (target-direction)
@@ -1184,7 +1179,7 @@ because it is overwritten by \"One moment please\"."
(interactive)
(with-current-buffer "*landmark-wts*"
(insert "==============================\n")
- (mapc 'landmark-print-wts-int landmark-directions)))
+ (mapc #'landmark-print-wts-int landmark-directions)))
(defun landmark-print-moves (moves)
(interactive)
@@ -1204,7 +1199,7 @@ because it is overwritten by \"One moment please\"."
(interactive)
(with-current-buffer "*landmark-y,s,noise*"
(insert "==============================\n")
- (mapc 'landmark-print-y-s-noise-int landmark-directions)))
+ (mapc #'landmark-print-y-s-noise-int landmark-directions)))
(defun landmark-print-smell-int (direction)
(insert (format "%S: smell: %S \n"
@@ -1216,7 +1211,7 @@ because it is overwritten by \"One moment please\"."
(with-current-buffer "*landmark-smell*"
(insert "==============================\n")
(insert (format "tree: %S \n" (get 'z 't)))
- (mapc 'landmark-print-smell-int landmark-directions)))
+ (mapc #'landmark-print-smell-int landmark-directions)))
(defun landmark-print-w0-int (direction)
(insert (format "%S: w0: %S \n"
@@ -1227,7 +1222,7 @@ because it is overwritten by \"One moment please\"."
(interactive)
(with-current-buffer "*landmark-w0*"
(insert "==============================\n")
- (mapc 'landmark-print-w0-int landmark-directions)))
+ (mapc #'landmark-print-w0-int landmark-directions)))
(defun landmark-blackbox ()
(with-current-buffer "*landmark-blackbox*"
@@ -1252,36 +1247,31 @@ because it is overwritten by \"One moment please\"."
(defun landmark-print-wts-blackbox ()
(interactive)
- (mapc 'landmark-print-wts-int landmark-directions))
+ (mapc #'landmark-print-wts-int landmark-directions))
;;;_ - learning parameters
(defcustom landmark-bound 0.005
"The maximum that w0j may be."
- :type 'number
- :group 'landmark)
+ :type 'number)
(defcustom landmark-c 1.0
"A factor applied to modulate the increase in wij.
Used in the function landmark-update-normal-weights."
- :type 'number
- :group 'landmark)
+ :type 'number)
(defcustom landmark-c-naught 0.5
"A factor applied to modulate the increase in w0j.
Used in the function landmark-update-naught-weights."
- :type 'number
- :group 'landmark)
+ :type 'number)
(defvar landmark-initial-w0 0.0)
(defvar landmark-initial-wij 0.0)
(defcustom landmark-no-payoff 0
"The amount of simulation cycles that have occurred with no movement.
Used to move the robot when he is stuck in a rut for some reason."
- :type 'integer
- :group 'landmark)
+ :type 'integer)
(defcustom landmark-max-stall-time 2
"The maximum number of cycles that the robot can remain stuck in a place.
After this limit is reached, landmark-random-move is called to
push him out of it."
- :type 'integer
- :group 'landmark)
+ :type 'integer)
;;;_ + Randomizing functions
@@ -1346,7 +1336,8 @@ push him out of it."
(put 'landmark-e 'y (/ landmark-board-height 2))
(put 'landmark-e 'sym 4)
- (mapc 'landmark-plot-internal '(landmark-n landmark-s landmark-e landmark-w landmark-tree)))
+ (mapc #'landmark-plot-internal
+ '(landmark-n landmark-s landmark-e landmark-w landmark-tree)))
@@ -1434,7 +1425,7 @@ push him out of it."
;;;_ + Functions to move robot
(defun landmark-confidence-for (target-direction)
- (apply '+
+ (apply #'+
(get target-direction 'w0)
(mapcar (lambda (direction)
(*
@@ -1494,13 +1485,13 @@ push him out of it."
(landmark-random-move)
(progn
(landmark-calc-confidences)
- (mapc 'landmark-y landmark-directions)
+ (mapc #'landmark-y landmark-directions)
(landmark-move)))
(landmark-calc-payoff)
- (mapc 'landmark-update-normal-weights landmark-directions)
- (mapc 'landmark-update-naught-weights landmark-directions)
+ (mapc #'landmark-update-normal-weights landmark-directions)
+ (mapc #'landmark-update-naught-weights landmark-directions)
(if landmark-debug
(landmark-weights-debug)))
(landmark-terminate-game nil))
@@ -1536,8 +1527,8 @@ If the game is finished, this command requests for another game."
(landmark-calc-payoff)
- (mapc 'landmark-update-normal-weights landmark-directions)
- (mapc 'landmark-update-naught-weights landmark-directions)
+ (mapc #'landmark-update-normal-weights landmark-directions)
+ (mapc #'landmark-update-naught-weights landmark-directions)
(landmark-amble-robot)
)))))))
@@ -1576,7 +1567,7 @@ If the game is finished, this command requests for another game."
(if (not save-weights)
(progn
- (mapc 'landmark-fix-weights-for landmark-directions)
+ (mapc #'landmark-fix-weights-for landmark-directions)
(dolist (direction landmark-directions)
(put direction 'w0 landmark-initial-w0)))
(message "Weights preserved for this run."))
@@ -1618,7 +1609,7 @@ If the game is finished, this command requests for another game."
;;;_ + landmark-test-run ()
;;;###autoload
-(defalias 'landmark-repeat 'landmark-test-run)
+(defalias 'landmark-repeat #'landmark-test-run)
;;;###autoload
(defun landmark-test-run ()
"Run 100 Landmark games, each time saving the weights from the previous game."
@@ -1670,13 +1661,13 @@ Use \\[describe-mode] for more info."
(if landmark-one-moment-please
(message "One moment, please..."))
(landmark-start-game landmark-n landmark-m)
- (eval (cons 'landmark-init
- (cond
- ((= parg 1) '(t nil))
- ((= parg 2) '(t t))
- ((= parg 3) '(nil t))
- ((= parg 4) '(nil nil))
- (t '(nil t))))))))
+ (apply #'landmark-init
+ (cond
+ ((= parg 1) '(t nil))
+ ((= parg 2) '(t t))
+ ((= parg 3) '(nil t))
+ ((= parg 4) '(nil nil))
+ (t '(nil t)))))))
;;;_ + Local variables
diff --git a/lisp/obsolete/lazy-lock.el b/lisp/obsolete/lazy-lock.el
index e1a01913bead..34bf85f864c0 100644
--- a/lisp/obsolete/lazy-lock.el
+++ b/lisp/obsolete/lazy-lock.el
@@ -1,4 +1,4 @@
-;;; lazy-lock.el --- lazy demand-driven fontification for fast Font Lock mode
+;;; lazy-lock.el --- lazy demand-driven fontification for fast Font Lock mode -*- lexical-binding: t; -*-
;; Copyright (C) 1994-1998, 2001-2021 Free Software Foundation, Inc.
@@ -270,30 +270,14 @@
(eval-when-compile (require 'cl-lib))
(eval-when-compile
- ;; We use this to preserve or protect things when modifying text properties.
- (defmacro save-buffer-state (varlist &rest body)
- "Bind variables according to VARLIST and eval BODY restoring buffer state."
- `(let* (,@(append varlist
- '((modified (buffer-modified-p))
- (buffer-undo-list t)
- (inhibit-read-only t)
- (inhibit-point-motion-hooks t)
- (inhibit-modification-hooks t)
- deactivate-mark
- buffer-file-name
- buffer-file-truename)))
- ,@body
- (when (and (not modified) (buffer-modified-p))
- (restore-buffer-modified-p nil))))
- (put 'save-buffer-state 'lisp-indent-function 1)
;;
;; We use this for clarity and speed. Naughty but nice.
(defmacro do-while (test &rest body)
"(do-while TEST BODY...): eval BODY... and repeat if TEST yields non-nil.
The order of execution is thus BODY, TEST, BODY, TEST and so on
until TEST returns nil."
- `(while (progn ,@body ,test)))
- (put 'do-while 'lisp-indent-function (get 'while 'lisp-indent-function)))
+ (declare (indent 1) (debug t))
+ `(while (progn ,@body ,test))))
(defgroup lazy-lock nil
"Font Lock support mode to fontify lazily."
@@ -326,8 +310,7 @@ The value of this variable is used when Lazy Lock mode is turned on."
(symbol :tag "name"))
(radio :tag "Size"
(const :tag "none" nil)
- (integer :tag "size")))))
- :group 'lazy-lock)
+ (integer :tag "size"))))))
(defcustom lazy-lock-defer-on-the-fly t
"If non-nil, means fontification after a change should be deferred.
@@ -346,8 +329,7 @@ The value of this variable is used when Lazy Lock mode is turned on."
(set :menu-tag "mode specific" :tag "modes"
:value (not)
(const :tag "Except" not)
- (repeat :inline t (symbol :tag "mode"))))
- :group 'lazy-lock)
+ (repeat :inline t (symbol :tag "mode")))))
(defcustom lazy-lock-defer-on-scrolling nil
"If non-nil, means fontification after a scroll should be deferred.
@@ -371,8 +353,7 @@ makes little sense if `lazy-lock-defer-contextually' is non-nil.)
The value of this variable is used when Lazy Lock mode is turned on."
:type '(choice (const :tag "never" nil)
(const :tag "always" t)
- (other :tag "eventually" eventually))
- :group 'lazy-lock)
+ (other :tag "eventually" eventually)))
(defcustom lazy-lock-defer-contextually 'syntax-driven
"If non-nil, means deferred fontification should be syntactically true.
@@ -389,8 +370,7 @@ buffer mode's syntax table, i.e., only if `font-lock-keywords-only' is nil.
The value of this variable is used when Lazy Lock mode is turned on."
:type '(choice (const :tag "never" nil)
(const :tag "always" t)
- (other :tag "syntax-driven" syntax-driven))
- :group 'lazy-lock)
+ (other :tag "syntax-driven" syntax-driven)))
(defcustom lazy-lock-defer-time 0.25
"Time in seconds to delay before beginning deferred fontification.
@@ -401,8 +381,7 @@ variables `lazy-lock-defer-on-the-fly', `lazy-lock-defer-on-scrolling' and
The value of this variable is used when Lazy Lock mode is turned on."
:type '(choice (const :tag "never" nil)
- (number :tag "seconds"))
- :group 'lazy-lock)
+ (number :tag "seconds")))
(defcustom lazy-lock-stealth-time 30
"Time in seconds to delay before beginning stealth fontification.
@@ -411,16 +390,14 @@ If nil, means stealth fontification is never performed.
The value of this variable is used when Lazy Lock mode is turned on."
:type '(choice (const :tag "never" nil)
- (number :tag "seconds"))
- :group 'lazy-lock)
+ (number :tag "seconds")))
(defcustom lazy-lock-stealth-lines (if font-lock-maximum-decoration 100 250)
"Maximum size of a chunk of stealth fontification.
Each iteration of stealth fontification can fontify this number of lines.
To speed up input response during stealth fontification, at the cost of stealth
taking longer to fontify, you could reduce the value of this variable."
- :type '(integer :tag "lines")
- :group 'lazy-lock)
+ :type '(integer :tag "lines"))
(defcustom lazy-lock-stealth-load
(if (condition-case nil (load-average) (error)) 200)
@@ -435,8 +412,7 @@ See also `lazy-lock-stealth-nice'."
:type (if (condition-case nil (load-average) (error))
'(choice (const :tag "never" nil)
(integer :tag "load"))
- '(const :format "%t: unsupported\n" nil))
- :group 'lazy-lock)
+ '(const :format "%t: unsupported\n" nil)))
(defcustom lazy-lock-stealth-nice 0.125
"Time in seconds to pause between chunks of stealth fontification.
@@ -447,14 +423,12 @@ To reduce machine load during stealth fontification, at the cost of stealth
taking longer to fontify, you could increase the value of this variable.
See also `lazy-lock-stealth-load'."
:type '(choice (const :tag "never" nil)
- (number :tag "seconds"))
- :group 'lazy-lock)
+ (number :tag "seconds")))
(defcustom lazy-lock-stealth-verbose
(and (not lazy-lock-defer-contextually) (not (null font-lock-verbose)))
"If non-nil, means stealth fontification should show status messages."
- :type 'boolean
- :group 'lazy-lock)
+ :type 'boolean)
;; User Functions:
@@ -580,30 +554,30 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'."
;; Add hook if lazy-lock.el is fontifying on scrolling or is deferring.
(when (or fontifying defer-change defer-scroll defer-context)
(add-hook 'window-scroll-functions (if defer-scroll
- 'lazy-lock-defer-after-scroll
- 'lazy-lock-fontify-after-scroll)
+ #'lazy-lock-defer-after-scroll
+ #'lazy-lock-fontify-after-scroll)
nil t))
;;
;; Add hook if lazy-lock.el is fontifying and is not deferring changes.
(when (and fontifying (not defer-change) (not defer-context))
- (add-hook 'before-change-functions 'lazy-lock-arrange-before-change nil t))
+ (add-hook 'before-change-functions #'lazy-lock-arrange-before-change nil t))
;;
;; Replace Font Lock mode hook.
- (remove-hook 'after-change-functions 'font-lock-after-change-function t)
+ (remove-hook 'after-change-functions #'font-lock-after-change-function t)
(add-hook 'after-change-functions
(cond ((and defer-change defer-context)
- 'lazy-lock-defer-rest-after-change)
+ #'lazy-lock-defer-rest-after-change)
(defer-change
- 'lazy-lock-defer-line-after-change)
+ #'lazy-lock-defer-line-after-change)
(defer-context
- 'lazy-lock-fontify-rest-after-change)
+ #'lazy-lock-fontify-rest-after-change)
(t
- 'lazy-lock-fontify-line-after-change))
+ #'lazy-lock-fontify-line-after-change))
nil t)
;;
;; Add package-specific hook.
- (add-hook 'outline-view-change-hook 'lazy-lock-fontify-after-visage nil t)
- (add-hook 'hs-hide-hook 'lazy-lock-fontify-after-visage nil t))
+ (add-hook 'outline-view-change-hook #'lazy-lock-fontify-after-visage nil t)
+ (add-hook 'hs-hide-hook #'lazy-lock-fontify-after-visage nil t))
(defun lazy-lock-install-timers (dtime stime)
;; Schedule or re-schedule the deferral and stealth timers.
@@ -616,13 +590,13 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'."
(when (cdr defer)
(cancel-timer (cdr defer)))
(setcar lazy-lock-timers (cons dtime (and dtime
- (run-with-idle-timer dtime t 'lazy-lock-fontify-after-defer))))))
+ (run-with-idle-timer dtime t #'lazy-lock-fontify-after-defer))))))
(unless (eq stime (car (cdr lazy-lock-timers)))
(let ((stealth (cdr lazy-lock-timers)))
(when (cdr stealth)
(cancel-timer (cdr stealth)))
(setcdr lazy-lock-timers (cons stime (and stime
- (run-with-idle-timer stime t 'lazy-lock-fontify-after-idle)))))))
+ (run-with-idle-timer stime t #'lazy-lock-fontify-after-idle)))))))
(defun lazy-lock-unstall ()
;;
@@ -640,21 +614,21 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'."
(save-restriction
(widen)
(lazy-lock-fontify-region (point-min) (point-max))))))
- (add-hook 'after-change-functions 'font-lock-after-change-function nil t))
+ (add-hook 'after-change-functions #'font-lock-after-change-function nil t))
;;
;; Remove the text properties.
(lazy-lock-after-unfontify-buffer)
;;
;; Remove the fontification hooks.
- (remove-hook 'window-scroll-functions 'lazy-lock-fontify-after-scroll t)
- (remove-hook 'window-scroll-functions 'lazy-lock-defer-after-scroll t)
- (remove-hook 'before-change-functions 'lazy-lock-arrange-before-change t)
- (remove-hook 'after-change-functions 'lazy-lock-fontify-line-after-change t)
- (remove-hook 'after-change-functions 'lazy-lock-fontify-rest-after-change t)
- (remove-hook 'after-change-functions 'lazy-lock-defer-line-after-change t)
- (remove-hook 'after-change-functions 'lazy-lock-defer-rest-after-change t)
- (remove-hook 'outline-view-change-hook 'lazy-lock-fontify-after-visage t)
- (remove-hook 'hs-hide-hook 'lazy-lock-fontify-after-visage t))
+ (remove-hook 'window-scroll-functions #'lazy-lock-fontify-after-scroll t)
+ (remove-hook 'window-scroll-functions #'lazy-lock-defer-after-scroll t)
+ (remove-hook 'before-change-functions #'lazy-lock-arrange-before-change t)
+ (remove-hook 'after-change-functions #'lazy-lock-fontify-line-after-change t)
+ (remove-hook 'after-change-functions #'lazy-lock-fontify-rest-after-change t)
+ (remove-hook 'after-change-functions #'lazy-lock-defer-line-after-change t)
+ (remove-hook 'after-change-functions #'lazy-lock-defer-rest-after-change t)
+ (remove-hook 'outline-view-change-hook #'lazy-lock-fontify-after-visage t)
+ (remove-hook 'hs-hide-hook #'lazy-lock-fontify-after-visage t))
;; Hook functions.
@@ -682,7 +656,7 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'."
;; result in an unnecessary trigger after this if we did not cancel it now.
(set-window-redisplay-end-trigger window nil))
-(defun lazy-lock-defer-after-scroll (window window-start)
+(defun lazy-lock-defer-after-scroll (window _window-start)
;; Called from `window-scroll-functions'.
;; Defer fontification following the scroll. Save the current buffer so that
;; we subsequently fontify in all windows showing the buffer.
@@ -750,7 +724,7 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'."
(defalias 'lazy-lock-fontify-line-after-change
;; Called from `after-change-functions'.
;; Fontify the current change.
- 'font-lock-after-change-function)
+ #'font-lock-after-change-function)
(defun lazy-lock-fontify-rest-after-change (beg end old-len)
;; Called from `after-change-functions'.
@@ -758,29 +732,29 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'."
;; buffer. Save the current buffer so that we subsequently fontify in all
;; windows showing the buffer.
(lazy-lock-fontify-line-after-change beg end old-len)
- (save-buffer-state nil
+ (with-silent-modifications
(unless (memq (current-buffer) lazy-lock-buffers)
(push (current-buffer) lazy-lock-buffers))
(save-restriction
(widen)
(remove-text-properties end (point-max) '(lazy-lock nil)))))
-(defun lazy-lock-defer-line-after-change (beg end old-len)
+(defun lazy-lock-defer-line-after-change (beg end _old-len)
;; Called from `after-change-functions'.
;; Defer fontification of the current change. Save the current buffer so
;; that we subsequently fontify in all windows showing the buffer.
- (save-buffer-state nil
+ (with-silent-modifications
(unless (memq (current-buffer) lazy-lock-buffers)
(push (current-buffer) lazy-lock-buffers))
(remove-text-properties (max (1- beg) (point-min))
(min (1+ end) (point-max))
'(lazy-lock nil))))
-(defun lazy-lock-defer-rest-after-change (beg end old-len)
+(defun lazy-lock-defer-rest-after-change (beg _end _old-len)
;; Called from `after-change-functions'.
;; Defer fontification of the rest of the buffer. Save the current buffer so
;; that we subsequently fontify in all windows showing the buffer.
- (save-buffer-state nil
+ (with-silent-modifications
(unless (memq (current-buffer) lazy-lock-buffers)
(push (current-buffer) lazy-lock-buffers))
(save-restriction
@@ -809,10 +783,10 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'."
(setq lazy-lock-buffers (cdr lazy-lock-buffers)))))
;; Add hook if fontification should now be defer-driven in this buffer.
(when (and lazy-lock-mode lazy-lock-defer-on-scrolling
- (memq 'lazy-lock-fontify-after-scroll window-scroll-functions)
+ (memq #'lazy-lock-fontify-after-scroll window-scroll-functions)
(not (or (input-pending-p) (lazy-lock-unfontified-p))))
- (remove-hook 'window-scroll-functions 'lazy-lock-fontify-after-scroll t)
- (add-hook 'window-scroll-functions 'lazy-lock-defer-after-scroll nil t)))
+ (remove-hook 'window-scroll-functions #'lazy-lock-fontify-after-scroll t)
+ (add-hook 'window-scroll-functions #'lazy-lock-defer-after-scroll nil t)))
(defun lazy-lock-fontify-after-idle ()
;; Called from `timer-idle-list'.
@@ -868,14 +842,14 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'."
;; Called from `font-lock-after-fontify-buffer'.
;; Mark the current buffer as fontified.
;; This is a conspiracy hack between lazy-lock.el and font-lock.el.
- (save-buffer-state nil
+ (with-silent-modifications
(add-text-properties (point-min) (point-max) '(lazy-lock t))))
(defun lazy-lock-after-unfontify-buffer ()
;; Called from `font-lock-after-unfontify-buffer'.
;; Mark the current buffer as unfontified.
;; This is a conspiracy hack between lazy-lock.el and font-lock.el.
- (save-buffer-state nil
+ (with-silent-modifications
(remove-text-properties (point-min) (point-max) '(lazy-lock nil))))
;; Fontification functions.
@@ -888,27 +862,27 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'."
(widen)
(when (setq beg (text-property-any beg end 'lazy-lock nil))
(save-excursion
- (save-match-data
- (save-buffer-state
- (next)
- ;; Find successive unfontified regions between BEG and END.
- (condition-case data
- (do-while beg
- (setq next (or (text-property-any beg end 'lazy-lock t) end))
- ;; Make sure the region end points are at beginning of line.
- (goto-char beg)
- (unless (bolp)
- (beginning-of-line)
- (setq beg (point)))
- (goto-char next)
- (unless (bolp)
- (forward-line)
- (setq next (point)))
- ;; Fontify the region, then flag it as fontified.
- (font-lock-fontify-region beg next)
- (add-text-properties beg next '(lazy-lock t))
- (setq beg (text-property-any next end 'lazy-lock nil)))
- ((error quit) (message "Fontifying region...%s" data)))))))))
+ (with-silent-modifications
+ (let ((inhibit-point-motion-hooks t))
+ ;; Find successive unfontified regions between BEG and END.
+ (condition-case data
+ (do-while beg
+ (let ((next (or (text-property-any beg end 'lazy-lock t)
+ end)))
+ ;; Make sure the region end points are at beginning of line.
+ (goto-char beg)
+ (unless (bolp)
+ (beginning-of-line)
+ (setq beg (point)))
+ (goto-char next)
+ (unless (bolp)
+ (forward-line)
+ (setq next (point)))
+ ;; Fontify the region, then flag it as fontified.
+ (font-lock-fontify-region beg next)
+ (add-text-properties beg next '(lazy-lock t))
+ (setq beg (text-property-any next end 'lazy-lock nil))))
+ ((error quit) (message "Fontifying region...%s" data)))))))))
(defun lazy-lock-fontify-chunk ()
;; Fontify the nearest chunk, for stealth, in the current buffer.
@@ -1036,8 +1010,8 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'."
;; Install ourselves:
-(add-hook 'window-size-change-functions 'lazy-lock-fontify-after-resize)
-(add-hook 'redisplay-end-trigger-functions 'lazy-lock-fontify-after-trigger)
+(add-hook 'window-size-change-functions #'lazy-lock-fontify-after-resize)
+(add-hook 'redisplay-end-trigger-functions #'lazy-lock-fontify-after-trigger)
(unless (assq 'lazy-lock-mode minor-mode-alist)
(setq minor-mode-alist (append minor-mode-alist '((lazy-lock-mode nil)))))
diff --git a/lisp/obsolete/longlines.el b/lisp/obsolete/longlines.el
index f274dfb926d6..9676d6b28e99 100644
--- a/lisp/obsolete/longlines.el
+++ b/lisp/obsolete/longlines.el
@@ -1,4 +1,4 @@
-;;; longlines.el --- automatically wrap long lines -*- coding:utf-8 -*-
+;;; longlines.el --- automatically wrap long lines -*- lexical-binding: t; -*-
;; Copyright (C) 2000-2001, 2004-2021 Free Software Foundation, Inc.
@@ -48,7 +48,6 @@
Otherwise, you can perform filling using `fill-paragraph' or
`auto-fill-mode'. In any case, the soft newlines will be removed
when the file is saved to disk."
- :group 'longlines
:type 'boolean)
(defcustom longlines-wrap-follows-window-size nil
@@ -60,7 +59,6 @@ with differing widths.
If the value is an integer, that specifies the distance from the
right edge of the window at which wrapping occurs. For any other
non-nil value, wrapping occurs 2 characters from the right edge."
- :group 'longlines
:type 'boolean)
(defcustom longlines-show-hard-newlines nil
@@ -68,13 +66,11 @@ non-nil value, wrapping occurs 2 characters from the right edge."
\(The variable `longlines-show-effect' controls what they look like.)
You can also enable the display temporarily, using the command
`longlines-show-hard-newlines'."
- :group 'longlines
:type 'boolean)
(defcustom longlines-show-effect (propertize "¶\n" 'face 'escape-glyph)
"A string to display when showing hard newlines.
This is used when `longlines-show-hard-newlines' is on."
- :group 'longlines
:type 'string)
;;; Internal variables
@@ -110,23 +106,23 @@ always call `fill-paragraph' to fill individual paragraphs.
If the variable `longlines-show-hard-newlines' is non-nil, hard
newlines are indicated with a symbol."
- :group 'longlines :lighter " ll"
+ :lighter " ll"
(if longlines-mode
;; Turn on longlines mode
(progn
(use-hard-newlines 1 'never)
(set (make-local-variable 'require-final-newline) nil)
(add-to-list 'buffer-file-format 'longlines)
- (add-hook 'change-major-mode-hook 'longlines-mode-off nil t)
- (add-hook 'before-revert-hook 'longlines-before-revert-hook nil t)
+ (add-hook 'change-major-mode-hook #'longlines-mode-off nil t)
+ (add-hook 'before-revert-hook #'longlines-before-revert-hook nil t)
(make-local-variable 'buffer-substring-filters)
(make-local-variable 'longlines-auto-wrap)
(set (make-local-variable 'isearch-search-fun-function)
- 'longlines-search-function)
+ #'longlines-search-function)
(set (make-local-variable 'replace-search-function)
- 'longlines-search-forward)
+ #'longlines-search-forward)
(set (make-local-variable 'replace-re-search-function)
- 'longlines-re-search-forward)
+ #'longlines-re-search-forward)
(add-to-list 'buffer-substring-filters 'longlines-encode-string)
(when longlines-wrap-follows-window-size
(let ((dw (if (and (integerp longlines-wrap-follows-window-size)
@@ -138,7 +134,7 @@ newlines are indicated with a symbol."
(set (make-local-variable 'fill-column)
(- (window-width) dw)))
(add-hook 'window-configuration-change-hook
- 'longlines-window-change-function nil t))
+ #'longlines-window-change-function nil t))
(let ((buffer-undo-list t)
(inhibit-read-only t)
(inhibit-modification-hooks t)
@@ -160,21 +156,22 @@ newlines are indicated with a symbol."
;; Hacks to make longlines play nice with various modes.
(cond ((eq major-mode 'mail-mode)
- (add-hook 'mail-setup-hook 'longlines-decode-buffer nil t)
+ (declare-function mail-indent-citation "sendmail" ())
+ (add-hook 'mail-setup-hook #'longlines-decode-buffer nil t)
(or mail-citation-hook
- (add-hook 'mail-citation-hook 'mail-indent-citation nil t))
- (add-hook 'mail-citation-hook 'longlines-decode-region nil t))
+ (add-hook 'mail-citation-hook #'mail-indent-citation nil t))
+ (add-hook 'mail-citation-hook #'longlines-decode-region nil t))
((eq major-mode 'message-mode)
- (add-hook 'message-setup-hook 'longlines-decode-buffer nil t)
+ (add-hook 'message-setup-hook #'longlines-decode-buffer nil t)
(make-local-variable 'message-indent-citation-function)
(if (not (listp message-indent-citation-function))
(setq message-indent-citation-function
(list message-indent-citation-function)))
- (add-to-list 'message-indent-citation-function
- 'longlines-decode-region t)))
+ (add-hook 'message-indent-citation-function
+ #'longlines-decode-region t t)))
- (add-hook 'after-change-functions 'longlines-after-change-function nil t)
- (add-hook 'post-command-hook 'longlines-post-command-function nil t)
+ (add-hook 'after-change-functions #'longlines-after-change-function nil t)
+ (add-hook 'post-command-hook #'longlines-post-command-function nil t)
(when longlines-auto-wrap
(auto-fill-mode 0)))
;; Turn off longlines mode
@@ -190,12 +187,12 @@ newlines are indicated with a symbol."
(widen)
(longlines-encode-region (point-min) (point-max))
(setq longlines-decoded nil))))
- (remove-hook 'change-major-mode-hook 'longlines-mode-off t)
- (remove-hook 'after-change-functions 'longlines-after-change-function t)
- (remove-hook 'post-command-hook 'longlines-post-command-function t)
- (remove-hook 'before-revert-hook 'longlines-before-revert-hook t)
+ (remove-hook 'change-major-mode-hook #'longlines-mode-off t)
+ (remove-hook 'after-change-functions #'longlines-after-change-function t)
+ (remove-hook 'post-command-hook #'longlines-post-command-function t)
+ (remove-hook 'before-revert-hook #'longlines-before-revert-hook t)
(remove-hook 'window-configuration-change-hook
- 'longlines-window-change-function t)
+ #'longlines-window-change-function t)
(when longlines-wrap-follows-window-size
(kill-local-variable 'fill-column))
(kill-local-variable 'isearch-search-fun-function)
@@ -482,17 +479,17 @@ This is called by `window-configuration-change-hook'."
;;; Loading and saving
(defun longlines-before-revert-hook ()
- (add-hook 'after-revert-hook 'longlines-after-revert-hook nil t)
+ (add-hook 'after-revert-hook #'longlines-after-revert-hook nil t)
(longlines-mode 0))
(defun longlines-after-revert-hook ()
- (remove-hook 'after-revert-hook 'longlines-after-revert-hook t)
+ (remove-hook 'after-revert-hook #'longlines-after-revert-hook t)
(longlines-mode 1))
(add-to-list
'format-alist
(list 'longlines "Automatically wrap long lines." nil nil
- 'longlines-encode-region t nil))
+ #'longlines-encode-region t nil))
;;; Unloading
diff --git a/lisp/obsolete/mailpost.el b/lisp/obsolete/mailpost.el
index 2f74faf1d6cd..5b3a76e2f798 100644
--- a/lisp/obsolete/mailpost.el
+++ b/lisp/obsolete/mailpost.el
@@ -1,4 +1,4 @@
-;;; mailpost.el --- RMAIL coupler to /usr/uci/post mailer
+;;; mailpost.el --- RMAIL coupler to /usr/uci/post mailer -*- lexical-binding: t; -*-
;; This is in the public domain
;; since Delp distributed it in 1986 without a copyright notice.
@@ -76,7 +76,7 @@ site-init."
(with-current-buffer errbuf
(erase-buffer))))
(with-file-modes 384 (setq temfile (make-temp-file ",rpost")))
- (apply 'call-process
+ (apply #'call-process
(append (list (if (boundp 'post-mail-program)
post-mail-program
"/usr/uci/lib/mh/post")
diff --git a/lisp/obsolete/mantemp.el b/lisp/obsolete/mantemp.el
index 287a5a732caf..97e70f298416 100644
--- a/lisp/obsolete/mantemp.el
+++ b/lisp/obsolete/mantemp.el
@@ -1,4 +1,4 @@
-;;; mantemp.el --- create manual template instantiations from g++ 2.7.2 output
+;;; mantemp.el --- create manual template instantiations from g++ 2.7.2 output -*- lexical-binding: t; -*-
;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
diff --git a/lisp/obsolete/meese.el b/lisp/obsolete/meese.el
index 81739dfa6cba..7443bacc8b2c 100644
--- a/lisp/obsolete/meese.el
+++ b/lisp/obsolete/meese.el
@@ -1,4 +1,4 @@
-;;; meese.el --- protect the impressionable young minds of America
+;;; meese.el --- protect the impressionable young minds of America -*- lexical-binding: t; -*-
;; This is in the public domain on account of being distributed since
;; 1985 or 1986 without a copyright notice.
diff --git a/lisp/obsolete/messcompat.el b/lisp/obsolete/messcompat.el
index fa73dc7a0fd4..be252395e45b 100644
--- a/lisp/obsolete/messcompat.el
+++ b/lisp/obsolete/messcompat.el
@@ -1,4 +1,4 @@
-;;; messcompat.el --- making message mode compatible with mail mode
+;;; messcompat.el --- making message mode compatible with mail mode -*- lexical-binding: t; -*-
;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
diff --git a/lisp/obsolete/metamail.el b/lisp/obsolete/metamail.el
index ef97e8aa55cc..72237239ddbb 100644
--- a/lisp/obsolete/metamail.el
+++ b/lisp/obsolete/metamail.el
@@ -1,4 +1,4 @@
-;;; metamail.el --- Metamail interface for GNU Emacs
+;;; metamail.el --- Metamail interface for GNU Emacs -*- lexical-binding: t; -*-
;; Copyright (C) 1993, 1996, 2001-2021 Free Software Foundation, Inc.
@@ -44,13 +44,11 @@
(defcustom metamail-program-name "metamail"
"Metamail program name."
- :type 'string
- :group 'metamail)
+ :type 'string)
(defcustom metamail-mailer-name "emacs"
"Mailer name set to MM_MAILER environment variable."
- :type 'string
- :group 'metamail)
+ :type 'string)
(defvar metamail-environment '("KEYHEADS=*" "MM_QUIET=1")
"Environment variables passed to `metamail'.
@@ -65,8 +63,7 @@ It is not expected to be altered globally by `set' or `setq'.
Instead, change its value temporary using `let' or `let*' form.
`-m MAILER' argument is automatically generated from the
`metamail-mailer-name' variable."
- :type '(repeat (string :tag "Switch"))
- :group 'metamail)
+ :type '(repeat (string :tag "Switch")))
;;;###autoload
(defun metamail-interpret-header ()
@@ -193,7 +190,7 @@ redisplayed as output is inserted."
(list "-m" (or metamail-mailer-name "emacs"))
(list metafile))))
;; `metamail' may not delete the temporary file!
- (condition-case error
+ (condition-case nil
(delete-file metafile)
(error nil))
)))
diff --git a/lisp/obsolete/mouse-sel.el b/lisp/obsolete/mouse-sel.el
index 608596e882b3..36d9dc658c7c 100644
--- a/lisp/obsolete/mouse-sel.el
+++ b/lisp/obsolete/mouse-sel.el
@@ -1,4 +1,4 @@
-;;; mouse-sel.el --- multi-click selection support
+;;; mouse-sel.el --- multi-click selection support -*- lexical-binding: t; -*-
;; Copyright (C) 1993-1995, 2001-2021 Free Software Foundation, Inc.
@@ -146,20 +146,17 @@
If non-nil, \\[mouse-select] and \\[mouse-extend] will leave point at the end
of the region nearest to where the mouse last was.
If nil, point will always be placed at the beginning of the region."
- :type 'boolean
- :group 'mouse-sel)
+ :type 'boolean)
(defcustom mouse-sel-cycle-clicks t
"If non-nil, \\[mouse-select] cycles the click-counts after 4 clicks."
- :type 'boolean
- :group 'mouse-sel)
+ :type 'boolean)
(defcustom mouse-sel-default-bindings t
"Control mouse bindings."
:type '(choice (const :tag "none" nil)
(const :tag "cut and paste" interprogram-cut-paste)
- (other :tag "default bindings" t))
- :group 'mouse-sel)
+ (other :tag "default bindings" t)))
;;=== Key bindings ========================================================
@@ -216,14 +213,13 @@ the mouse position (or point, if `mouse-yank-at-point' is non-nil).
- mouse-2 while selecting or extending copies selection to the
kill ring; mouse-1 or mouse-3 kills it."
:global t
- :group 'mouse-sel
(if mouse-sel-mode
(progn
;; If mouse-2 has never been done by the user, initialize the
;; `event-kind' property to ensure that `follow-link' clicks
;; are interpreted correctly.
(put 'mouse-2 'event-kind 'mouse-click)
- (add-hook 'x-lost-selection-functions 'mouse-sel-lost-selection-hook)
+ (add-hook 'x-lost-selection-functions #'mouse-sel-lost-selection-hook)
(when mouse-sel-default-bindings
;; Save original bindings and replace them with new ones.
(setq mouse-sel-original-bindings
@@ -240,7 +236,7 @@ kill ring; mouse-1 or mouse-3 kills it."
#'mouse-sel--ignore))))
;; Restore original bindings
- (remove-hook 'x-lost-selection-functions 'mouse-sel-lost-selection-hook)
+ (remove-hook 'x-lost-selection-functions #'mouse-sel-lost-selection-hook)
(dolist (binding mouse-sel-original-bindings)
(global-set-key (car binding) (cdr binding)))
;; Restore the old values of these variables,
diff --git a/lisp/obsolete/nnir.el b/lisp/obsolete/nnir.el
index 147efed0057d..337d83ccca1d 100644
--- a/lisp/obsolete/nnir.el
+++ b/lisp/obsolete/nnir.el
@@ -228,8 +228,7 @@ with three items unique to nnir summary buffers:
If nil this will use `gnus-summary-line-format'."
:version "24.1"
- :type '(choice (const :tag "gnus-summary-line-format" nil) string)
- :group 'nnir)
+ :type '(choice (const :tag "gnus-summary-line-format" nil) string))
(defcustom nnir-ignored-newsgroups ""
@@ -237,8 +236,7 @@ If nil this will use `gnus-summary-line-format'."
Any newsgroup in the active file matching this regexp will be
skipped when searching."
:version "24.1"
- :type '(regexp)
- :group 'nnir)
+ :type '(regexp))
(defcustom nnir-imap-default-search-key "whole message"
"The default IMAP search key for an nnir search.
@@ -246,19 +244,16 @@ Must be one of the keys in `nnir-imap-search-arguments'. To use
raw imap queries by default set this to \"imap\"."
:version "24.1"
:type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem)))
- nnir-imap-search-arguments))
- :group 'nnir)
+ nnir-imap-search-arguments)))
(defcustom nnir-swish++-configuration-file
(expand-file-name "~/Mail/swish++.conf")
"Configuration file for swish++."
- :type '(file)
- :group 'nnir)
+ :type '(file))
(defcustom nnir-swish++-program "search"
"Name of swish++ search executable."
- :type '(string)
- :group 'nnir)
+ :type '(string))
(defcustom nnir-swish++-additional-switches '()
"A list of strings, to be given as additional arguments to swish++.
@@ -267,8 +262,7 @@ Note that this should be a list. I.e., do NOT use the following:
(setq nnir-swish++-additional-switches \"-i -w\") ; wrong
Instead, use this:
(setq nnir-swish++-additional-switches \\='(\"-i\" \"-w\"))"
- :type '(repeat (string))
- :group 'nnir)
+ :type '(repeat (string)))
(defcustom nnir-swish++-remove-prefix (concat (getenv "HOME") "/Mail/")
"The prefix to remove from swish++ file names to get group names.
@@ -277,8 +271,7 @@ expression.
This variable is very similar to `nnir-namazu-remove-prefix', except
that it is for swish++, not Namazu."
- :type '(regexp)
- :group 'nnir)
+ :type '(regexp))
;; Swish-E.
;; URL: http://swish-e.org/
@@ -293,21 +286,18 @@ that it is for swish++, not Namazu."
This could be a server parameter.
It is never consulted once `nnir-swish-e-index-files', which should be
used instead, has been customized."
- :type '(file)
- :group 'nnir)
+ :type '(file))
(defcustom nnir-swish-e-index-files
(list nnir-swish-e-index-file)
"List of index files for swish-e.
This could be a server parameter."
- :type '(repeat (file))
- :group 'nnir)
+ :type '(repeat (file)))
(defcustom nnir-swish-e-program "swish-e"
"Name of swish-e search executable.
This cannot be a server parameter."
- :type '(string)
- :group 'nnir)
+ :type '(string))
(defcustom nnir-swish-e-additional-switches '()
"A list of strings, to be given as additional arguments to swish-e.
@@ -318,8 +308,7 @@ Instead, use this:
(setq nnir-swish-e-additional-switches \\='(\"-i\" \"-w\"))
This could be a server parameter."
- :type '(repeat (string))
- :group 'nnir)
+ :type '(repeat (string)))
(defcustom nnir-swish-e-remove-prefix (concat (getenv "HOME") "/Mail/")
"The prefix to remove from swish-e file names to get group names.
@@ -330,15 +319,13 @@ This variable is very similar to `nnir-namazu-remove-prefix', except
that it is for swish-e, not Namazu.
This could be a server parameter."
- :type '(regexp)
- :group 'nnir)
+ :type '(regexp))
;; HyREX engine, see
(defcustom nnir-hyrex-program "nnir-search"
"Name of the nnir-search executable."
- :type '(string)
- :group 'nnir)
+ :type '(string))
(defcustom nnir-hyrex-additional-switches '()
"A list of strings, to be given as additional arguments for nnir-search.
@@ -346,13 +333,11 @@ Note that this should be a list. I.e., do NOT use the following:
(setq nnir-hyrex-additional-switches \"-ddl ddl.xml -c nnir\") ; wrong !
Instead, use this:
(setq nnir-hyrex-additional-switches \\='(\"-ddl\" \"ddl.xml\" \"-c\" \"nnir\"))"
- :type '(repeat (string))
- :group 'nnir)
+ :type '(repeat (string)))
(defcustom nnir-hyrex-index-directory (getenv "HOME")
"Index directory for HyREX."
- :type '(directory)
- :group 'nnir)
+ :type '(directory))
(defcustom nnir-hyrex-remove-prefix (concat (getenv "HOME") "/Mail/")
"The prefix to remove from HyREX file names to get group names.
@@ -364,20 +349,17 @@ setting: (setq nnir-hyrex-remove-prefix \"/home/john/Mail/\")
Note the trailing slash. Removing this prefix gives \"mail/misc/42\".
`nnir' knows to remove the \"/42\" and to replace \"/\" with \".\" to
arrive at the correct group name, \"mail.misc\"."
- :type '(directory)
- :group 'nnir)
+ :type '(directory))
;; Namazu engine, see
(defcustom nnir-namazu-program "namazu"
"Name of Namazu search executable."
- :type '(string)
- :group 'nnir)
+ :type '(string))
(defcustom nnir-namazu-index-directory (expand-file-name "~/Mail/namazu/")
"Index directory for Namazu."
- :type '(directory)
- :group 'nnir)
+ :type '(directory))
(defcustom nnir-namazu-additional-switches '()
"A list of strings, to be given as additional arguments to namazu.
@@ -388,8 +370,7 @@ Note that this should be a list. I.e., do NOT use the following:
(setq nnir-namazu-additional-switches \"-i -w\") ; wrong
Instead, use this:
(setq nnir-namazu-additional-switches \\='(\"-i\" \"-w\"))"
- :type '(repeat (string))
- :group 'nnir)
+ :type '(repeat (string)))
(defcustom nnir-namazu-remove-prefix (concat (getenv "HOME") "/Mail/")
"The prefix to remove from Namazu file names to get group names.
@@ -401,14 +382,12 @@ setting: (setq nnir-namazu-remove-prefix \"/home/john/Mail/\")
Note the trailing slash. Removing this prefix gives \"mail/misc/42\".
`nnir' knows to remove the \"/42\" and to replace \"/\" with \".\" to
arrive at the correct group name, \"mail.misc\"."
- :type '(directory)
- :group 'nnir)
+ :type '(directory))
(defcustom nnir-notmuch-program "notmuch"
"Name of notmuch search executable."
:version "24.1"
- :type '(string)
- :group 'nnir)
+ :type '(string))
(defcustom nnir-notmuch-additional-switches '()
"A list of strings, to be given as additional arguments to notmuch.
@@ -418,8 +397,7 @@ Note that this should be a list. I.e., do NOT use the following:
Instead, use this:
(setq nnir-notmuch-additional-switches \\='(\"-i\" \"-w\"))"
:version "24.1"
- :type '(repeat (string))
- :group 'nnir)
+ :type '(repeat (string)))
(defcustom nnir-notmuch-remove-prefix
(regexp-quote (or (getenv "MAILDIR") (expand-file-name "~/Mail")))
@@ -430,8 +408,7 @@ expression.
This variable is very similar to `nnir-namazu-remove-prefix', except
that it is for notmuch, not Namazu."
:version "27.1"
- :type '(regexp)
- :group 'nnir)
+ :type '(regexp))
(defcustom nnir-notmuch-filter-group-names-function nil
"Whether and how to use Gnus group names as \"path:\" search terms.
@@ -457,7 +434,7 @@ like so:
`((imap nnir-run-imap
((criteria
"Imap Search in" ; Prompt
- ,(mapcar 'car nnir-imap-search-arguments) ; alist for completing
+ ,(mapcar #'car nnir-imap-search-arguments) ; alist for completing
nil ; allow any user input
nil ; initial value
nnir-imap-search-argument-history ; the history to use
@@ -495,7 +472,6 @@ Add an entry here when adding a new search engine.")
(defcustom nnir-method-default-engines '((nnimap . imap))
"Alist of default search engines keyed by server method."
:version "27.1"
- :group 'nnir
:type `(repeat (cons (choice (const nnimap) (const nntp) (const nnspool)
(const nneething) (const nndir) (const nnmbox)
(const nnml) (const nnmh) (const nndraft)
@@ -573,7 +549,7 @@ extensions."
(or groups (gnus-server-get-active srv nnir-ignored-newsgroups))))
(message "Opening server %s" server)
(apply
- 'vconcat
+ #'vconcat
(catch 'found
(mapcar
#'(lambda (group)
@@ -1214,7 +1190,7 @@ construct path: search terms (see the variable
(error "No directory found in method specification of server %s"
server))
(apply
- 'vconcat
+ #'vconcat
(mapcar (lambda (x)
(let ((group x)
artlist)
@@ -1247,7 +1223,7 @@ construct path: search terms (see the variable
(error "Cannot locate directory for group"))
(save-excursion
(apply
- 'call-process "find" nil t
+ #'call-process "find" nil t
"find" group "-maxdepth" "1" "-type" "f"
"-name" "[0-9]*" "-exec"
"grep"
@@ -1260,7 +1236,8 @@ construct path: search terms (see the variable
(let* ((path (split-string
(buffer-substring
(point)
- (line-end-position)) "/" t))
+ (line-end-position))
+ "/" t))
(art (string-to-number (car (last path)))))
(while (string= "." (car path))
(setq path (cdr path)))
@@ -1359,7 +1336,7 @@ Query for the specs, or use SPECS."
(query-spec
(or (cdr (assq 'nnir-query-spec specs))
(apply
- 'append
+ #'append
(list (cons 'query
(read-string "Query: " nil 'nnir-search-history)))
(when nnir-extra-parms
@@ -1370,7 +1347,7 @@ Query for the specs, or use SPECS."
(list (cons 'nnir-query-spec query-spec)
(cons 'nnir-group-spec group-spec))))
-(define-obsolete-function-alias 'nnir-get-active 'gnus-server-get-active "28.1")
+(define-obsolete-function-alias 'nnir-get-active #'gnus-server-get-active "28.1")
;; The end.
(provide 'nnir)
diff --git a/lisp/obsolete/old-emacs-lock.el b/lisp/obsolete/old-emacs-lock.el
index 07bccd907114..90ff93e03b13 100644
--- a/lisp/obsolete/old-emacs-lock.el
+++ b/lisp/obsolete/old-emacs-lock.el
@@ -1,4 +1,4 @@
-;;; emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked
+;;; emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked -*- lexical-binding: t; -*-
;; Copyright (C) 1994, 1997, 2001-2021 Free Software Foundation, Inc.
@@ -90,12 +90,12 @@ If the buffer is locked, signal error and display its name."
(setq emacs-lock-from-exiting t)))
(unless noninteractive
- (add-hook 'kill-emacs-hook 'check-emacs-lock))
-(add-hook 'kill-buffer-hook 'emacs-lock-check-buffer-lock)
-(add-hook 'shell-mode-hook 'emacs-lock-was-buffer-locked)
-(add-hook 'shell-mode-hook 'emacs-lock-shell-sentinel)
-(add-hook 'telnet-mode-hook 'emacs-lock-was-buffer-locked)
-(add-hook 'telnet-mode-hook 'emacs-lock-shell-sentinel)
+ (add-hook 'kill-emacs-hook #'check-emacs-lock))
+(add-hook 'kill-buffer-hook #'emacs-lock-check-buffer-lock)
+(add-hook 'shell-mode-hook #'emacs-lock-was-buffer-locked)
+(add-hook 'shell-mode-hook #'emacs-lock-shell-sentinel)
+(add-hook 'telnet-mode-hook #'emacs-lock-was-buffer-locked)
+(add-hook 'telnet-mode-hook #'emacs-lock-shell-sentinel)
(provide 'emacs-lock)
diff --git a/lisp/obsolete/otodo-mode.el b/lisp/obsolete/otodo-mode.el
index 58c385adad4b..add17b265b43 100644
--- a/lisp/obsolete/otodo-mode.el
+++ b/lisp/obsolete/otodo-mode.el
@@ -1,4 +1,4 @@
-;;; todo-mode.el --- major mode for editing TODO list files
+;;; todo-mode.el --- major mode for editing TODO list files -*- lexical-binding: t; -*-
;; Copyright (C) 1997, 1999, 2001-2021 Free Software Foundation, Inc.
@@ -280,26 +280,21 @@ every day and it may also be marked on every day of the calendar.
Using \"&%%(equal (calendar-current-date) date)\" instead will only
show and mark todo entries for today, but may slow down processing of
the diary file somewhat."
- :type 'string
- :group 'todo)
+ :type 'string)
(defcustom todo-file-do (locate-user-emacs-file "todo-do" ".todo-do")
"TODO mode list file."
:version "24.4" ; added locate-user-emacs-file
- :type 'file
- :group 'todo)
+ :type 'file)
(defcustom todo-file-done (locate-user-emacs-file "todo-done" ".todo-done")
"TODO mode archive file."
:version "24.4" ; added locate-user-emacs-file
- :type 'file
- :group 'todo)
+ :type 'file)
(defcustom todo-mode-hook nil
"TODO mode hooks."
- :type 'hook
- :group 'todo)
+ :type 'hook)
(defcustom todo-edit-mode-hook nil
"TODO Edit mode hooks."
- :type 'hook
- :group 'todo)
+ :type 'hook)
(defcustom todo-insert-threshold 0
"TODO mode insertion accuracy.
@@ -314,8 +309,7 @@ your item just before that point. If you set the threshold to,
e.g. 8, it will stop as soon as the window size drops below that
amount and will insert the item in the approximate center of that
window."
- :type 'integer
- :group 'todo)
+ :type 'integer)
(defvar todo-edit-buffer " *TODO Edit*"
"TODO Edit buffer name.")
(defcustom todo-file-top (locate-user-emacs-file "todo-top" ".todo-top")
@@ -324,32 +318,26 @@ window."
Not in TODO format, but diary compatible.
Automatically generated when `todo-save-top-priorities' is non-nil."
:version "24.4" ; added locate-user-emacs-file
- :type 'string
- :group 'todo)
+ :type 'string)
(defcustom todo-print-function 'ps-print-buffer-with-faces
"Function to print the current buffer."
- :type 'symbol
- :group 'todo)
+ :type 'symbol)
(defcustom todo-show-priorities 1
"Default number of priorities to show by \\[todo-top-priorities].
0 means show all entries."
- :type 'integer
- :group 'todo)
+ :type 'integer)
(defcustom todo-print-priorities 0
"Default number of priorities to print by \\[todo-print].
0 means print all entries."
- :type 'integer
- :group 'todo)
+ :type 'integer)
(defcustom todo-remove-separator t
"Non-nil to remove category separators in\
\\[todo-top-priorities] and \\[todo-print]."
- :type 'boolean
- :group 'todo)
+ :type 'boolean)
(defcustom todo-save-top-priorities-too t
"Non-nil makes `todo-save' automatically save top-priorities in `todo-file-top'."
- :type 'boolean
- :group 'todo)
+ :type 'boolean)
;; Thanks for the ISO time stamp format go to Karl Eichwalder
;; My format string for the appt.el package is "%3b %2d, %y, %02I:%02M%p".
@@ -358,17 +346,14 @@ Automatically generated when `todo-save-top-priorities' is non-nil."
"%:y-%02m-%02d %02H:%02M"
"TODO mode time string format for done entries.
For details see the variable `time-stamp-format'."
- :type 'string
- :group 'todo)
+ :type 'string)
(defcustom todo-entry-prefix-function 'todo-entry-timestamp-initials
"Function producing text to insert at start of todo entry."
- :type 'symbol
- :group 'todo)
+ :type 'symbol)
(defcustom todo-initials (or (getenv "INITIALS") (user-login-name))
"Initials of todo item author."
- :type 'string
- :group 'todo)
+ :type 'string)
(defun todo-entry-timestamp-initials ()
"Prepend timestamp and your initials to the head of a TODO entry."
@@ -395,25 +380,25 @@ Use `todo-categories' instead.")
(defvar todo-mode-map
(let ((map (make-keymap)))
(suppress-keymap map t)
- (define-key map "+" 'todo-forward-category)
- (define-key map "-" 'todo-backward-category)
- (define-key map "d" 'todo-file-item) ;done/delete
- (define-key map "e" 'todo-edit-item)
- (define-key map "E" 'todo-edit-multiline)
- (define-key map "f" 'todo-file-item)
- (define-key map "i" 'todo-insert-item)
- (define-key map "I" 'todo-insert-item-here)
- (define-key map "j" 'todo-jump-to-category)
- (define-key map "k" 'todo-delete-item)
- (define-key map "l" 'todo-lower-item)
- (define-key map "n" 'todo-forward-item)
- (define-key map "p" 'todo-backward-item)
- (define-key map "P" 'todo-print)
- (define-key map "q" 'todo-quit)
- (define-key map "r" 'todo-raise-item)
- (define-key map "s" 'todo-save)
- (define-key map "S" 'todo-save-top-priorities)
- (define-key map "t" 'todo-top-priorities)
+ (define-key map "+" #'todo-forward-category)
+ (define-key map "-" #'todo-backward-category)
+ (define-key map "d" #'todo-file-item) ;done/delete
+ (define-key map "e" #'todo-edit-item)
+ (define-key map "E" #'todo-edit-multiline)
+ (define-key map "f" #'todo-file-item)
+ (define-key map "i" #'todo-insert-item)
+ (define-key map "I" #'todo-insert-item-here)
+ (define-key map "j" #'todo-jump-to-category)
+ (define-key map "k" #'todo-delete-item)
+ (define-key map "l" #'todo-lower-item)
+ (define-key map "n" #'todo-forward-item)
+ (define-key map "p" #'todo-backward-item)
+ (define-key map "P" #'todo-print)
+ (define-key map "q" #'todo-quit)
+ (define-key map "r" #'todo-raise-item)
+ (define-key map "s" #'todo-save)
+ (define-key map "S" #'todo-save-top-priorities)
+ (define-key map "t" #'todo-top-priorities)
map)
"TODO mode keymap.")
@@ -451,7 +436,7 @@ Use `todo-categories' instead.")
(search-forward-regexp (concat "^" todo-category-end))
(narrow-to-region begin (line-beginning-position))
(goto-char (point-min)))))
-(defalias 'todo-cat-slct 'todo-category-select)
+(defalias 'todo-cat-slct #'todo-category-select)
(defun todo-forward-category ()
"Go forward to TODO list of next category."
@@ -459,7 +444,7 @@ Use `todo-categories' instead.")
(setq todo-category-number
(mod (1+ todo-category-number) (length todo-categories)))
(todo-category-select))
-(defalias 'todo-cmd-forw 'todo-forward-category)
+(defalias 'todo-cmd-forw #'todo-forward-category)
(defun todo-backward-category ()
"Go back to TODO list of previous category."
@@ -467,14 +452,14 @@ Use `todo-categories' instead.")
(setq todo-category-number
(mod (1- todo-category-number) (length todo-categories)))
(todo-category-select))
-(defalias 'todo-cmd-back 'todo-backward-category)
+(defalias 'todo-cmd-back #'todo-backward-category)
(defun todo-backward-item ()
"Select previous entry of TODO list."
(interactive)
(search-backward-regexp (concat "^" (regexp-quote todo-prefix)) nil t)
(message ""))
-(defalias 'todo-cmd-prev 'todo-backward-item)
+(defalias 'todo-cmd-prev #'todo-backward-item)
(defun todo-forward-item (&optional count)
"Select COUNT-th next entry of TODO list."
@@ -485,7 +470,7 @@ Use `todo-categories' instead.")
nil 'goto-end count)
(beginning-of-line)
(message ""))
-(defalias 'todo-cmd-next 'todo-forward-item)
+(defalias 'todo-cmd-next #'todo-forward-item)
(defun todo-save ()
"Save the TODO list."
@@ -494,7 +479,7 @@ Use `todo-categories' instead.")
(save-restriction
(save-buffer)))
(if todo-save-top-priorities-too (todo-save-top-priorities)))
-(defalias 'todo-cmd-save 'todo-save)
+(defalias 'todo-cmd-save #'todo-save)
(defun todo-quit ()
"Done with TODO list for now."
@@ -503,7 +488,7 @@ Use `todo-categories' instead.")
(todo-save)
(message "")
(bury-buffer))
-(defalias 'todo-cmd-done 'todo-quit)
+(defalias 'todo-cmd-done #'todo-quit)
(defun todo-edit-item ()
"Edit current TODO list entry."
@@ -518,7 +503,7 @@ Use `todo-categories' instead.")
(todo-backward-item)
(message ""))))
(error "No TODO list entry to edit")))
-(defalias 'todo-cmd-edit 'todo-edit-item)
+(defalias 'todo-cmd-edit #'todo-edit-item)
(defun todo-edit-multiline ()
"Set up a buffer for editing a multiline TODO list entry."
@@ -622,7 +607,7 @@ category."
(category (if arg (todo-completing-read) current-category)))
(todo-add-item-non-interactively new-item category))))
-(defalias 'todo-cmd-inst 'todo-insert-item)
+(defalias 'todo-cmd-inst #'todo-insert-item)
(defun todo-insert-item-here ()
"Insert a new TODO list entry directly above the entry at point.
@@ -650,7 +635,7 @@ If point is on an empty line, insert the entry there."
(setq todo-previous-answer
(y-or-n-p (format-message "More important than `%s'? " item)))))
todo-previous-answer)
-(defalias 'todo-ask-p 'todo-more-important-p)
+(defalias 'todo-ask-p #'todo-more-important-p)
(defun todo-delete-item ()
"Delete current TODO list entry."
@@ -664,7 +649,7 @@ If point is on an empty line, insert the entry there."
(todo-backward-item))
(message ""))
(error "No TODO list entry to delete")))
-(defalias 'todo-cmd-kill 'todo-delete-item)
+(defalias 'todo-cmd-kill #'todo-delete-item)
(defun todo-raise-item ()
"Raise priority of current entry."
@@ -677,7 +662,7 @@ If point is on an empty line, insert the entry there."
(insert item "\n"))
(message ""))
(error "No TODO list entry to raise")))
-(defalias 'todo-cmd-rais 'todo-raise-item)
+(defalias 'todo-cmd-rais #'todo-raise-item)
(defun todo-lower-item ()
"Lower priority of current entry."
@@ -691,7 +676,7 @@ If point is on an empty line, insert the entry there."
(insert item "\n"))
(message ""))
(error "No TODO list entry to lower")))
-(defalias 'todo-cmd-lowr 'todo-lower-item)
+(defalias 'todo-cmd-lowr #'todo-lower-item)
(defun todo-file-item (&optional comment)
"File the current TODO list entry away, annotated with an optional COMMENT."
diff --git a/lisp/obsolete/patcomp.el b/lisp/obsolete/patcomp.el
index 8545f0721fac..2c35cb070073 100644
--- a/lisp/obsolete/patcomp.el
+++ b/lisp/obsolete/patcomp.el
@@ -1,4 +1,4 @@
-;;; patcomp.el --- used by patch files to update Emacs releases
+;;; patcomp.el --- used by patch files to update Emacs releases -*- lexical-binding: t; -*-
;; This file is part of GNU Emacs.
diff --git a/lisp/obsolete/pc-mode.el b/lisp/obsolete/pc-mode.el
index d4c90c2b2986..cf0bc28b110f 100644
--- a/lisp/obsolete/pc-mode.el
+++ b/lisp/obsolete/pc-mode.el
@@ -1,4 +1,4 @@
-;;; pc-mode.el --- emulate certain key bindings used on PCs
+;;; pc-mode.el --- emulate certain key bindings used on PCs -*- lexical-binding: t; -*-
;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
@@ -40,16 +40,16 @@ C-Escape does list-buffers."
(define-key function-key-map [delete] "\C-d")
(define-key function-key-map [M-delete] [?\M-d])
(define-key function-key-map [C-delete] [?\M-d])
- (global-set-key [C-M-delete] 'kill-sexp)
- (global-set-key [C-backspace] 'backward-kill-word)
- (global-set-key [M-backspace] 'undo)
+ (global-set-key [C-M-delete] #'kill-sexp)
+ (global-set-key [C-backspace] #'backward-kill-word)
+ (global-set-key [M-backspace] #'undo)
- (global-set-key [C-escape] 'list-buffers)
+ (global-set-key [C-escape] #'list-buffers)
- (global-set-key [home] 'beginning-of-line)
- (global-set-key [end] 'end-of-line)
- (global-set-key [C-home] 'beginning-of-buffer)
- (global-set-key [C-end] 'end-of-buffer))
+ (global-set-key [home] #'beginning-of-line)
+ (global-set-key [end] #'end-of-line)
+ (global-set-key [C-home] #'beginning-of-buffer)
+ (global-set-key [C-end] #'end-of-buffer))
(provide 'pc-mode)
diff --git a/lisp/obsolete/pc-select.el b/lisp/obsolete/pc-select.el
index 3f184881096d..59828759e66f 100644
--- a/lisp/obsolete/pc-select.el
+++ b/lisp/obsolete/pc-select.el
@@ -1,4 +1,4 @@
-;;; pc-select.el --- emulate mark, cut, copy and paste from Motif
+;;; pc-select.el --- emulate mark, cut, copy and paste from Motif -*- lexical-binding: t; -*-
;;; (or MAC GUI or MS-windoze (bah)) look-and-feel
;;; including key bindings.
@@ -94,25 +94,21 @@ The scroll commands normally generate an error if you try to scroll
past the top or bottom of the buffer. This is annoying when selecting
text with these commands. If you set this variable to non-nil, these
errors are suppressed."
- :type 'boolean
- :group 'pc-select)
+ :type 'boolean)
(defcustom pc-select-selection-keys-only nil
"Non-nil means only bind the basic selection keys when started.
Other keys that emulate pc-behavior will be untouched.
This gives mostly Emacs-like behavior with only the selection keys enabled."
- :type 'boolean
- :group 'pc-select)
+ :type 'boolean)
(defcustom pc-select-meta-moves-sexps nil
"Non-nil means move sexp-wise with Meta key, otherwise move word-wise."
- :type 'boolean
- :group 'pc-select)
+ :type 'boolean)
(defcustom pc-selection-mode-hook nil
"The hook to run when PC Selection mode is toggled."
- :type 'hook
- :group 'pc-select)
+ :type 'hook)
(defvar pc-select-saved-settings-alist nil
"The values of the variables before PC Selection mode was toggled on.
@@ -320,7 +316,6 @@ but before calling PC Selection mode):
;; FIXME: bring pc-bindings-mode here ?
nil nil nil
- :group 'pc-select
:global t
(if pc-selection-mode
diff --git a/lisp/obsolete/pgg-def.el b/lisp/obsolete/pgg-def.el
index 425093832f8f..4d30e3261481 100644
--- a/lisp/obsolete/pgg-def.el
+++ b/lisp/obsolete/pgg-def.el
@@ -1,4 +1,4 @@
-;;; pgg-def.el --- functions/macros for defining PGG functions
+;;; pgg-def.el --- functions/macros for defining PGG functions -*- lexical-binding: t; -*-
;; Copyright (C) 1999, 2002-2021 Free Software Foundation, Inc.
@@ -32,47 +32,39 @@
(defcustom pgg-default-scheme 'gpg
"Default PGP scheme."
- :group 'pgg
:type '(choice (const :tag "GnuPG" gpg)
(const :tag "PGP 5" pgp5)
(const :tag "PGP" pgp)))
(defcustom pgg-default-user-id (user-login-name)
"User ID of your default identity."
- :group 'pgg
:type 'string)
(defcustom pgg-default-keyserver-address "subkeys.pgp.net"
"Host name of keyserver."
- :group 'pgg
:type 'string)
(defcustom pgg-query-keyserver nil
"Whether PGG queries keyservers for missing keys when verifying messages."
:version "22.1"
- :group 'pgg
:type 'boolean)
(defcustom pgg-encrypt-for-me t
"If t, encrypt all outgoing messages with user's public key."
- :group 'pgg
:type 'boolean)
(defcustom pgg-cache-passphrase t
"If t, cache passphrase."
- :group 'pgg
:type 'boolean)
(defcustom pgg-passphrase-cache-expiry 16
"How many seconds the passphrase is cached.
Whether the passphrase is cached at all is controlled by
`pgg-cache-passphrase'."
- :group 'pgg
:type 'integer)
(defcustom pgg-passphrase-coding-system nil
"Coding system to encode passphrase."
- :group 'pgg
:type 'coding-system)
(defvar pgg-messages-coding-system nil
diff --git a/lisp/obsolete/pgg-gpg.el b/lisp/obsolete/pgg-gpg.el
index 90255fe2f7db..d06a485b975f 100644
--- a/lisp/obsolete/pgg-gpg.el
+++ b/lisp/obsolete/pgg-gpg.el
@@ -1,4 +1,4 @@
-;;; pgg-gpg.el --- GnuPG support for PGG.
+;;; pgg-gpg.el --- GnuPG support for PGG. -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2000, 2002-2021 Free Software Foundation, Inc.
@@ -37,23 +37,19 @@
(defcustom pgg-gpg-program "gpg"
"The GnuPG executable."
- :group 'pgg-gpg
:type 'string)
(defcustom pgg-gpg-extra-args nil
"Extra arguments for every GnuPG invocation."
- :group 'pgg-gpg
:type '(repeat (string :tag "Argument")))
(defcustom pgg-gpg-recipient-argument "--recipient"
"GnuPG option to specify recipient."
- :group 'pgg-gpg
:type '(choice (const :tag "New `--recipient' option" "--recipient")
(const :tag "Old `--remote-user' option" "--remote-user")))
(defcustom pgg-gpg-use-agent t
"Whether to use gnupg agent for key caching."
- :group 'pgg-gpg
:type 'boolean)
(defvar pgg-gpg-user-id nil
@@ -97,7 +93,7 @@
passphrase-with-newline
(coding-system-change-eol-conversion
pgg-passphrase-coding-system 'unix)))
- (pgg-clear-string passphrase-with-newline))
+ (clear-string passphrase-with-newline))
(setq encoded-passphrase-with-new-line passphrase-with-newline
passphrase-with-newline nil))
(process-send-string process encoded-passphrase-with-new-line))
@@ -125,9 +121,9 @@
(if (= 127 exit-status)
(error "%s could not be found" program))))
(if passphrase-with-newline
- (pgg-clear-string passphrase-with-newline))
+ (clear-string passphrase-with-newline))
(if encoded-passphrase-with-new-line
- (pgg-clear-string encoded-passphrase-with-new-line))
+ (clear-string encoded-passphrase-with-new-line))
(if (and process (eq 'run (process-status process)))
(interrupt-process process))
(if (file-exists-p output-file-name)
diff --git a/lisp/obsolete/pgg-parse.el b/lisp/obsolete/pgg-parse.el
index edb5d4f6775e..2c76365a4152 100644
--- a/lisp/obsolete/pgg-parse.el
+++ b/lisp/obsolete/pgg-parse.el
@@ -1,4 +1,4 @@
-;;; pgg-parse.el --- OpenPGP packet parsing
+;;; pgg-parse.el --- OpenPGP packet parsing -*- lexical-binding: t; -*-
;; Copyright (C) 1999, 2002-2021 Free Software Foundation, Inc.
@@ -44,14 +44,12 @@
(defcustom pgg-parse-public-key-algorithm-alist
'((1 . RSA) (2 . RSA-E) (3 . RSA-S) (16 . ELG-E) (17 . DSA) (20 . ELG))
"Alist of the assigned number to the public key algorithm."
- :group 'pgg-parse
:type '(repeat
(cons (sexp :tag "Number") (sexp :tag "Type"))))
(defcustom pgg-parse-symmetric-key-algorithm-alist
'((1 . IDEA) (2 . 3DES) (4 . CAST5) (5 . SAFER-SK128))
"Alist of the assigned number to the symmetric key algorithm."
- :group 'pgg-parse
:type '(repeat
(cons (sexp :tag "Number") (sexp :tag "Type"))))
@@ -59,7 +57,6 @@
'((1 . MD5) (2 . SHA1) (3 . RIPEMD160) (5 . MD2) (8 . SHA256) (9 . SHA384)
(10 . SHA512))
"Alist of the assigned number to the cryptographic hash algorithm."
- :group 'pgg-parse
:type '(repeat
(cons (sexp :tag "Number") (sexp :tag "Type"))))
@@ -68,7 +65,6 @@
(1 . ZIP)
(2 . ZLIB))
"Alist of the assigned number to the compression algorithm."
- :group 'pgg-parse
:type '(repeat
(cons (sexp :tag "Number") (sexp :tag "Type"))))
@@ -87,13 +83,11 @@
(48 . "Certification revocation signature")
(64 . "Timestamp signature."))
"Alist of the assigned number to the signature type."
- :group 'pgg-parse
:type '(repeat
(cons (sexp :tag "Number") (sexp :tag "Type"))))
(defcustom pgg-ignore-packet-checksum t; XXX
"If non-nil checksum of each ascii armored packet will be ignored."
- :group 'pgg-parse
:type 'boolean)
(defvar pgg-armor-header-lines
@@ -148,7 +142,7 @@
;; `(string-to-number-list (pgg-read-body-string ,ptag))
)
-(defalias 'pgg-skip-bytes 'forward-char)
+(defalias 'pgg-skip-bytes #'forward-char)
(defmacro pgg-skip-header (ptag)
`(pgg-skip-bytes (nth 2 ,ptag)))
@@ -345,7 +339,7 @@
;; 100 to 110 = internal or user-defined
))
-(defun pgg-parse-signature-packet (ptag)
+(defun pgg-parse-signature-packet (_ptag)
(let* ((signature-version (pgg-byte-after))
(result (list (cons 'version signature-version)))
hashed-material field n)
@@ -411,7 +405,7 @@
pgg-parse-hash-algorithm-alist)))
result))
-(defun pgg-parse-public-key-encrypted-session-key-packet (ptag)
+(defun pgg-parse-public-key-encrypted-session-key-packet (_ptag)
(let (result)
(pgg-set-alist result
'version (pgg-read-byte))
@@ -425,7 +419,7 @@
pgg-parse-public-key-algorithm-alist)))
result))
-(defun pgg-parse-symmetric-key-encrypted-session-key-packet (ptag)
+(defun pgg-parse-symmetric-key-encrypted-session-key-packet (_ptag)
(let (result)
(pgg-set-alist result
'version
@@ -436,7 +430,7 @@
pgg-parse-symmetric-key-algorithm-alist)))
result))
-(defun pgg-parse-public-key-packet (ptag)
+(defun pgg-parse-public-key-packet (_ptag)
(let* ((key-version (pgg-read-byte))
(result (list (cons 'version key-version)))
field)
diff --git a/lisp/obsolete/pgg-pgp.el b/lisp/obsolete/pgg-pgp.el
index e02032a6a571..665be0b2e2cd 100644
--- a/lisp/obsolete/pgg-pgp.el
+++ b/lisp/obsolete/pgg-pgp.el
@@ -1,4 +1,4 @@
-;;; pgg-pgp.el --- PGP 2.* and 6.* support for PGG.
+;;; pgg-pgp.el --- PGP 2.* and 6.* support for PGG. -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2000, 2002-2021 Free Software Foundation, Inc.
@@ -35,23 +35,19 @@
(defcustom pgg-pgp-program "pgp"
"PGP 2.* and 6.* executable."
- :group 'pgg-pgp
:type 'string)
(defcustom pgg-pgp-shell-file-name "/bin/sh"
"File name to load inferior shells from.
Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
- :group 'pgg-pgp
:type 'string)
(defcustom pgg-pgp-shell-command-switch "-c"
"Switch used to have the shell execute its command line argument."
- :group 'pgg-pgp
:type 'string)
(defcustom pgg-pgp-extra-args nil
"Extra arguments for every PGP invocation."
- :group 'pgg-pgp
:type '(choice
(const :tag "None" nil)
(string :tag "Arguments")))
@@ -112,7 +108,7 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
(delete-file errors-file-name)
(file-error nil)))))
-(defun pgg-pgp-lookup-key (string &optional type)
+(defun pgg-pgp-lookup-key (string &optional _type)
"Search keys associated with STRING."
(let ((args (list "+batchmode" "+language=en" "-kv" string)))
(with-current-buffer (get-buffer-create pgg-output-buffer)
@@ -133,7 +129,7 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
(defun pgg-pgp-encrypt-region (start end recipients &optional sign passphrase)
"Encrypt the current region between START and END."
(let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
- (passphrase (or passphrase
+ (_passphrase (or passphrase
(when sign
(pgg-read-passphrase
(format "PGP passphrase for %s: "
@@ -143,10 +139,11 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
(concat
"+encrypttoself=off +verbose=1 +batchmode +language=us -fate "
(if (or recipients pgg-encrypt-for-me)
- (mapconcat 'shell-quote-argument
+ (mapconcat #'shell-quote-argument
(append recipients
(if pgg-encrypt-for-me
- (list pgg-pgp-user-id))) " "))
+ (list pgg-pgp-user-id)))
+ " "))
(if sign (concat " -s -u " (shell-quote-argument pgg-pgp-user-id))))))
(pgg-pgp-process-region start end nil pgg-pgp-program args)
(pgg-process-when-success nil)))
@@ -203,6 +200,7 @@ passphrase cache or user."
(let* ((orig-file (pgg-make-temp-file "pgg"))
(args "+verbose=1 +batchmode +language=us"))
(with-file-modes 448
+ (defvar jam-zcat-filename-list)
(let ((coding-system-for-write 'binary)
jka-compr-compression-info-list jam-zcat-filename-list)
(write-region start end orig-file)))
diff --git a/lisp/obsolete/pgg-pgp5.el b/lisp/obsolete/pgg-pgp5.el
index 42ff1ca2bd62..d9523172418f 100644
--- a/lisp/obsolete/pgg-pgp5.el
+++ b/lisp/obsolete/pgg-pgp5.el
@@ -1,4 +1,4 @@
-;;; pgg-pgp5.el --- PGP 5.* support for PGG.
+;;; pgg-pgp5.el --- PGP 5.* support for PGG. -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2000, 2002-2021 Free Software Foundation, Inc.
@@ -35,38 +35,31 @@
(defcustom pgg-pgp5-pgpe-program "pgpe"
"PGP 5.* `pgpe' executable."
- :group 'pgg-pgp5
:type 'string)
(defcustom pgg-pgp5-pgps-program "pgps"
"PGP 5.* `pgps' executable."
- :group 'pgg-pgp5
:type 'string)
(defcustom pgg-pgp5-pgpk-program "pgpk"
"PGP 5.* `pgpk' executable."
- :group 'pgg-pgp5
:type 'string)
(defcustom pgg-pgp5-pgpv-program "pgpv"
"PGP 5.* `pgpv' executable."
- :group 'pgg-pgp5
:type 'string)
(defcustom pgg-pgp5-shell-file-name "/bin/sh"
"File name to load inferior shells from.
Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
- :group 'pgg-pgp5
:type 'string)
(defcustom pgg-pgp5-shell-command-switch "-c"
"Switch used to have the shell execute its command line argument."
- :group 'pgg-pgp5
:type 'string)
(defcustom pgg-pgp5-extra-args nil
"Extra arguments for every PGP 5.* invocation."
- :group 'pgg-pgp5
:type '(choice
(const :tag "None" nil)
(string :tag "Arguments")))
@@ -128,7 +121,7 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
(delete-file errors-file-name)
(file-error nil)))))
-(defun pgg-pgp5-lookup-key (string &optional type)
+(defun pgg-pgp5-lookup-key (string &optional _type)
"Search keys associated with STRING."
(let ((args (list "+language=en" "-l" string)))
(with-current-buffer (get-buffer-create pgg-output-buffer)
@@ -145,7 +138,7 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
(defun pgg-pgp5-encrypt-region (start end recipients &optional sign passphrase)
"Encrypt the current region between START and END."
(let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
- (passphrase (or passphrase
+ (_passphrase (or passphrase
(when sign
(pgg-read-passphrase
(format "PGP passphrase for %s: "
@@ -209,6 +202,7 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
(let ((orig-file (pgg-make-temp-file "pgg"))
(args '("+verbose=1" "+batchmode=1" "+language=us")))
(with-file-modes 448
+ (defvar jam-zcat-filename-list) ;Not sure where this comes from.
(let ((coding-system-for-write 'binary)
jka-compr-compression-info-list jam-zcat-filename-list)
(write-region start end orig-file)))
diff --git a/lisp/obsolete/pgg.el b/lisp/obsolete/pgg.el
index ec93eeb93f85..5ed59933f23d 100644
--- a/lisp/obsolete/pgg.el
+++ b/lisp/obsolete/pgg.el
@@ -1,4 +1,4 @@
-;;; pgg.el --- glue for the various PGP implementations.
+;;; pgg.el --- glue for the various PGP implementations. -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2000, 2002-2021 Free Software Foundation, Inc.
@@ -27,99 +27,19 @@
(require 'pgg-def)
(require 'pgg-parse)
-(autoload 'run-at-time "timer")
(eval-when-compile (require 'cl-lib))
;;; @ utility functions
;;;
-(eval-when-compile
- (when (featurep 'xemacs)
- (defmacro pgg-run-at-time-1 (time repeat function args)
- (if (condition-case nil
- (let ((delete-itimer 'delete-itimer)
- (itimer-driver-start 'itimer-driver-start)
- (itimer-value 'itimer-value)
- (start-itimer 'start-itimer))
- (unless (or (symbol-value 'itimer-process)
- (symbol-value 'itimer-timer))
- (funcall itimer-driver-start))
- ;; Check whether there is a bug to which the difference of
- ;; the present time and the time when the itimer driver was
- ;; woken up is subtracted from the initial itimer value.
- (let* ((inhibit-quit t)
- (ctime (current-time))
- (itimer-timer-last-wakeup
- (prog1
- ctime
- (setcar ctime (1- (car ctime)))))
- (itimer-list nil)
- (itimer (funcall start-itimer "pgg-run-at-time"
- 'ignore 5)))
- (sleep-for 0.1) ;; Accept the timeout interrupt.
- (prog1
- (> (funcall itimer-value itimer) 0)
- (funcall delete-itimer itimer))))
- (error nil))
- `(let ((time ,time))
- (apply #'start-itimer "pgg-run-at-time"
- ,function (if time (max time 1e-9) 1e-9)
- ,repeat nil t ,args))
- `(let ((time ,time)
- (itimers (list nil)))
- (setcar
- itimers
- (apply #'start-itimer "pgg-run-at-time"
- (lambda (itimers repeat function &rest args)
- (let ((itimer (car itimers)))
- (if repeat
- (progn
- (set-itimer-function
- itimer
- (lambda (itimer repeat function &rest args)
- (set-itimer-restart itimer repeat)
- (set-itimer-function itimer function)
- (set-itimer-function-arguments itimer args)
- (apply function args)))
- (set-itimer-function-arguments
- itimer
- (append (list itimer repeat function) args)))
- (set-itimer-function
- itimer
- (lambda (itimer function &rest args)
- (delete-itimer itimer)
- (apply function args)))
- (set-itimer-function-arguments
- itimer
- (append (list itimer function) args)))))
- 1e-9 (if time (max time 1e-9) 1e-9)
- nil t itimers ,repeat ,function ,args)))))))
-
-(eval-and-compile
- (if (featurep 'xemacs)
- (progn
- (defun pgg-run-at-time (time repeat function &rest args)
- "Emulating function run as `run-at-time'.
-TIME should be nil meaning now, or a number of seconds from now.
-Return an itimer object which can be used in either `delete-itimer'
-or `cancel-timer'."
- (pgg-run-at-time-1 time repeat function args))
- (defun pgg-cancel-timer (timer)
- "Emulate cancel-timer for xemacs."
- (let ((delete-itimer 'delete-itimer))
- (funcall delete-itimer timer))))
- (defalias 'pgg-run-at-time 'run-at-time)
- (defalias 'pgg-cancel-timer 'cancel-timer)))
-
(defun pgg-invoke (func scheme &rest args)
(progn
(require (intern (format "pgg-%s" scheme)))
- (apply 'funcall (intern (format "pgg-%s-%s" scheme func)) args)))
-
-(put 'pgg-save-coding-system 'lisp-indent-function 2)
+ (apply #'funcall (intern (format "pgg-%s-%s" scheme func)) args)))
(defmacro pgg-save-coding-system (start end &rest body)
+ (declare (indent 2) (debug t))
`(if (called-interactively-p 'interactive)
(let ((buffer (current-buffer)))
(with-temp-buffer
@@ -209,23 +129,16 @@ regulate cache behavior."
(let* ((key (if notruncate key (pgg-truncate-key-identifier key)))
(interned-timer-key (intern-soft key pgg-pending-timers))
(old-timer (symbol-value interned-timer-key))
- new-timer)
+ ) ;; new-timer
(when old-timer
(cancel-timer old-timer)
(unintern interned-timer-key pgg-pending-timers))
(set (intern key pgg-passphrase-cache)
passphrase)
(set (intern key pgg-pending-timers)
- (pgg-run-at-time pgg-passphrase-cache-expiry nil
- #'pgg-remove-passphrase-from-cache
- key notruncate))))
-
-(if (fboundp 'clear-string)
- (defalias 'pgg-clear-string 'clear-string)
- (defun pgg-clear-string (string)
- (fillarray string ?_)))
-
-(declare-function pgg-clear-string "pgg" (string))
+ (run-at-time pgg-passphrase-cache-expiry nil
+ #'pgg-remove-passphrase-from-cache
+ key notruncate))))
(defun pgg-remove-passphrase-from-cache (key &optional notruncate)
"Omit passphrase associated with KEY in time-limited passphrase cache.
@@ -245,10 +158,10 @@ regulate cache behavior."
(interned-timer-key (intern-soft key pgg-pending-timers))
(old-timer (symbol-value interned-timer-key)))
(when passphrase
- (pgg-clear-string passphrase)
+ (clear-string passphrase)
(unintern key pgg-passphrase-cache))
(when old-timer
- (pgg-cancel-timer old-timer)
+ (cancel-timer old-timer)
(unintern interned-timer-key pgg-pending-timers))))
(defmacro pgg-convert-lbt-region (start end lbt)
@@ -265,9 +178,8 @@ regulate cache behavior."
(while (re-search-forward "\r$" pgg-conversion-end t)
(replace-match ""))))))
-(put 'pgg-as-lbt 'lisp-indent-function 3)
-
(defmacro pgg-as-lbt (start end lbt &rest body)
+ (declare (indent 3) (debug t))
`(let ((inhibit-read-only t)
buffer-read-only
buffer-undo-list)
@@ -277,9 +189,8 @@ regulate cache behavior."
(push nil buffer-undo-list)
(ignore-errors (undo))))
-(put 'pgg-process-when-success 'lisp-indent-function 0)
-
(defmacro pgg-process-when-success (&rest body)
+ (declare (indent 0) (debug t))
`(with-current-buffer pgg-output-buffer
(if (zerop (buffer-size)) nil ,@body t)))
@@ -377,7 +288,7 @@ passphrase cache or user."
If optional PASSPHRASE is not specified, it will be obtained from the
passphrase cache or user."
(interactive "r")
- (let* ((buf (current-buffer))
+ (let* (;; (buf (current-buffer))
(status
(pgg-save-coding-system start end
(pgg-invoke "decrypt-region" (or pgg-scheme pgg-default-scheme)
diff --git a/lisp/obsolete/rcompile.el b/lisp/obsolete/rcompile.el
index 29931d9bda46..d7020f0d0745 100644
--- a/lisp/obsolete/rcompile.el
+++ b/lisp/obsolete/rcompile.el
@@ -1,4 +1,4 @@
-;;; rcompile.el --- run a compilation on a remote machine
+;;; rcompile.el --- run a compilation on a remote machine -*- lexical-binding: t; -*-
;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
@@ -76,14 +76,12 @@
(defcustom remote-compile-host nil
"Host for remote compilations."
- :type '(choice string (const nil))
- :group 'remote-compile)
+ :type '(choice string (const nil)))
(defcustom remote-compile-user nil
"User for remote compilations.
nil means use the value returned by \\[user-login-name]."
- :type '(choice string (const nil))
- :group 'remote-compile)
+ :type '(choice string (const nil)))
(defcustom remote-compile-run-before nil
"Command to run before compilation.
@@ -91,18 +89,15 @@ This can be used for setting up environment variables,
since rsh does not invoke the shell as a login shell and files like .login
\(tcsh) and .bash_profile \(bash) are not run.
nil means run no commands."
- :type '(choice string (const nil))
- :group 'remote-compile)
+ :type '(choice string (const nil)))
(defcustom remote-compile-prompt-for-host nil
"Non-nil means prompt for host if not available from filename."
- :type 'boolean
- :group 'remote-compile)
+ :type 'boolean)
(defcustom remote-compile-prompt-for-user nil
"Non-nil means prompt for user if not available from filename."
- :type 'boolean
- :group 'remote-compile)
+ :type 'boolean)
;;;; internal variables
@@ -123,7 +118,7 @@ nil means run no commands."
"Compile the current buffer's directory on HOST. Log in as USER.
See \\[compile]."
(interactive
- (let (host user command prompt l l-host l-user)
+ (let (host user command prompt) ;; l l-host l-user
(setq prompt (if (stringp remote-compile-host)
(format "Compile on host (default %s): "
remote-compile-host)
@@ -153,7 +148,7 @@ See \\[compile]."
(setq remote-compile-user user))
((null remote-compile-user)
(setq remote-compile-user (user-login-name))))
- (let* (localname ;; Pacify byte-compiler.
+ (let* (;; localname ;; Pacify byte-compiler.
(compile-command
(format "%s %s -l %s \"(%scd %s; %s)\""
remote-shell-program
diff --git a/lisp/obsolete/s-region.el b/lisp/obsolete/s-region.el
index bcb5279d115b..4d4c39e9b112 100644
--- a/lisp/obsolete/s-region.el
+++ b/lisp/obsolete/s-region.el
@@ -1,4 +1,4 @@
-;;; s-region.el --- set region using shift key
+;;; s-region.el --- set region using shift key -*- lexical-binding: t; -*-
;; Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc.
@@ -112,11 +112,11 @@ to global keymap."
[M-next] [M-previous] [M-home] [M-end]))
(or (global-key-binding [C-insert])
- (global-set-key [C-insert] 'copy-region-as-kill))
+ (global-set-key [C-insert] #'copy-region-as-kill))
(or (global-key-binding [S-delete])
- (global-set-key [S-delete] 'kill-region))
+ (global-set-key [S-delete] #'kill-region))
(or (global-key-binding [S-insert])
- (global-set-key [S-insert] 'yank))
+ (global-set-key [S-insert] #'yank))
(provide 's-region)
diff --git a/lisp/obsolete/sb-image.el b/lisp/obsolete/sb-image.el
index 53ecfb7f2681..e9a507f0086c 100644
--- a/lisp/obsolete/sb-image.el
+++ b/lisp/obsolete/sb-image.el
@@ -1,4 +1,4 @@
-;;; sb-image --- Image management for speedbar
+;;; sb-image --- Image management for speedbar -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2003, 2005-2019, 2021 Free Software Foundation,
;; Inc.
diff --git a/lisp/obsolete/sregex.el b/lisp/obsolete/sregex.el
index ac5f62dd67ed..96d6b7aebf06 100644
--- a/lisp/obsolete/sregex.el
+++ b/lisp/obsolete/sregex.el
@@ -1,4 +1,4 @@
-;;; sregex.el --- symbolic regular expressions
+;;; sregex.el --- symbolic regular expressions -*- lexical-binding: t; -*-
;; Copyright (C) 1997-1998, 2000-2021 Free Software Foundation, Inc.
@@ -246,15 +246,15 @@
(defvar sregex--current-sregex nil)
(defun sregex-info () nil)
(defmacro sregex-save-match-data (&rest forms) (cons 'save-match-data forms))
-(defun sregex-replace-match (r &optional f l str subexp x)
+(defun sregex-replace-match (r &optional f l str subexp _x)
(replace-match r f l str subexp))
-(defun sregex-match-string (c &optional i x) (match-string c i))
-(defun sregex-match-string-no-properties (count &optional in-string sregex)
+(defun sregex-match-string (c &optional i _x) (match-string c i))
+(defun sregex-match-string-no-properties (count &optional in-string _sregex)
(match-string-no-properties count in-string))
-(defun sregex-match-beginning (count &optional sregex) (match-beginning count))
-(defun sregex-match-end (count &optional sregex) (match-end count))
-(defun sregex-match-data (&optional sregex) (match-data))
-(defun sregex-backref-num (n &optional sregex) n)
+(defun sregex-match-beginning (count &optional _sregex) (match-beginning count))
+(defun sregex-match-end (count &optional _sregex) (match-end count))
+(defun sregex-match-data (&optional _sregex) (match-data))
+(defun sregex-backref-num (n &optional _sregex) n)
(defun sregex (&rest exps)
@@ -525,23 +525,23 @@ has one of the following forms:
(concat "\\(?:" re "\\)")
re))))
-(defun sregex--group (exps combine) (concat "\\(" (sregex--sequence exps nil) "\\)"))
+(defun sregex--group (exps _combine) (concat "\\(" (sregex--sequence exps nil) "\\)"))
-(defun sregex--backref (exps combine) (concat "\\" (int-to-string (car exps))))
-(defun sregex--opt (exps combine) (concat (sregex--sequence exps 'suffix) "?"))
-(defun sregex--0+ (exps combine) (concat (sregex--sequence exps 'suffix) "*"))
-(defun sregex--1+ (exps combine) (concat (sregex--sequence exps 'suffix) "+"))
+(defun sregex--backref (exps _combine) (concat "\\" (int-to-string (car exps))))
+(defun sregex--opt (exps _combine) (concat (sregex--sequence exps 'suffix) "?"))
+(defun sregex--0+ (exps _combine) (concat (sregex--sequence exps 'suffix) "*"))
+(defun sregex--1+ (exps _combine) (concat (sregex--sequence exps 'suffix) "+"))
-(defun sregex--char (exps combine) (sregex--char-aux nil exps))
-(defun sregex--not-char (exps combine) (sregex--char-aux t exps))
+(defun sregex--char (exps _combine) (sregex--char-aux nil exps))
+(defun sregex--not-char (exps _combine) (sregex--char-aux t exps))
-(defun sregex--syntax (exps combine) (format "\\s%c" (car exps)))
-(defun sregex--not-syntax (exps combine) (format "\\S%c" (car exps)))
+(defun sregex--syntax (exps _combine) (format "\\s%c" (car exps)))
+(defun sregex--not-syntax (exps _combine) (format "\\S%c" (car exps)))
(defun sregex--regex (exps combine)
(if combine (concat "\\(?:" (car exps) "\\)") (car exps)))
-(defun sregex--repeat (exps combine)
+(defun sregex--repeat (exps _combine)
(let* ((min (or (pop exps) 0))
(minstr (number-to-string min))
(max (pop exps)))
diff --git a/lisp/obsolete/starttls.el b/lisp/obsolete/starttls.el
index 451c7eb2ffc5..0ca486324fd6 100644
--- a/lisp/obsolete/starttls.el
+++ b/lisp/obsolete/starttls.el
@@ -1,4 +1,4 @@
-;;; starttls.el --- STARTTLS functions
+;;; starttls.el --- STARTTLS functions -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
@@ -126,28 +126,24 @@
This program is used when GnuTLS is used, i.e. when
`starttls-use-gnutls' is non-nil."
:version "22.1"
- :type 'string
- :group 'starttls)
+ :type 'string)
(defcustom starttls-program "starttls"
"The program to run in a subprocess to open an TLSv1 connection.
This program is used when the `starttls' command is used,
i.e. when `starttls-use-gnutls' is nil."
- :type 'string
- :group 'starttls)
+ :type 'string)
(defcustom starttls-use-gnutls (not (executable-find starttls-program))
"Whether to use GnuTLS instead of the `starttls' command."
:version "22.1"
- :type 'boolean
- :group 'starttls)
+ :type 'boolean)
(defcustom starttls-extra-args nil
"Extra arguments to `starttls-program'.
These apply when the `starttls' command is used, i.e. when
`starttls-use-gnutls' is nil."
- :type '(repeat string)
- :group 'starttls)
+ :type '(repeat string))
(defcustom starttls-extra-arguments nil
"Extra arguments to `starttls-gnutls-program'.
@@ -157,14 +153,12 @@ For example, non-TLS compliant servers may require
\(\"--protocols\" \"ssl3\"). Invoke \"gnutls-cli --help\" to
find out which parameters are available."
:version "22.1"
- :type '(repeat string)
- :group 'starttls)
+ :type '(repeat string))
(defcustom starttls-process-connection-type nil
"Value for `process-connection-type' to use when starting STARTTLS process."
:version "22.1"
- :type 'boolean
- :group 'starttls)
+ :type 'boolean)
(defcustom starttls-connect "- Simple Client Mode:\n\n"
"Regular expression indicating successful connection.
@@ -173,8 +167,7 @@ The default is what GnuTLS's \"gnutls-cli\" outputs."
;; in the application read/write phase. If the logic, or the string
;; itself, is modified, this must be updated.
:version "22.1"
- :type 'regexp
- :group 'starttls)
+ :type 'regexp)
(defcustom starttls-failure "\\*\\*\\* Handshake has failed"
"Regular expression indicating failed TLS handshake.
@@ -182,8 +175,7 @@ The default is what GnuTLS's \"gnutls-cli\" outputs."
;; GnuTLS cli.c:do_handshake() prints this string on failure. If the
;; logic, or the string itself, is modified, this must be updated.
:version "22.1"
- :type 'regexp
- :group 'starttls)
+ :type 'regexp)
(defcustom starttls-success "- Compression: "
"Regular expression indicating completed TLS handshakes.
@@ -193,8 +185,7 @@ The default is what GnuTLS's \"gnutls-cli\" outputs."
;; last. If that logic, or the string itself, is modified, this
;; must be updated.
:version "22.1"
- :type 'regexp
- :group 'starttls)
+ :type 'regexp)
(defun starttls-negotiate-gnutls (process)
"Negotiate TLS on PROCESS opened by `open-starttls-stream'.
@@ -296,9 +287,8 @@ GnuTLS requires a port number."
starttls-gnutls-program
starttls-program))))
-(defalias 'starttls-any-program-available 'starttls-available-p)
-(make-obsolete 'starttls-any-program-available 'starttls-available-p
- "2011-08-02")
+(define-obsolete-function-alias 'starttls-any-program-available
+ #'starttls-available-p "2011-08-02")
(provide 'starttls)
diff --git a/lisp/obsolete/sup-mouse.el b/lisp/obsolete/sup-mouse.el
index f3db27f567ed..4e312e968b31 100644
--- a/lisp/obsolete/sup-mouse.el
+++ b/lisp/obsolete/sup-mouse.el
@@ -1,4 +1,4 @@
-;;; sup-mouse.el --- supdup mouse support for lisp machines
+;;; sup-mouse.el --- supdup mouse support for lisp machines -*- lexical-binding: t; -*-
;; Copyright (C) 1985-1986, 2001-2021 Free Software Foundation, Inc.
diff --git a/lisp/obsolete/terminal.el b/lisp/obsolete/terminal.el
index bde656dfa6a2..d28c4a172fda 100644
--- a/lisp/obsolete/terminal.el
+++ b/lisp/obsolete/terminal.el
@@ -1,4 +1,4 @@
-;;; terminal.el --- terminal emulator for GNU Emacs
+;;; terminal.el --- terminal emulator for GNU Emacs -*- lexical-binding: t; -*-
;; Copyright (C) 1986-1989, 1993-1994, 2001-2021 Free Software
;; Foundation, Inc.
@@ -58,22 +58,19 @@ to the emulator program itself. Type this character twice to send
it through the emulator. Type ? after typing it for a list of
possible commands.
This variable is local to each terminal-emulator buffer."
- :type 'character
- :group 'terminal)
+ :type 'character)
(defcustom terminal-scrolling t ;;>> Setting this to t sort-of defeats my whole aim in writing this package...
"If non-nil, the terminal-emulator will losingly `scroll' when output occurs
past the bottom of the screen. If nil, output will win and `wrap' to the top
of the screen.
This variable is local to each terminal-emulator buffer."
- :type 'boolean
- :group 'terminal)
+ :type 'boolean)
(defcustom terminal-more-processing t
"If non-nil, do more-processing.
This variable is local to each terminal-emulator buffer."
- :type 'boolean
- :group 'terminal)
+ :type 'boolean)
;; If you are the sort of loser who uses scrolling without more breaks
;; and expects to actually see anything, you should probably set this to
@@ -84,8 +81,7 @@ terminal-emulator before a screen redisplay is forced.
Set this to a large value for greater throughput,
set it smaller for more frequent updates but overall slower
performance."
- :type 'integer
- :group 'terminal)
+ :type 'integer)
(defvar terminal-more-break-insertion
"*** More break -- Press space to continue ***")
@@ -94,7 +90,7 @@ performance."
(if terminal-meta-map
nil
(let ((map (make-sparse-keymap)))
- (define-key map [t] 'te-pass-through)
+ (define-key map [t] #'te-pass-through)
(setq terminal-meta-map map)))
(defvar terminal-map nil)
@@ -104,8 +100,8 @@ performance."
;; Prevent defining [menu-bar] as te-pass-through
;; so we allow the global menu bar to be visible.
(define-key map [menu-bar] (make-sparse-keymap))
- (define-key map [t] 'te-pass-through)
- (define-key map [switch-frame] 'handle-switch-frame)
+ (define-key map [t] #'te-pass-through)
+ (define-key map [switch-frame] #'handle-switch-frame)
(define-key map "\e" terminal-meta-map)
;;(define-key map "\C-l"
;; (lambda () (interactive) (te-pass-through) (redraw-display)))
@@ -115,22 +111,22 @@ performance."
(if terminal-escape-map
nil
(let ((map (make-sparse-keymap)))
- (define-key map [t] 'undefined)
+ (define-key map [t] #'undefined)
(let ((s "0"))
(while (<= (aref s 0) ?9)
- (define-key map s 'digit-argument)
+ (define-key map s #'digit-argument)
(aset s 0 (1+ (aref s 0)))))
- (define-key map "b" 'switch-to-buffer)
- (define-key map "o" 'other-window)
- (define-key map "e" 'te-set-escape-char)
- (define-key map "\C-l" 'redraw-display)
- (define-key map "\C-o" 'te-flush-pending-output)
- (define-key map "m" 'te-toggle-more-processing)
- (define-key map "x" 'te-escape-extended-command)
+ (define-key map "b" #'switch-to-buffer)
+ (define-key map "o" #'other-window)
+ (define-key map "e" #'te-set-escape-char)
+ (define-key map "\C-l" #'redraw-display)
+ (define-key map "\C-o" #'te-flush-pending-output)
+ (define-key map "m" #'te-toggle-more-processing)
+ (define-key map "x" #'te-escape-extended-command)
;;>> What use is this? Why is it in the default terminal-emulator map?
- (define-key map "w" 'te-edit)
- (define-key map "?" 'te-escape-help)
- (define-key map (char-to-string help-char) 'te-escape-help)
+ (define-key map "w" #'te-edit)
+ (define-key map "?" #'te-escape-help)
+ (define-key map (char-to-string help-char) #'te-escape-help)
(setq terminal-escape-map map)))
(defvar te-escape-command-alist nil)
@@ -161,14 +157,14 @@ performance."
(if terminal-more-break-map
nil
(let ((map (make-sparse-keymap)))
- (define-key map [t] 'te-more-break-unread)
- (define-key map (char-to-string help-char) 'te-more-break-help)
- (define-key map " " 'te-more-break-resume)
- (define-key map "\C-l" 'redraw-display)
- (define-key map "\C-o" 'te-more-break-flush-pending-output)
+ (define-key map [t] #'te-more-break-unread)
+ (define-key map (char-to-string help-char) #'te-more-break-help)
+ (define-key map " " #'te-more-break-resume)
+ (define-key map "\C-l" #'redraw-display)
+ (define-key map "\C-o" #'te-more-break-flush-pending-output)
;;>>> this isn't right
- ;(define-key map "\^?" 'te-more-break-flush-pending-output) ;DEL
- (define-key map "\r" 'te-more-break-advance-one-line)
+ ;(define-key map "\^?" #'te-more-break-flush-pending-output) ;DEL
+ (define-key map "\r" #'te-more-break-advance-one-line)
(setq terminal-more-break-map map)))
@@ -525,7 +521,7 @@ lets you type a terminal emulator command."
(if terminal-edit-map
nil
(setq terminal-edit-map (make-sparse-keymap))
- (define-key terminal-edit-map "\C-c\C-c" 'terminal-cease-edit))
+ (define-key terminal-edit-map "\C-c\C-c" #'terminal-cease-edit))
;; Terminal Edit mode is suitable only for specially formatted data.
(put 'terminal-edit-mode 'mode-class 'special)
@@ -1140,10 +1136,10 @@ subprocess started."
;; Then finally start the program we wanted.
(format "%s; exec %s"
te-stty-string
- (mapconcat 'te-quote-arg-for-sh
+ (mapconcat #'te-quote-arg-for-sh
(cons program args) " "))))
- (set-process-filter te-process 'te-filter)
- (set-process-sentinel te-process 'te-sentinel))
+ (set-process-filter te-process #'te-filter)
+ (set-process-sentinel te-process #'te-sentinel))
(error (fundamental-mode)
(signal (car err) (cdr err))))
(setq inhibit-quit t) ;sport death
@@ -1151,8 +1147,8 @@ subprocess started."
(run-hooks 'terminal-mode-hook)
(message "Entering Emacs terminal-emulator... Type %s %s for help"
(single-key-description terminal-escape-char)
- (mapconcat 'single-key-description
- (where-is-internal 'te-escape-help terminal-escape-map t)
+ (mapconcat #'single-key-description
+ (where-is-internal #'te-escape-help terminal-escape-map t)
" ")))
@@ -1292,7 +1288,7 @@ in the directory specified by `te-terminfo-directory'."
(directory-file-name te-terminfo-directory))
process-environment)))
(set-process-sentinel (start-process "tic" nil "tic" file-name)
- 'te-tic-sentinel))))
+ #'te-tic-sentinel))))
(directory-file-name te-terminfo-directory))
(defun te-create-termcap ()
diff --git a/lisp/obsolete/tls.el b/lisp/obsolete/tls.el
index 67a497f94125..5cba18d7897f 100644
--- a/lisp/obsolete/tls.el
+++ b/lisp/obsolete/tls.el
@@ -1,4 +1,4 @@
-;;; tls.el --- TLS/SSL support via wrapper around GnuTLS
+;;; tls.el --- TLS/SSL support via wrapper around GnuTLS -*- lexical-binding: t; -*-
;; Copyright (C) 1996-1999, 2002-2021 Free Software Foundation, Inc.
@@ -70,8 +70,7 @@
Client data stream begins after the last character this matches.
The default matches the output of \"gnutls-cli\" (version 2.0.1)."
:version "22.2"
- :type 'regexp
- :group 'tls)
+ :type 'regexp)
(defcustom tls-program
'("gnutls-cli --x509cafile %t -p %p %h"
@@ -104,22 +103,19 @@ successful negotiation."
(repeat :inline t :tag "Other" (string)))
(list :tag "List of commands"
(repeat :tag "Command" (string))))
- :version "26.1" ; remove s_client
- :group 'tls)
+ :version "26.1")
(defcustom tls-process-connection-type nil
"Value for `process-connection-type' to use when starting TLS process."
:version "22.1"
- :type 'boolean
- :group 'tls)
+ :type 'boolean)
(defcustom tls-success "- Handshake was completed\\|SSL handshake has read "
"Regular expression indicating completed TLS handshakes.
The default is what GnuTLS's \"gnutls-cli\" outputs."
;; or OpenSSL's \"openssl s_client\"
:version "22.1"
- :type 'regexp
- :group 'tls)
+ :type 'regexp)
(defcustom tls-checktrust nil
"Indicate if certificates should be checked against trusted root certs.
@@ -137,8 +133,7 @@ consider trustworthy, e.g.:
:type '(choice (const :tag "Always" t)
(const :tag "Never" nil)
(const :tag "Ask" ask))
- :version "23.1" ;; No Gnus
- :group 'tls)
+ :version "23.1")
(defcustom tls-untrusted
"- Peer's certificate is NOT trusted\\|Verify return code: \\([^0] \\|.[^ ]\\)"
@@ -147,8 +142,7 @@ The default is what GnuTLS's \"gnutls-cli\" returns in the event of
unsuccessful verification."
;; or OpenSSL's \"openssl s_client\"
:type 'regexp
- :version "23.1" ;; No Gnus
- :group 'tls)
+ :version "23.1")
(defcustom tls-hostmismatch
"# The hostname in the certificate does NOT match"
@@ -158,20 +152,13 @@ name of the host you are connecting to, gnutls-cli issues a
warning to this effect. There is no such feature in openssl. Set
this to nil if you want to ignore host name mismatches."
:type 'regexp
- :version "23.1" ;; No Gnus
- :group 'tls)
+ :version "23.1")
(defcustom tls-certtool-program "certtool"
"Name of GnuTLS certtool.
Used by `tls-certificate-information'."
:version "22.1"
- :type 'string
- :group 'tls)
-
-(defalias 'tls-format-message
- (if (fboundp 'format-message) 'format-message
- ;; for Emacs < 25, and XEmacs, don't worry about quote translation.
- 'format))
+ :type 'string)
(defun tls-certificate-information (der)
"Parse X.509 certificate in DER format into an assoc list."
@@ -272,7 +259,7 @@ Fourth arg PORT is an integer specifying a port to connect to."
(message "The certificate presented by `%s' is \
NOT trusted." host))
(not (yes-or-no-p
- (tls-format-message "\
+ (format-message "\
The certificate presented by `%s' is NOT trusted. Accept anyway? " host)))))
(and tls-hostmismatch
(save-excursion
diff --git a/lisp/obsolete/tpu-edt.el b/lisp/obsolete/tpu-edt.el
index 78d88cf3774a..1340618f055c 100644
--- a/lisp/obsolete/tpu-edt.el
+++ b/lisp/obsolete/tpu-edt.el
@@ -1,4 +1,4 @@
-;;; tpu-edt.el --- Emacs emulating TPU emulating EDT
+;;; tpu-edt.el --- Emacs emulating TPU emulating EDT -*- lexical-binding: t; -*-
;; Copyright (C) 1993-1995, 2000-2021 Free Software Foundation, Inc.
@@ -289,18 +289,15 @@
;;;
(defcustom tpu-kill-buffers-silently nil
"If non-nil, TPU-edt kills modified buffers without asking."
- :type 'boolean
- :group 'tpu)
+ :type 'boolean)
(defcustom tpu-percent-scroll 75
"Percentage of the screen to scroll for next/previous screen commands."
- :type 'integer
- :group 'tpu)
+ :type 'integer)
(defcustom tpu-pan-columns 16
"Number of columns the tpu-pan functions scroll left or right."
- :type 'integer
- :group 'tpu)
+ :type 'integer)
;;;
@@ -313,17 +310,17 @@
;; that term/*.el does its job to map the escape sequence to the right
;; key-symbol.
- (define-key map [up] 'tpu-move-to-beginning) ; up-arrow
- (define-key map [down] 'tpu-move-to-end) ; down-arrow
- (define-key map [right] 'end-of-line) ; right-arrow
- (define-key map [left] 'beginning-of-line) ; left-arrow
+ (define-key map [up] #'tpu-move-to-beginning) ; up-arrow
+ (define-key map [down] #'tpu-move-to-end) ; down-arrow
+ (define-key map [right] #'end-of-line) ; right-arrow
+ (define-key map [left] #'beginning-of-line) ; left-arrow
;; (define-key map [find] nil) ; Find
;; (define-key map [insert] nil) ; Insert Here
- (define-key map [delete] 'tpu-store-text) ; Remove
- (define-key map [select] 'tpu-unselect) ; Select
- (define-key map [prior] 'tpu-previous-window) ; Prev Screen
- (define-key map [next] 'tpu-next-window) ; Next Screen
+ (define-key map [delete] #'tpu-store-text) ; Remove
+ (define-key map [select] #'tpu-unselect) ; Select
+ (define-key map [prior] #'tpu-previous-window) ; Prev Screen
+ (define-key map [next] #'tpu-next-window) ; Next Screen
;; (define-key map [f1] nil) ; F1
;; (define-key map [f2] nil) ; F2
@@ -339,45 +336,45 @@
;; (define-key map [f12] nil) ; F12
;; (define-key map [f13] nil) ; F13
;; (define-key map [f14] nil) ; F14
- (define-key map [help] 'describe-bindings) ; HELP
+ (define-key map [help] #'describe-bindings) ; HELP
;; (define-key map [menu] nil) ; DO
- (define-key map [f17] 'tpu-drop-breadcrumb) ; F17
+ (define-key map [f17] #'tpu-drop-breadcrumb) ; F17
;; (define-key map [f18] nil) ; F18
;; (define-key map [f19] nil) ; F19
;; (define-key map [f20] nil) ; F20
- (define-key map [kp-f1] 'keyboard-quit) ; PF1
- (define-key map [kp-f2] 'help-for-help) ; PF2
- (define-key map [kp-f3] 'tpu-search) ; PF3
- (define-key map [kp-f4] 'tpu-undelete-lines) ; PF4
- (define-key map [kp-0] 'open-line) ; KP0
- (define-key map [kp-1] 'tpu-change-case) ; KP1
- (define-key map [kp-2] 'tpu-delete-to-eol) ; KP2
- (define-key map [kp-3] 'tpu-special-insert) ; KP3
- (define-key map [kp-4] 'tpu-move-to-end) ; KP4
- (define-key map [kp-5] 'tpu-move-to-beginning) ; KP5
- (define-key map [kp-6] 'tpu-paste) ; KP6
- (define-key map [kp-7] 'execute-extended-command) ; KP7
- (define-key map [kp-8] 'tpu-fill) ; KP8
- (define-key map [kp-9] 'tpu-replace) ; KP9
- (define-key map [kp-subtract] 'tpu-undelete-words) ; KP-
- (define-key map [kp-separator] 'tpu-undelete-char) ; KP,
- (define-key map [kp-decimal] 'tpu-unselect) ; KP.
- (define-key map [kp-enter] 'tpu-substitute) ; KPenter
+ (define-key map [kp-f1] #'keyboard-quit) ; PF1
+ (define-key map [kp-f2] #'help-for-help) ; PF2
+ (define-key map [kp-f3] #'tpu-search) ; PF3
+ (define-key map [kp-f4] #'tpu-undelete-lines) ; PF4
+ (define-key map [kp-0] #'open-line) ; KP0
+ (define-key map [kp-1] #'tpu-change-case) ; KP1
+ (define-key map [kp-2] #'tpu-delete-to-eol) ; KP2
+ (define-key map [kp-3] #'tpu-special-insert) ; KP3
+ (define-key map [kp-4] #'tpu-move-to-end) ; KP4
+ (define-key map [kp-5] #'tpu-move-to-beginning) ; KP5
+ (define-key map [kp-6] #'tpu-paste) ; KP6
+ (define-key map [kp-7] #'execute-extended-command) ; KP7
+ (define-key map [kp-8] #'tpu-fill) ; KP8
+ (define-key map [kp-9] #'tpu-replace) ; KP9
+ (define-key map [kp-subtract] #'tpu-undelete-words) ; KP-
+ (define-key map [kp-separator] #'tpu-undelete-char) ; KP,
+ (define-key map [kp-decimal] #'tpu-unselect) ; KP.
+ (define-key map [kp-enter] #'tpu-substitute) ; KPenter
;;
- (define-key map "\C-A" 'tpu-toggle-overwrite-mode) ; ^A
+ (define-key map "\C-A" #'tpu-toggle-overwrite-mode) ; ^A
;; (define-key map "\C-B" nil) ; ^B
;; (define-key map "\C-C" nil) ; ^C
;; (define-key map "\C-D" nil) ; ^D
;; (define-key map "\C-E" nil) ; ^E
- (define-key map "\C-F" 'set-visited-file-name) ; ^F
- (define-key map "\C-g" 'keyboard-quit) ; safety first
- (define-key map "\C-h" 'delete-other-windows) ; BS
- (define-key map "\C-i" 'other-window) ; TAB
+ (define-key map "\C-F" #'set-visited-file-name) ; ^F
+ (define-key map "\C-g" #'keyboard-quit) ; safety first
+ (define-key map "\C-h" #'delete-other-windows) ; BS
+ (define-key map "\C-i" #'other-window) ; TAB
;; (define-key map "\C-J" nil) ; ^J
- (define-key map "\C-K" 'tpu-define-macro-key) ; ^K
- (define-key map "\C-l" 'downcase-region) ; ^L
+ (define-key map "\C-K" #'tpu-define-macro-key) ; ^K
+ (define-key map "\C-l" #'downcase-region) ; ^L
;; (define-key map "\C-M" nil) ; ^M
;; (define-key map "\C-N" nil) ; ^N
;; (define-key map "\C-O" nil) ; ^O
@@ -385,104 +382,104 @@
;; (define-key map "\C-Q" nil) ; ^Q
;; (define-key map "\C-R" nil) ; ^R
;; (define-key map "\C-S" nil) ; ^S
- (define-key map "\C-T" 'tpu-toggle-control-keys) ; ^T
- (define-key map "\C-u" 'upcase-region) ; ^U
+ (define-key map "\C-T" #'tpu-toggle-control-keys) ; ^T
+ (define-key map "\C-u" #'upcase-region) ; ^U
;; (define-key map "\C-V" nil) ; ^V
- (define-key map "\C-w" 'tpu-write-current-buffers) ; ^W
+ (define-key map "\C-w" #'tpu-write-current-buffers) ; ^W
;; (define-key map "\C-X" nil) ; ^X
;; (define-key map "\C-Y" nil) ; ^Y
;; (define-key map "\C-Z" nil) ; ^Z
- (define-key map " " 'undo) ; SPC
+ (define-key map " " #'undo) ; SPC
;; (define-key map "!" nil) ; !
;; (define-key map "#" nil) ; #
- (define-key map "$" 'tpu-add-at-eol) ; $
- (define-key map "%" 'tpu-goto-percent) ; %
+ (define-key map "$" #'tpu-add-at-eol) ; $
+ (define-key map "%" #'tpu-goto-percent) ; %
;; (define-key map "&" nil) ; &
;; (define-key map "(" nil) ; (
;; (define-key map ")" nil) ; )
- (define-key map "*" 'tpu-toggle-regexp) ; *
+ (define-key map "*" #'tpu-toggle-regexp) ; *
;; (define-key map "+" nil) ; +
- (define-key map "," 'tpu-goto-breadcrumb) ; ,
- (define-key map "-" 'negative-argument) ; -
- (define-key map "." 'tpu-drop-breadcrumb) ; .
- (define-key map "/" 'tpu-emacs-replace) ; /
- (define-key map "0" 'digit-argument) ; 0
- (define-key map "1" 'digit-argument) ; 1
- (define-key map "2" 'digit-argument) ; 2
- (define-key map "3" 'digit-argument) ; 3
- (define-key map "4" 'digit-argument) ; 4
- (define-key map "5" 'digit-argument) ; 5
- (define-key map "6" 'digit-argument) ; 6
- (define-key map "7" 'digit-argument) ; 7
- (define-key map "8" 'digit-argument) ; 8
- (define-key map "9" 'digit-argument) ; 9
+ (define-key map "," #'tpu-goto-breadcrumb) ; ,
+ (define-key map "-" #'negative-argument) ; -
+ (define-key map "." #'tpu-drop-breadcrumb) ; .
+ (define-key map "/" #'tpu-emacs-replace) ; /
+ (define-key map "0" #'digit-argument) ; 0
+ (define-key map "1" #'digit-argument) ; 1
+ (define-key map "2" #'digit-argument) ; 2
+ (define-key map "3" #'digit-argument) ; 3
+ (define-key map "4" #'digit-argument) ; 4
+ (define-key map "5" #'digit-argument) ; 5
+ (define-key map "6" #'digit-argument) ; 6
+ (define-key map "7" #'digit-argument) ; 7
+ (define-key map "8" #'digit-argument) ; 8
+ (define-key map "9" #'digit-argument) ; 9
;; (define-key map ":" nil) ; :
- (define-key map ";" 'tpu-trim-line-ends) ; ;
+ (define-key map ";" #'tpu-trim-line-ends) ; ;
;; (define-key map "<" nil) ; <
;; (define-key map "=" nil) ; =
;; (define-key map ">" nil) ; >
- (define-key map "?" 'tpu-spell-check) ; ?
- ;; (define-key map "A" 'tpu-toggle-newline-and-indent) ; A
- ;; (define-key map "B" 'tpu-next-buffer) ; B
- ;; (define-key map "C" 'repeat-complex-command) ; C
- ;; (define-key map "D" 'shell-command) ; D
- ;; (define-key map "E" 'tpu-exit) ; E
- ;; (define-key map "F" 'tpu-cursor-free-mode) ; F
- ;; (define-key map "G" 'tpu-get) ; G
+ (define-key map "?" #'tpu-spell-check) ; ?
+ ;; (define-key map "A" #'tpu-toggle-newline-and-indent) ; A
+ ;; (define-key map "B" #'tpu-next-buffer) ; B
+ ;; (define-key map "C" #'repeat-complex-command) ; C
+ ;; (define-key map "D" #'shell-command) ; D
+ ;; (define-key map "E" #'tpu-exit) ; E
+ ;; (define-key map "F" #'tpu-cursor-free-mode) ; F
+ ;; (define-key map "G" #'tpu-get) ; G
;; (define-key map "H" nil) ; H
- ;; (define-key map "I" 'tpu-include) ; I
- ;; (define-key map "K" 'tpu-kill-buffer) ; K
- (define-key map "L" 'tpu-what-line) ; L
- ;; (define-key map "M" 'buffer-menu) ; M
- ;; (define-key map "N" 'tpu-next-file-buffer) ; N
- ;; (define-key map "O" 'occur) ; O
- (define-key map "P" 'lpr-buffer) ; P
- ;; (define-key map "Q" 'tpu-quit) ; Q
- ;; (define-key map "R" 'tpu-toggle-rectangle) ; R
- ;; (define-key map "S" 'replace) ; S
- ;; (define-key map "T" 'tpu-line-to-top-of-window) ; T
- ;; (define-key map "U" 'undo) ; U
- ;; (define-key map "V" 'tpu-version) ; V
- ;; (define-key map "W" 'save-buffer) ; W
- ;; (define-key map "X" 'tpu-save-all-buffers-kill-emacs) ; X
- ;; (define-key map "Y" 'copy-region-as-kill) ; Y
- ;; (define-key map "Z" 'suspend-emacs) ; Z
- (define-key map "[" 'blink-matching-open) ; [
+ ;; (define-key map "I" #'tpu-include) ; I
+ ;; (define-key map "K" #'tpu-kill-buffer) ; K
+ (define-key map "L" #'tpu-what-line) ; L
+ ;; (define-key map "M" #'buffer-menu) ; M
+ ;; (define-key map "N" #'tpu-next-file-buffer) ; N
+ ;; (define-key map "O" #'occur) ; O
+ (define-key map "P" #'lpr-buffer) ; P
+ ;; (define-key map "Q" #'tpu-quit) ; Q
+ ;; (define-key map "R" #'tpu-toggle-rectangle) ; R
+ ;; (define-key map "S" #'replace) ; S
+ ;; (define-key map "T" #'tpu-line-to-top-of-window) ; T
+ ;; (define-key map "U" #'undo) ; U
+ ;; (define-key map "V" #'tpu-version) ; V
+ ;; (define-key map "W" #'save-buffer) ; W
+ ;; (define-key map "X" #'tpu-save-all-buffers-kill-emacs) ; X
+ ;; (define-key map "Y" #'copy-region-as-kill) ; Y
+ ;; (define-key map "Z" #'suspend-emacs) ; Z
+ (define-key map "[" #'blink-matching-open) ; [
;; (define-key map "\\" nil) ; \
- (define-key map "]" 'blink-matching-open) ; ]
- (define-key map "^" 'tpu-add-at-bol) ; ^
- (define-key map "_" 'split-window-below) ; -
- (define-key map "`" 'what-line) ; `
- (define-key map "a" 'tpu-toggle-newline-and-indent) ; a
- (define-key map "b" 'tpu-next-buffer) ; b
- (define-key map "c" 'repeat-complex-command) ; c
- (define-key map "d" 'shell-command) ; d
- (define-key map "e" 'tpu-exit) ; e
- (define-key map "f" 'tpu-cursor-free-mode) ; f
- (define-key map "g" 'tpu-get) ; g
+ (define-key map "]" #'blink-matching-open) ; ]
+ (define-key map "^" #'tpu-add-at-bol) ; ^
+ (define-key map "_" #'split-window-below) ; -
+ (define-key map "`" #'what-line) ; `
+ (define-key map "a" #'tpu-toggle-newline-and-indent) ; a
+ (define-key map "b" #'tpu-next-buffer) ; b
+ (define-key map "c" #'repeat-complex-command) ; c
+ (define-key map "d" #'shell-command) ; d
+ (define-key map "e" #'tpu-exit) ; e
+ (define-key map "f" #'tpu-cursor-free-mode) ; f
+ (define-key map "g" #'tpu-get) ; g
;; (define-key map "h" nil) ; h
- (define-key map "i" 'tpu-include) ; i
- (define-key map "k" 'tpu-kill-buffer) ; k
- (define-key map "l" 'goto-line) ; l
- (define-key map "m" 'buffer-menu) ; m
- (define-key map "n" 'tpu-next-file-buffer) ; n
- (define-key map "o" 'occur) ; o
- (define-key map "p" 'lpr-region) ; p
- (define-key map "q" 'tpu-quit) ; q
- (define-key map "r" 'tpu-toggle-rectangle) ; r
- (define-key map "s" 'replace) ; s
- (define-key map "t" 'tpu-line-to-top-of-window) ; t
- (define-key map "u" 'undo) ; u
- (define-key map "v" 'tpu-version) ; v
- (define-key map "w" 'save-buffer) ; w
- (define-key map "x" 'tpu-save-all-buffers-kill-emacs) ; x
- (define-key map "y" 'copy-region-as-kill) ; y
- (define-key map "z" 'suspend-emacs) ; z
+ (define-key map "i" #'tpu-include) ; i
+ (define-key map "k" #'tpu-kill-buffer) ; k
+ (define-key map "l" #'goto-line) ; l
+ (define-key map "m" #'buffer-menu) ; m
+ (define-key map "n" #'tpu-next-file-buffer) ; n
+ (define-key map "o" #'occur) ; o
+ (define-key map "p" #'lpr-region) ; p
+ (define-key map "q" #'tpu-quit) ; q
+ (define-key map "r" #'tpu-toggle-rectangle) ; r
+ (define-key map "s" #'replace) ; s
+ (define-key map "t" #'tpu-line-to-top-of-window) ; t
+ (define-key map "u" #'undo) ; u
+ (define-key map "v" #'tpu-version) ; v
+ (define-key map "w" #'save-buffer) ; w
+ (define-key map "x" #'tpu-save-all-buffers-kill-emacs) ; x
+ (define-key map "y" #'copy-region-as-kill) ; y
+ (define-key map "z" #'suspend-emacs) ; z
;; (define-key map "{" nil) ; {
- (define-key map "|" 'split-window-right) ; |
+ (define-key map "|" #'split-window-right) ; |
;; (define-key map "}" nil) ; }
- (define-key map "~" 'exchange-point-and-mark) ; ~
- (define-key map "\177" 'delete-window) ; OP.")
@@ -492,12 +489,12 @@ GOLD is the ASCII 7-bit escape sequence OP.")
;; Previously defined in CSI-map. We now presume that term/*.el does
;; its job to map the escape sequence to the right key-symbol.
- (define-key map [find] 'tpu-search) ; Find
- (define-key map [insert] 'tpu-paste) ; Insert Here
- (define-key map [delete] 'tpu-cut) ; Remove
- (define-key map [select] 'tpu-select) ; Select
- (define-key map [prior] 'tpu-scroll-window-down) ; Prev Screen
- (define-key map [next] 'tpu-scroll-window-up) ; Next Screen
+ (define-key map [find] #'tpu-search) ; Find
+ (define-key map [insert] #'tpu-paste) ; Insert Here
+ (define-key map [delete] #'tpu-cut) ; Remove
+ (define-key map [select] #'tpu-select) ; Select
+ (define-key map [prior] #'tpu-scroll-window-down) ; Prev Screen
+ (define-key map [next] #'tpu-scroll-window-up) ; Next Screen
;; (define-key map [f1] nil) ; F1
;; (define-key map [f2] nil) ; F2
@@ -508,14 +505,14 @@ GOLD is the ASCII 7-bit escape sequence OP.")
;; (define-key map [f7] nil) ; F7
;; (define-key map [f8] nil) ; F8
;; (define-key map [f9] nil) ; F9
- (define-key map [f10] 'tpu-exit) ; F10
- (define-key map [f11] 'tpu-insert-escape) ; F11 (ESC)
- (define-key map [f12] 'tpu-next-beginning-of-line) ; F12 (BS)
- (define-key map [f13] 'tpu-delete-previous-word) ; F13 (LF)
- (define-key map [f14] 'tpu-toggle-overwrite-mode) ; F14
- (define-key map [help] 'tpu-help) ; HELP
- (define-key map [menu] 'execute-extended-command) ; DO
- (define-key map [f17] 'tpu-goto-breadcrumb) ; F17
+ (define-key map [f10] #'tpu-exit) ; F10
+ (define-key map [f11] #'tpu-insert-escape) ; F11 (ESC)
+ (define-key map [f12] #'tpu-next-beginning-of-line) ; F12 (BS)
+ (define-key map [f13] #'tpu-delete-previous-word) ; F13 (LF)
+ (define-key map [f14] #'tpu-toggle-overwrite-mode) ; F14
+ (define-key map [help] #'tpu-help) ; HELP
+ (define-key map [menu] #'execute-extended-command) ; DO
+ (define-key map [f17] #'tpu-goto-breadcrumb) ; F17
;; (define-key map [f18] nil) ; F18
;; (define-key map [f19] nil) ; F19
;; (define-key map [f20] nil) ; F20
@@ -525,28 +522,28 @@ GOLD is the ASCII 7-bit escape sequence OP.")
;; its job to map the escape sequence to the right key-symbol.
(define-key map [kp-f1] tpu-gold-map) ; GOLD map
;;
- (define-key map [up] 'tpu-previous-line) ; up
- (define-key map [down] 'tpu-next-line) ; down
- (define-key map [right] 'tpu-forward-char) ; right
- (define-key map [left] 'tpu-backward-char) ; left
-
- (define-key map [kp-f2] 'tpu-help) ; PF2
- (define-key map [kp-f3] 'tpu-search-again) ; PF3
- (define-key map [kp-f4] 'tpu-delete-current-line) ; PF4
- (define-key map [kp-0] 'tpu-line) ; KP0
- (define-key map [kp-1] 'tpu-word) ; KP1
- (define-key map [kp-2] 'tpu-end-of-line) ; KP2
- (define-key map [kp-3] 'tpu-char) ; KP3
- (define-key map [kp-4] 'tpu-advance-direction) ; KP4
- (define-key map [kp-5] 'tpu-backup-direction) ; KP5
- (define-key map [kp-6] 'tpu-cut) ; KP6
- (define-key map [kp-7] 'tpu-page) ; KP7
- (define-key map [kp-8] 'tpu-scroll-window) ; KP8
- (define-key map [kp-9] 'tpu-append-region) ; KP9
- (define-key map [kp-subtract] 'tpu-delete-current-word) ; KP-
- (define-key map [kp-separator] 'tpu-delete-current-char) ; KP,
- (define-key map [kp-decimal] 'tpu-select) ; KP.
- (define-key map [kp-enter] 'newline) ; KPenter
+ (define-key map [up] #'tpu-previous-line) ; up
+ (define-key map [down] #'tpu-next-line) ; down
+ (define-key map [right] #'tpu-forward-char) ; right
+ (define-key map [left] #'tpu-backward-char) ; left
+
+ (define-key map [kp-f2] #'tpu-help) ; PF2
+ (define-key map [kp-f3] #'tpu-search-again) ; PF3
+ (define-key map [kp-f4] #'tpu-delete-current-line) ; PF4
+ (define-key map [kp-0] #'tpu-line) ; KP0
+ (define-key map [kp-1] #'tpu-word) ; KP1
+ (define-key map [kp-2] #'tpu-end-of-line) ; KP2
+ (define-key map [kp-3] #'tpu-char) ; KP3
+ (define-key map [kp-4] #'tpu-advance-direction) ; KP4
+ (define-key map [kp-5] #'tpu-backup-direction) ; KP5
+ (define-key map [kp-6] #'tpu-cut) ; KP6
+ (define-key map [kp-7] #'tpu-page) ; KP7
+ (define-key map [kp-8] #'tpu-scroll-window) ; KP8
+ (define-key map [kp-9] #'tpu-append-region) ; KP9
+ (define-key map [kp-subtract] #'tpu-delete-current-word) ; KP-
+ (define-key map [kp-separator] #'tpu-delete-current-char) ; KP,
+ (define-key map [kp-decimal] #'tpu-select) ; KP.
+ (define-key map [kp-enter] #'newline) ; KPenter
map)
"TPU-edt global keymap.")
@@ -883,7 +880,7 @@ With argument, fill and justify."
if no region is selected."
(interactive)
(let ((m (tpu-mark)))
- (apply 'ispell-region
+ (apply #'ispell-region
(if m
(if (> m (point)) (list (point) m)
(list m (point)))
@@ -970,14 +967,14 @@ and the total number of lines in the buffer."
;;;###autoload
(define-minor-mode tpu-edt-mode
"Toggle TPU/edt emulation on or off."
- :global t :group 'tpu
+ :global t
(if tpu-edt-mode (tpu-edt-on) (tpu-edt-off)))
-(defalias 'TPU-EDT-MODE 'tpu-edt-mode)
+(defalias 'TPU-EDT-MODE #'tpu-edt-mode)
;;;###autoload
-(defalias 'tpu-edt 'tpu-edt-on)
-(defalias 'TPU-EDT 'tpu-edt-on)
+(defalias 'tpu-edt #'tpu-edt-on)
+(defalias 'TPU-EDT #'tpu-edt-on)
;; Note: The following functions have no `tpu-' prefix. This is unavoidable.
;; The real TPU/edt editor has interactive commands with these names,
@@ -985,42 +982,42 @@ and the total number of lines in the buffer."
;; to work. Therefore it really is necessary to define these functions,
;; even in cases where they redefine existing Emacs functions.
-(defalias 'exit 'tpu-exit)
-(defalias 'EXIT 'tpu-exit)
+(defalias 'exit #'tpu-exit)
+(defalias 'EXIT #'tpu-exit)
-(defalias 'Get 'tpu-get)
-(defalias 'GET 'tpu-get)
+(defalias 'Get #'tpu-get)
+(defalias 'GET #'tpu-get)
-(defalias 'include 'tpu-include)
-(defalias 'INCLUDE 'tpu-include)
+(defalias 'include #'tpu-include)
+(defalias 'INCLUDE #'tpu-include)
-(defalias 'quit 'tpu-quit)
-(defalias 'QUIT 'tpu-quit)
+(defalias 'quit #'tpu-quit)
+(defalias 'QUIT #'tpu-quit)
-(defalias 'spell 'tpu-spell-check)
-(defalias 'SPELL 'tpu-spell-check)
+(defalias 'spell #'tpu-spell-check)
+(defalias 'SPELL #'tpu-spell-check)
-(defalias 'what\ line 'tpu-what-line)
-(defalias 'WHAT\ LINE 'tpu-what-line)
+(defalias 'what\ line #'tpu-what-line)
+(defalias 'WHAT\ LINE #'tpu-what-line)
-(defalias 'replace 'tpu-lm-replace)
-(defalias 'REPLACE 'tpu-lm-replace)
+(defalias 'replace #'tpu-lm-replace)
+(defalias 'REPLACE #'tpu-lm-replace)
-(defalias 'help 'tpu-help)
-(defalias 'HELP 'tpu-help)
+(defalias 'help #'tpu-help)
+(defalias 'HELP #'tpu-help)
-(defalias 'set\ cursor\ free 'tpu-set-cursor-free)
-(defalias 'SET\ CURSOR\ FREE 'tpu-set-cursor-free)
+(defalias 'set\ cursor\ free #'tpu-set-cursor-free)
+(defalias 'SET\ CURSOR\ FREE #'tpu-set-cursor-free)
-(defalias 'set\ cursor\ bound 'tpu-set-cursor-bound)
-(defalias 'SET\ CURSOR\ BOUND 'tpu-set-cursor-bound)
+(defalias 'set\ cursor\ bound #'tpu-set-cursor-bound)
+(defalias 'SET\ CURSOR\ BOUND #'tpu-set-cursor-bound)
-(defalias 'set\ scroll\ margins 'tpu-set-scroll-margins)
-(defalias 'SET\ SCROLL\ MARGINS 'tpu-set-scroll-margins)
+(defalias 'set\ scroll\ margins #'tpu-set-scroll-margins)
+(defalias 'SET\ SCROLL\ MARGINS #'tpu-set-scroll-margins)
;; Real TPU error messages end in periods.
;; Define this to avoid openly flouting Emacs coding standards.
-(defalias 'tpu-error 'error)
+(defalias 'tpu-error #'error)
;;;
@@ -1227,7 +1224,7 @@ and the total number of lines in the buffer."
"Bind a set of keystrokes to a single key, or key combination."
(interactive)
(setq tpu-saved-control-r (global-key-binding "\C-r"))
- (global-set-key "\C-r" 'tpu-end-define-macro-key)
+ (global-set-key "\C-r" #'tpu-end-define-macro-key)
(start-kbd-macro nil))
@@ -1361,18 +1358,18 @@ If an argument is specified, don't set the search direction."
(if (not arg) (setq tpu-searching-forward tpu-advance))
(cond (tpu-searching-forward
(cond (tpu-regexp-p
- (fset 'tpu-emacs-search 're-search-forward)
- (fset 'tpu-emacs-rev-search 're-search-backward))
+ (fset 'tpu-emacs-search #'re-search-forward)
+ (fset 'tpu-emacs-rev-search #'re-search-backward))
(t
- (fset 'tpu-emacs-search 'search-forward)
- (fset 'tpu-emacs-rev-search 'search-backward))))
+ (fset 'tpu-emacs-search #'search-forward)
+ (fset 'tpu-emacs-rev-search #'search-backward))))
(t
(cond (tpu-regexp-p
- (fset 'tpu-emacs-search 're-search-backward)
- (fset 'tpu-emacs-rev-search 're-search-forward))
+ (fset 'tpu-emacs-search #'re-search-backward)
+ (fset 'tpu-emacs-rev-search #'re-search-forward))
(t
- (fset 'tpu-emacs-search 'search-backward)
- (fset 'tpu-emacs-rev-search 'search-forward))))))
+ (fset 'tpu-emacs-search #'search-backward)
+ (fset 'tpu-emacs-rev-search #'search-forward))))))
(defun tpu-search-internal (pat &optional quiet)
"Search for a string or regular expression."
@@ -2203,18 +2200,18 @@ Accepts a prefix argument for the number of tpu-pan-columns to scroll."
;; Standard Emacs settings under xterm in function-key-map map
;; "\eOM" to [kp-enter] and [kp-enter] to RET, but since the output of the map
;; is not fed back into the map, the key stays as kp-enter :-(.
-(define-key minibuffer-local-map [kp-enter] 'exit-minibuffer)
+(define-key minibuffer-local-map [kp-enter] #'exit-minibuffer)
;; These are not necessary because they are inherited.
;; (define-key minibuffer-local-ns-map [kp-enter] 'exit-minibuffer)
;; (define-key minibuffer-local-completion-map [kp-enter] 'exit-minibuffer)
-(define-key minibuffer-local-must-match-map [kp-enter] 'minibuffer-complete-and-exit)
+(define-key minibuffer-local-must-match-map [kp-enter] #'minibuffer-complete-and-exit)
;;;
;;; Minibuffer map additions to set search direction
;;;
-(define-key minibuffer-local-map [kp-4] 'tpu-search-forward-exit) ;KP4
-(define-key minibuffer-local-map [kp-5] 'tpu-search-backward-exit) ;KP5
+(define-key minibuffer-local-map [kp-4] #'tpu-search-forward-exit) ;KP4
+(define-key minibuffer-local-map [kp-5] #'tpu-search-backward-exit) ;KP5
;;;
@@ -2223,19 +2220,19 @@ Accepts a prefix argument for the number of tpu-pan-columns to scroll."
(defvar tpu-control-keys-map
(let ((map (make-sparse-keymap)))
- (define-key map "\C-\\" 'quoted-insert) ; ^\
- (define-key map "\C-a" 'tpu-toggle-overwrite-mode) ; ^A
- (define-key map "\C-b" 'repeat-complex-command) ; ^B
- (define-key map "\C-e" 'tpu-current-end-of-line) ; ^E
- (define-key map "\C-h" 'tpu-next-beginning-of-line) ; ^H (BS)
- (define-key map "\C-j" 'tpu-delete-previous-word) ; ^J (LF)
- (define-key map "\C-k" 'tpu-define-macro-key) ; ^K
- (define-key map "\C-l" 'tpu-insert-formfeed) ; ^L (FF)
- (define-key map "\C-r" 'recenter) ; ^R
- (define-key map "\C-u" 'tpu-delete-to-bol) ; ^U
- (define-key map "\C-v" 'tpu-quoted-insert) ; ^V
- (define-key map "\C-w" 'redraw-display) ; ^W
- (define-key map "\C-z" 'tpu-exit) ; ^Z
+ (define-key map "\C-\\" #'quoted-insert) ; ^\
+ (define-key map "\C-a" #'tpu-toggle-overwrite-mode) ; ^A
+ (define-key map "\C-b" #'repeat-complex-command) ; ^B
+ (define-key map "\C-e" #'tpu-current-end-of-line) ; ^E
+ (define-key map "\C-h" #'tpu-next-beginning-of-line) ; ^H (BS)
+ (define-key map "\C-j" #'tpu-delete-previous-word) ; ^J (LF)
+ (define-key map "\C-k" #'tpu-define-macro-key) ; ^K
+ (define-key map "\C-l" #'tpu-insert-formfeed) ; ^L (FF)
+ (define-key map "\C-r" #'recenter) ; ^R
+ (define-key map "\C-u" #'tpu-delete-to-bol) ; ^U
+ (define-key map "\C-v" #'tpu-quoted-insert) ; ^V
+ (define-key map "\C-w" #'redraw-display) ; ^W
+ (define-key map "\C-z" #'tpu-exit) ; ^Z
map))
(defun tpu-set-control-keys ()
@@ -2285,18 +2282,18 @@ Accepts a prefix argument for the number of tpu-pan-columns to scroll."
(defun tpu-arrow-history nil
"Modify minibuffer maps to use arrows for history recall."
(interactive)
- (dolist (cur (where-is-internal 'tpu-previous-line))
- (define-key read-expression-map cur 'tpu-previous-history-element)
- (define-key minibuffer-local-map cur 'tpu-previous-history-element)
+ (dolist (cur (where-is-internal #'tpu-previous-line))
+ (define-key read-expression-map cur #'tpu-previous-history-element)
+ (define-key minibuffer-local-map cur #'tpu-previous-history-element)
;; These are inherited anyway. --Stef
;; (define-key minibuffer-local-ns-map cur 'tpu-previous-history-element)
;; (define-key minibuffer-local-completion-map cur 'tpu-previous-history-element)
;; (define-key minibuffer-local-must-match-map cur 'tpu-previous-history-element)
)
- (dolist (cur (where-is-internal 'tpu-next-line))
- (define-key read-expression-map cur 'tpu-next-history-element)
- (define-key minibuffer-local-map cur 'tpu-next-history-element)
+ (dolist (cur (where-is-internal #'tpu-next-line))
+ (define-key read-expression-map cur #'tpu-next-history-element)
+ (define-key minibuffer-local-map cur #'tpu-next-history-element)
;; These are inherited anyway. --Stef
;; (define-key minibuffer-local-ns-map cur 'tpu-next-history-element)
;; (define-key minibuffer-local-completion-map cur 'tpu-next-history-element)
@@ -2382,7 +2379,7 @@ If FILE is nil, try to load a default file. The default file names are
(use-global-map global-map)
;; Then do the normal TPU setup.
(transient-mark-mode t)
- (add-hook 'post-command-hook 'tpu-search-highlight)
+ (add-hook 'post-command-hook #'tpu-search-highlight)
(tpu-set-mode-line t)
(tpu-advance-direction)
;; set page delimiter, display line truncation, and scrolling like TPU
@@ -2406,7 +2403,7 @@ If FILE is nil, try to load a default file. The default file names are
"Turn off TPU/edt emulation. Note that the keypad is left on."
(interactive)
(tpu-reset-control-keys nil)
- (remove-hook 'post-command-hook 'tpu-search-highlight)
+ (remove-hook 'post-command-hook #'tpu-search-highlight)
(tpu-set-mode-line nil)
(while tpu-edt-old-global-values
(let ((varval (pop tpu-edt-old-global-values)))
diff --git a/lisp/obsolete/tpu-extras.el b/lisp/obsolete/tpu-extras.el
index 10b9c8937214..5d59945c562d 100644
--- a/lisp/obsolete/tpu-extras.el
+++ b/lisp/obsolete/tpu-extras.el
@@ -1,4 +1,4 @@
-;;; tpu-extras.el --- scroll margins and free cursor mode for TPU-edt
+;;; tpu-extras.el --- scroll margins and free cursor mode for TPU-edt -*- lexical-binding: t; -*-
;; Copyright (C) 1993-1995, 2000-2021 Free Software Foundation, Inc.
@@ -144,12 +144,12 @@ the previous line when starting from a line beginning."
;;; Hooks -- Set cursor free in picture mode.
;;; Clean up when writing a file from cursor free mode.
-(add-hook 'picture-mode-hook 'tpu-set-cursor-free)
+(add-hook 'picture-mode-hook #'tpu-set-cursor-free)
(defun tpu-trim-line-ends-if-needed ()
"Eliminate whitespace at ends of lines, if the cursor is free."
(if (and (buffer-modified-p) tpu-cursor-free-mode) (tpu-trim-line-ends)))
-(add-hook 'before-save-hook 'tpu-trim-line-ends-if-needed)
+(add-hook 'before-save-hook #'tpu-trim-line-ends-if-needed)
;;; Utility routines for implementing scroll margins
diff --git a/lisp/obsolete/tpu-mapper.el b/lisp/obsolete/tpu-mapper.el
index 2735820ae499..d23068ac4692 100644
--- a/lisp/obsolete/tpu-mapper.el
+++ b/lisp/obsolete/tpu-mapper.el
@@ -1,4 +1,4 @@
-;;; tpu-mapper.el --- create a TPU-edt X-windows keymap file
+;;; tpu-mapper.el --- create a TPU-edt X-windows keymap file -*- lexical-binding: t; -*-
;; Copyright (C) 1993-1995, 2001-2021 Free Software Foundation, Inc.
diff --git a/lisp/obsolete/url-ns.el b/lisp/obsolete/url-ns.el
index fff3be95453e..b62ad8299904 100644
--- a/lisp/obsolete/url-ns.el
+++ b/lisp/obsolete/url-ns.el
@@ -1,4 +1,4 @@
-;;; url-ns.el --- Various netscape-ish functions for proxy definitions
+;;; url-ns.el --- Various netscape-ish functions for proxy definitions -*- lexical-binding: t; -*-
;; Copyright (C) 1997-1999, 2004-2021 Free Software Foundation, Inc.
@@ -55,9 +55,9 @@
(if (or (/= (length netc) (length ipc))
(/= (length ipc) (length maskc)))
nil
- (setq netc (mapcar 'string-to-number netc)
- ipc (mapcar 'string-to-number ipc)
- maskc (mapcar 'string-to-number maskc))
+ (setq netc (mapcar #'string-to-number netc)
+ ipc (mapcar #'string-to-number ipc)
+ maskc (mapcar #'string-to-number maskc))
(and
(= (logand (nth 0 netc) (nth 0 maskc))
(logand (nth 0 ipc) (nth 0 maskc)))
@@ -79,24 +79,23 @@
(if (not (and (file-exists-p file)
(file-readable-p file)))
(message "Could not open %s for reading" file)
- (save-excursion
- (let ((false nil)
- (true t))
- (setq url-ns-user-prefs (make-hash-table :size 13 :test 'equal))
- (set-buffer (get-buffer-create " *ns-parse*"))
- (erase-buffer)
- (insert-file-contents file)
- (goto-char (point-min))
- (while (re-search-forward "^//" nil t)
- (replace-match ";;"))
- (goto-char (point-min))
- (while (re-search-forward "^user_pref(" nil t)
- (replace-match "(url-ns-set-user-pref "))
- (goto-char (point-min))
- (while (re-search-forward "\"," nil t)
- (replace-match "\""))
- (goto-char (point-min))
- (eval-buffer)))))
+ (setq url-ns-user-prefs (make-hash-table :size 13 :test 'equal))
+ (with-current-buffer (get-buffer-create " *ns-parse*")
+ (erase-buffer)
+ (insert-file-contents file)
+ (goto-char (point-min))
+ (while (re-search-forward "^//" nil t)
+ (replace-match ";;"))
+ (goto-char (point-min))
+ (while (re-search-forward "^user_pref(" nil t)
+ (replace-match "(url-ns-set-user-pref "))
+ (goto-char (point-min))
+ (while (re-search-forward "\"," nil t)
+ (replace-match "\""))
+ (goto-char (point-min))
+ (with-suppressed-warnings ((lexical true false))
+ (dlet ((false nil) (true t))
+ (eval-buffer))))))
(defun url-ns-set-user-pref (key val)
(puthash key val url-ns-user-prefs))
diff --git a/lisp/obsolete/vc-arch.el b/lisp/obsolete/vc-arch.el
index 80a2094d8044..00e7d26cd750 100644
--- a/lisp/obsolete/vc-arch.el
+++ b/lisp/obsolete/vc-arch.el
@@ -81,8 +81,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(const :tag "None" t)
(string :tag "Argument String")
(repeat :tag "Argument List" :value ("") string))
- :version "23.1"
- :group 'vc-arch)
+ :version "23.1")
(define-obsolete-variable-alias 'vc-arch-command 'vc-arch-program "23.1")
@@ -92,8 +91,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(setq candidates (cdr candidates)))
(or (car candidates) "tla"))
"Name of the Arch executable."
- :type 'string
- :group 'vc-arch)
+ :type 'string)
;; Clear up the cache to force vc-call to check again and discover
;; new functions when we reload this file.
@@ -341,7 +339,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
("--" . permissions-changed)
("-/" . permissions-changed) ;directory
))
- (state-map-regexp (regexp-opt (mapcar 'car state-map) t))
+ (state-map-regexp (regexp-opt (mapcar #'car state-map) t))
(entry-regexp (concat "^" state-map-regexp " \\(.*\\)$"))
result)
(goto-char (point-min))
@@ -387,8 +385,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
(defcustom vc-arch-mode-line-rewrite
'(("\\`.*--\\(.*--.*\\)--\\(v?\\).*-\\([0-9]+\\)\\'" . "\\2\\3[\\1]"))
"Rewrite rules to shorten Arch's revision names on the mode-line."
- :type '(repeat (cons regexp string))
- :group 'vc-arch)
+ :type '(repeat (cons regexp string)))
(defun vc-arch-mode-line-string (file)
"Return a string for `vc-mode-line' to put in the mode line for FILE."
@@ -420,7 +417,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
;; The .rej file is obsolete.
(condition-case nil (delete-file rej) (error nil))
;; Remove the hook so that it is not called multiple times.
- (remove-hook 'after-save-hook 'vc-arch-delete-rej-if-obsolete t))))))
+ (remove-hook 'after-save-hook #'vc-arch-delete-rej-if-obsolete t))))))
(defun vc-arch-find-file-hook ()
(let ((rej (concat buffer-file-name ".rej")))
@@ -433,7 +430,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
(condition-case nil (delete-file rej) (error nil))
(smerge-mode 1)
(add-hook 'after-save-hook
- 'vc-arch-delete-rej-if-obsolete nil t)
+ #'vc-arch-delete-rej-if-obsolete nil t)
(message "There are unresolved conflicts in this file")))
(message "There are unresolved conflicts in %s"
(file-name-nondirectory rej))))))
@@ -488,11 +485,11 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
(defun vc-arch-rename-file (old new)
(vc-arch-command nil 0 new "mv" (file-relative-name old)))
-(defalias 'vc-arch-responsible-p 'vc-arch-root)
+(defalias 'vc-arch-responsible-p #'vc-arch-root)
(defun vc-arch-command (buffer okstatus file &rest flags)
"A wrapper around `vc-do-command' for use in vc-arch.el."
- (apply 'vc-do-command (or buffer "*vc*") okstatus vc-arch-program file flags))
+ (apply #'vc-do-command (or buffer "*vc*") okstatus vc-arch-program file flags))
;;; Completion of versions and revisions.
@@ -571,7 +568,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
(when (string-match "-\\([0-9]+\\)\\'" f)
(cons (string-to-number (match-string 1 f)) f)))
(directory-files dir nil nil 'nosort)))
- 'car-less-than-car))
+ #'car-less-than-car))
(subdirs nil))
(when (cddr revs)
(dotimes (_i (/ (length revs) 2))
@@ -600,26 +597,26 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
(let* ((archives (directory-files rl-dir 'full
directory-files-no-dot-files-regexp))
(categories
- (apply 'append
+ (apply #'append
(mapcar (lambda (dir)
(when (file-directory-p dir)
(directory-files
dir 'full directory-files-no-dot-files-regexp)))
archives)))
(branches
- (apply 'append
+ (apply #'append
(mapcar (lambda (dir)
(when (file-directory-p dir)
(directory-files
dir 'full directory-files-no-dot-files-regexp)))
categories)))
(versions
- (apply 'append
+ (apply #'append
(mapcar (lambda (dir)
(when (file-directory-p dir)
(directory-files dir 'full "--.*--")))
branches))))
- (mapc 'vc-arch-trim-one-revlib versions))
+ (mapc #'vc-arch-trim-one-revlib versions))
))
(defvar vc-arch-extra-menu-map
diff --git a/lisp/obsolete/vi.el b/lisp/obsolete/vi.el
index eee00b43a26c..91baa4d28ef9 100644
--- a/lisp/obsolete/vi.el
+++ b/lisp/obsolete/vi.el
@@ -1,4 +1,4 @@
-;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs
+;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs -*- lexical-binding: t; -*-
;; This file is in the public domain because the authors distributed it
;; without a copyright notice before the US signed the Bern Convention.
@@ -48,7 +48,7 @@
(defvar vi-mode-old-case-fold)
(if (null (where-is-internal 'vi-switch-mode (current-local-map)))
- (define-key ctl-x-map "~" 'vi-switch-mode))
+ (define-key ctl-x-map "~" #'vi-switch-mode))
(defvar vi-tilde-map nil
"Keymap used for \\[vi-switch-mode] prefix key. Link to various major modes.")
@@ -56,24 +56,24 @@
(if vi-tilde-map
nil
(setq vi-tilde-map (make-keymap))
- (define-key vi-tilde-map "a" 'abbrev-mode)
- (define-key vi-tilde-map "c" 'c-mode)
- (define-key vi-tilde-map "d" 'vi-debugging)
- (define-key vi-tilde-map "e" 'emacs-lisp-mode)
- (define-key vi-tilde-map "f" 'auto-fill-mode)
- (define-key vi-tilde-map "g" 'prolog-mode)
- (define-key vi-tilde-map "h" 'hanoi)
- (define-key vi-tilde-map "i" 'info-mode)
- (define-key vi-tilde-map "l" 'lisp-mode)
- (define-key vi-tilde-map "n" 'nroff-mode)
- (define-key vi-tilde-map "o" 'overwrite-mode)
- (define-key vi-tilde-map "O" 'outline-mode)
- (define-key vi-tilde-map "P" 'picture-mode)
- (define-key vi-tilde-map "r" 'vi-readonly-mode)
- (define-key vi-tilde-map "t" 'text-mode)
- (define-key vi-tilde-map "v" 'vi-mode)
- (define-key vi-tilde-map "x" 'tex-mode)
- (define-key vi-tilde-map "~" 'vi-back-to-old-mode))
+ (define-key vi-tilde-map "a" #'abbrev-mode)
+ (define-key vi-tilde-map "c" #'c-mode)
+ (define-key vi-tilde-map "d" #'vi-debugging)
+ (define-key vi-tilde-map "e" #'emacs-lisp-mode)
+ (define-key vi-tilde-map "f" #'auto-fill-mode)
+ (define-key vi-tilde-map "g" #'prolog-mode)
+ (define-key vi-tilde-map "h" #'hanoi)
+ ;; (define-key vi-tilde-map "i" #'info-mode)
+ (define-key vi-tilde-map "l" #'lisp-mode)
+ (define-key vi-tilde-map "n" #'nroff-mode)
+ (define-key vi-tilde-map "o" #'overwrite-mode)
+ (define-key vi-tilde-map "O" #'outline-mode)
+ (define-key vi-tilde-map "P" #'picture-mode)
+ (define-key vi-tilde-map "r" #'vi-readonly-mode)
+ (define-key vi-tilde-map "t" #'text-mode)
+ (define-key vi-tilde-map "v" #'vi-mode)
+ (define-key vi-tilde-map "x" #'tex-mode)
+ (define-key vi-tilde-map "~" #'vi-back-to-old-mode))
(defun vi-switch-mode (arg mode-char)
"Switch the major mode of current buffer as specified by the following char \\{vi-tilde-map}"
@@ -123,143 +123,143 @@ command extensions.")
(put 'vi-undefined 'suppress-keymap t)
(if vi-com-map nil
(setq vi-com-map (make-keymap))
-;;(fillarray vi-com-map 'vi-undefined)
- (define-key vi-com-map "\C-@" 'vi-mark-region) ; extension
- (define-key vi-com-map "\C-a" 'vi-ask-for-info) ; extension
- (define-key vi-com-map "\C-b" 'vi-backward-windowful)
- (define-key vi-com-map "\C-c" 'vi-do-old-mode-C-c-command) ; extension
- (define-key vi-com-map "\C-d" 'vi-scroll-down-window)
- (define-key vi-com-map "\C-e" 'vi-expose-line-below)
- (define-key vi-com-map "\C-f" 'vi-forward-windowful)
- (define-key vi-com-map "\C-g" 'keyboard-quit)
- (define-key vi-com-map "\C-i" 'indent-relative-first-indent-point) ; TAB
- (define-key vi-com-map "\C-j" 'vi-next-line) ; LFD
- (define-key vi-com-map "\C-k" 'vi-kill-line) ; extension
- (define-key vi-com-map "\C-l" 'recenter)
- (define-key vi-com-map "\C-m" 'vi-next-line-first-nonwhite) ; RET
- (define-key vi-com-map "\C-n" 'vi-next-line)
- (define-key vi-com-map "\C-o" 'vi-split-open-line)
- (define-key vi-com-map "\C-p" 'previous-line)
- (define-key vi-com-map "\C-q" 'vi-query-replace) ; extension
- (define-key vi-com-map "\C-r" 'vi-isearch-backward) ; modification
- (define-key vi-com-map "\C-s" 'vi-isearch-forward) ; extension
- (define-key vi-com-map "\C-t" 'vi-transpose-objects) ; extension
- (define-key vi-com-map "\C-u" 'vi-scroll-up-window)
- (define-key vi-com-map "\C-v" 'scroll-up-command) ; extension
- (define-key vi-com-map "\C-w" 'vi-kill-region) ; extension
+;;(fillarray vi-com-map #'vi-undefined)
+ (define-key vi-com-map "\C-@" #'vi-mark-region) ; extension
+ (define-key vi-com-map "\C-a" #'vi-ask-for-info) ; extension
+ (define-key vi-com-map "\C-b" #'vi-backward-windowful)
+ (define-key vi-com-map "\C-c" #'vi-do-old-mode-C-c-command) ; extension
+ (define-key vi-com-map "\C-d" #'vi-scroll-down-window)
+ (define-key vi-com-map "\C-e" #'vi-expose-line-below)
+ (define-key vi-com-map "\C-f" #'vi-forward-windowful)
+ (define-key vi-com-map "\C-g" #'keyboard-quit)
+ (define-key vi-com-map "\C-i" #'indent-relative-first-indent-point) ; TAB
+ (define-key vi-com-map "\C-j" #'vi-next-line) ; LFD
+ (define-key vi-com-map "\C-k" #'vi-kill-line) ; extension
+ (define-key vi-com-map "\C-l" #'recenter)
+ (define-key vi-com-map "\C-m" #'vi-next-line-first-nonwhite) ; RET
+ (define-key vi-com-map "\C-n" #'vi-next-line)
+ (define-key vi-com-map "\C-o" #'vi-split-open-line)
+ (define-key vi-com-map "\C-p" #'previous-line)
+ (define-key vi-com-map "\C-q" #'vi-query-replace) ; extension
+ (define-key vi-com-map "\C-r" #'vi-isearch-backward) ; modification
+ (define-key vi-com-map "\C-s" #'vi-isearch-forward) ; extension
+ (define-key vi-com-map "\C-t" #'vi-transpose-objects) ; extension
+ (define-key vi-com-map "\C-u" #'vi-scroll-up-window)
+ (define-key vi-com-map "\C-v" #'scroll-up-command) ; extension
+ (define-key vi-com-map "\C-w" #'vi-kill-region) ; extension
(define-key vi-com-map "\C-x" 'Control-X-prefix) ; extension
- (define-key vi-com-map "\C-y" 'vi-expose-line-above)
- (define-key vi-com-map "\C-z" 'suspend-emacs)
+ (define-key vi-com-map "\C-y" #'vi-expose-line-above)
+ (define-key vi-com-map "\C-z" #'suspend-emacs)
(define-key vi-com-map "\e" 'ESC-prefix); C-[ (ESC)
- (define-key vi-com-map "\C-\\" 'vi-unimplemented)
- (define-key vi-com-map "\C-]" 'find-tag)
- (define-key vi-com-map "\C-^" 'vi-locate-def) ; extension
- (define-key vi-com-map "\C-_" 'vi-undefined)
-
- (define-key vi-com-map " " 'forward-char)
- (define-key vi-com-map "!" 'vi-operator)
- (define-key vi-com-map "\"" 'vi-char-argument)
- (define-key vi-com-map "#" 'universal-argument) ; extension
- (define-key vi-com-map "$" 'end-of-line)
- (define-key vi-com-map "%" 'vi-find-matching-paren)
- (define-key vi-com-map "&" 'vi-unimplemented)
- (define-key vi-com-map "'" 'vi-goto-line-mark)
- (define-key vi-com-map "(" 'backward-sexp)
- (define-key vi-com-map ")" 'forward-sexp)
- (define-key vi-com-map "*" 'vi-name-last-change-or-macro) ; extension
- (define-key vi-com-map "+" 'vi-next-line-first-nonwhite)
- (define-key vi-com-map "," 'vi-reverse-last-find-char)
- (define-key vi-com-map "-" 'vi-previous-line-first-nonwhite)
- (define-key vi-com-map "." 'vi-redo-last-change-command)
- (define-key vi-com-map "/" 'vi-search-forward)
- (define-key vi-com-map "0" 'beginning-of-line)
-
- (define-key vi-com-map "1" 'vi-digit-argument)
- (define-key vi-com-map "2" 'vi-digit-argument)
- (define-key vi-com-map "3" 'vi-digit-argument)
- (define-key vi-com-map "4" 'vi-digit-argument)
- (define-key vi-com-map "5" 'vi-digit-argument)
- (define-key vi-com-map "6" 'vi-digit-argument)
- (define-key vi-com-map "7" 'vi-digit-argument)
- (define-key vi-com-map "8" 'vi-digit-argument)
- (define-key vi-com-map "9" 'vi-digit-argument)
-
- (define-key vi-com-map ":" 'vi-ex-cmd)
- (define-key vi-com-map ";" 'vi-repeat-last-find-char)
- (define-key vi-com-map "<" 'vi-operator)
- (define-key vi-com-map "=" 'vi-operator)
- (define-key vi-com-map ">" 'vi-operator)
- (define-key vi-com-map "?" 'vi-search-backward)
- (define-key vi-com-map "@" 'vi-call-named-change-or-macro) ; extension
-
- (define-key vi-com-map "A" 'vi-append-at-end-of-line)
- (define-key vi-com-map "B" 'vi-backward-blank-delimited-word)
- (define-key vi-com-map "C" 'vi-change-rest-of-line)
- (define-key vi-com-map "D" 'vi-kill-line)
- (define-key vi-com-map "E" 'vi-end-of-blank-delimited-word)
- (define-key vi-com-map "F" 'vi-backward-find-char)
- (define-key vi-com-map "G" 'vi-goto-line)
- (define-key vi-com-map "H" 'vi-home-window-line)
- (define-key vi-com-map "I" 'vi-insert-before-first-nonwhite)
- (define-key vi-com-map "J" 'vi-join-lines)
- (define-key vi-com-map "K" 'vi-undefined)
- (define-key vi-com-map "L" 'vi-last-window-line)
- (define-key vi-com-map "M" 'vi-middle-window-line)
- (define-key vi-com-map "N" 'vi-reverse-last-search)
- (define-key vi-com-map "O" 'vi-open-above)
- (define-key vi-com-map "P" 'vi-put-before)
- (define-key vi-com-map "Q" 'vi-quote-words) ; extension
- (define-key vi-com-map "R" 'vi-replace-chars)
- (define-key vi-com-map "S" 'vi-substitute-lines)
- (define-key vi-com-map "T" 'vi-backward-upto-char)
- (define-key vi-com-map "U" 'vi-unimplemented)
- (define-key vi-com-map "V" 'vi-undefined)
- (define-key vi-com-map "W" 'vi-forward-blank-delimited-word)
- (define-key vi-com-map "X" 'call-last-kbd-macro) ; modification/extension
- (define-key vi-com-map "Y" 'vi-yank-line)
+ (define-key vi-com-map "\C-\\" #'vi-unimplemented)
+ (define-key vi-com-map "\C-]" #'xref-find-definitions)
+ (define-key vi-com-map "\C-^" #'vi-locate-def) ; extension
+ (define-key vi-com-map "\C-_" #'vi-undefined)
+
+ (define-key vi-com-map " " #'forward-char)
+ (define-key vi-com-map "!" #'vi-operator)
+ (define-key vi-com-map "\"" #'vi-char-argument)
+ (define-key vi-com-map "#" #'universal-argument) ; extension
+ (define-key vi-com-map "$" #'end-of-line)
+ (define-key vi-com-map "%" #'vi-find-matching-paren)
+ (define-key vi-com-map "&" #'vi-unimplemented)
+ (define-key vi-com-map "'" #'vi-goto-line-mark)
+ (define-key vi-com-map "(" #'backward-sexp)
+ (define-key vi-com-map ")" #'forward-sexp)
+ (define-key vi-com-map "*" #'vi-name-last-change-or-macro) ; extension
+ (define-key vi-com-map "+" #'vi-next-line-first-nonwhite)
+ (define-key vi-com-map "," #'vi-reverse-last-find-char)
+ (define-key vi-com-map "-" #'vi-previous-line-first-nonwhite)
+ (define-key vi-com-map "." #'vi-redo-last-change-command)
+ (define-key vi-com-map "/" #'vi-search-forward)
+ (define-key vi-com-map "0" #'beginning-of-line)
+
+ (define-key vi-com-map "1" #'vi-digit-argument)
+ (define-key vi-com-map "2" #'vi-digit-argument)
+ (define-key vi-com-map "3" #'vi-digit-argument)
+ (define-key vi-com-map "4" #'vi-digit-argument)
+ (define-key vi-com-map "5" #'vi-digit-argument)
+ (define-key vi-com-map "6" #'vi-digit-argument)
+ (define-key vi-com-map "7" #'vi-digit-argument)
+ (define-key vi-com-map "8" #'vi-digit-argument)
+ (define-key vi-com-map "9" #'vi-digit-argument)
+
+ (define-key vi-com-map ":" #'vi-ex-cmd)
+ (define-key vi-com-map ";" #'vi-repeat-last-find-char)
+ (define-key vi-com-map "<" #'vi-operator)
+ (define-key vi-com-map "=" #'vi-operator)
+ (define-key vi-com-map ">" #'vi-operator)
+ (define-key vi-com-map "?" #'vi-search-backward)
+ (define-key vi-com-map "@" #'vi-call-named-change-or-macro) ; extension
+
+ (define-key vi-com-map "A" #'vi-append-at-end-of-line)
+ (define-key vi-com-map "B" #'vi-backward-blank-delimited-word)
+ (define-key vi-com-map "C" #'vi-change-rest-of-line)
+ (define-key vi-com-map "D" #'vi-kill-line)
+ (define-key vi-com-map "E" #'vi-end-of-blank-delimited-word)
+ (define-key vi-com-map "F" #'vi-backward-find-char)
+ (define-key vi-com-map "G" #'vi-goto-line)
+ (define-key vi-com-map "H" #'vi-home-window-line)
+ (define-key vi-com-map "I" #'vi-insert-before-first-nonwhite)
+ (define-key vi-com-map "J" #'vi-join-lines)
+ (define-key vi-com-map "K" #'vi-undefined)
+ (define-key vi-com-map "L" #'vi-last-window-line)
+ (define-key vi-com-map "M" #'vi-middle-window-line)
+ (define-key vi-com-map "N" #'vi-reverse-last-search)
+ (define-key vi-com-map "O" #'vi-open-above)
+ (define-key vi-com-map "P" #'vi-put-before)
+ (define-key vi-com-map "Q" #'vi-quote-words) ; extension
+ (define-key vi-com-map "R" #'vi-replace-chars)
+ (define-key vi-com-map "S" #'vi-substitute-lines)
+ (define-key vi-com-map "T" #'vi-backward-upto-char)
+ (define-key vi-com-map "U" #'vi-unimplemented)
+ (define-key vi-com-map "V" #'vi-undefined)
+ (define-key vi-com-map "W" #'vi-forward-blank-delimited-word)
+ (define-key vi-com-map "X" #'call-last-kbd-macro) ; modification/extension
+ (define-key vi-com-map "Y" #'vi-yank-line)
(define-key vi-com-map "Z" (make-sparse-keymap)) ;allow below prefix command
- (define-key vi-com-map "ZZ" 'vi-save-all-and-exit)
-
- (define-key vi-com-map "[" 'vi-unimplemented)
- (define-key vi-com-map "\\" 'vi-operator) ; extension for vi-narrow-op
- (define-key vi-com-map "]" 'vi-unimplemented)
- (define-key vi-com-map "^" 'back-to-indentation)
- (define-key vi-com-map "_" 'vi-undefined)
- (define-key vi-com-map "`" 'vi-goto-char-mark)
-
- (define-key vi-com-map "a" 'vi-insert-after)
- (define-key vi-com-map "b" 'backward-word)
- (define-key vi-com-map "c" 'vi-operator)
- (define-key vi-com-map "d" 'vi-operator)
- (define-key vi-com-map "e" 'vi-end-of-word)
- (define-key vi-com-map "f" 'vi-forward-find-char)
- (define-key vi-com-map "g" 'vi-beginning-of-buffer) ; extension
- (define-key vi-com-map "h" 'backward-char)
- (define-key vi-com-map "i" 'vi-insert-before)
- (define-key vi-com-map "j" 'vi-next-line)
- (define-key vi-com-map "k" 'previous-line)
- (define-key vi-com-map "l" 'forward-char)
- (define-key vi-com-map "m" 'vi-set-mark)
- (define-key vi-com-map "n" 'vi-repeat-last-search)
- (define-key vi-com-map "o" 'vi-open-below)
- (define-key vi-com-map "p" 'vi-put-after)
- (define-key vi-com-map "q" 'vi-replace)
- (define-key vi-com-map "r" 'vi-replace-1-char)
- (define-key vi-com-map "s" 'vi-substitute-chars)
- (define-key vi-com-map "t" 'vi-forward-upto-char)
- (define-key vi-com-map "u" 'undo)
- (define-key vi-com-map "v" 'vi-verify-spelling)
- (define-key vi-com-map "w" 'vi-forward-word)
- (define-key vi-com-map "x" 'vi-kill-char)
- (define-key vi-com-map "y" 'vi-operator)
- (define-key vi-com-map "z" 'vi-adjust-window)
-
- (define-key vi-com-map "{" 'backward-paragraph)
- (define-key vi-com-map "|" 'vi-goto-column)
- (define-key vi-com-map "}" 'forward-paragraph)
- (define-key vi-com-map "~" 'vi-change-case)
- (define-key vi-com-map "\177" 'delete-backward-char))
+ (define-key vi-com-map "ZZ" #'vi-save-all-and-exit)
+
+ (define-key vi-com-map "[" #'vi-unimplemented)
+ (define-key vi-com-map "\\" #'vi-operator) ; extension for vi-narrow-op
+ (define-key vi-com-map "]" #'vi-unimplemented)
+ (define-key vi-com-map "^" #'back-to-indentation)
+ (define-key vi-com-map "_" #'vi-undefined)
+ (define-key vi-com-map "`" #'vi-goto-char-mark)
+
+ (define-key vi-com-map "a" #'vi-insert-after)
+ (define-key vi-com-map "b" #'backward-word)
+ (define-key vi-com-map "c" #'vi-operator)
+ (define-key vi-com-map "d" #'vi-operator)
+ (define-key vi-com-map "e" #'vi-end-of-word)
+ (define-key vi-com-map "f" #'vi-forward-find-char)
+ (define-key vi-com-map "g" #'vi-beginning-of-buffer) ; extension
+ (define-key vi-com-map "h" #'backward-char)
+ (define-key vi-com-map "i" #'vi-insert-before)
+ (define-key vi-com-map "j" #'vi-next-line)
+ (define-key vi-com-map "k" #'previous-line)
+ (define-key vi-com-map "l" #'forward-char)
+ (define-key vi-com-map "m" #'vi-set-mark)
+ (define-key vi-com-map "n" #'vi-repeat-last-search)
+ (define-key vi-com-map "o" #'vi-open-below)
+ (define-key vi-com-map "p" #'vi-put-after)
+ (define-key vi-com-map "q" #'vi-replace)
+ (define-key vi-com-map "r" #'vi-replace-1-char)
+ (define-key vi-com-map "s" #'vi-substitute-chars)
+ (define-key vi-com-map "t" #'vi-forward-upto-char)
+ (define-key vi-com-map "u" #'undo)
+ (define-key vi-com-map "v" #'vi-verify-spelling)
+ (define-key vi-com-map "w" #'vi-forward-word)
+ (define-key vi-com-map "x" #'vi-kill-char)
+ (define-key vi-com-map "y" #'vi-operator)
+ (define-key vi-com-map "z" #'vi-adjust-window)
+
+ (define-key vi-com-map "{" #'backward-paragraph)
+ (define-key vi-com-map "|" #'vi-goto-column)
+ (define-key vi-com-map "}" #'forward-paragraph)
+ (define-key vi-com-map "~" #'vi-change-case)
+ (define-key vi-com-map "\177" #'delete-backward-char))
(put 'backward-char 'point-moving-unit 'char)
(put 'vi-next-line 'point-moving-unit 'line)
@@ -1182,7 +1182,7 @@ SPECIAL FEATURE: char argument can be used to specify shift amount(1-9)."
(defun vi-narrow-op (motion-command arg)
"Narrow to region specified by MOTION-COMMAND with ARG."
(let* ((range (vi-effective-range motion-command arg))
- (begin (car range)) (end (cdr range)) reg)
+ (begin (car range)) (end (cdr range)))
(if (= begin end)
nil ; point not moved, abort op
(narrow-to-region begin end))))
diff --git a/lisp/obsolete/vip.el b/lisp/obsolete/vip.el
index 08085e51d74d..16906b68a677 100644
--- a/lisp/obsolete/vip.el
+++ b/lisp/obsolete/vip.el
@@ -1,4 +1,4 @@
-;;; vip.el --- a VI Package for GNU Emacs
+;;; vip.el --- a VI Package for GNU Emacs -*- lexical-binding: t; -*-
;; Copyright (C) 1986-1988, 1992-1993, 1998, 2001-2021 Free Software
;; Foundation, Inc.
@@ -95,13 +95,11 @@
(defcustom vip-shift-width 8
"The number of columns shifted by > and < command."
- :type 'integer
- :group 'vip)
+ :type 'integer)
(defcustom vip-re-replace nil
"If t then do regexp replace, if nil then do string replace."
- :type 'boolean
- :group 'vip)
+ :type 'boolean)
(defvar vip-d-char nil
"The character remembered by the vi \"r\" command.")
@@ -120,13 +118,11 @@
(defcustom vip-search-wrap-around t
"If t, search wraps around."
- :type 'boolean
- :group 'vip)
+ :type 'boolean)
(defcustom vip-re-search nil
"If t, search is reg-exp search, otherwise vanilla search."
- :type 'boolean
- :group 'vip)
+ :type 'boolean)
(defvar vip-s-string nil
"Last vip search string.")
@@ -136,24 +132,20 @@
(defcustom vip-case-fold-search nil
"If t, search ignores cases."
- :type 'boolean
- :group 'vip)
+ :type 'boolean)
(defcustom vip-re-query-replace nil
"If t then do regexp replace, if nil then do string replace."
- :type 'boolean
- :group 'vip)
+ :type 'boolean)
(defcustom vip-open-with-indent nil
"If t, indent when open a new line."
- :type 'boolean
- :group 'vip)
+ :type 'boolean)
(defcustom vip-help-in-insert-mode nil
"If t then C-h is bound to help-command in insert mode.
If nil then it is bound to `delete-backward-char'."
- :type 'boolean
- :group 'vip)
+ :type 'boolean)
(defvar vip-quote-string "> "
"String inserted at the beginning of region.")
@@ -169,131 +161,131 @@ If nil then it is bound to `delete-backward-char'."
(defvar vip-mode-map
(let ((map (make-keymap)))
- (define-key map "\C-a" 'beginning-of-line)
- (define-key map "\C-b" 'vip-scroll-back)
- (define-key map "\C-c" 'vip-ctl-c)
- (define-key map "\C-d" 'vip-scroll-up)
- (define-key map "\C-e" 'vip-scroll-up-one)
- (define-key map "\C-f" 'vip-scroll)
- (define-key map "\C-g" 'vip-keyboard-quit)
- (define-key map "\C-h" 'help-command)
- (define-key map "\C-m" 'vip-scroll-back)
- (define-key map "\C-n" 'vip-other-window)
- (define-key map "\C-o" 'vip-open-line-at-point)
- (define-key map "\C-u" 'vip-scroll-down)
- (define-key map "\C-x" 'vip-ctl-x)
- (define-key map "\C-y" 'vip-scroll-down-one)
- (define-key map "\C-z" 'vip-change-mode-to-emacs)
- (define-key map "\e" 'vip-ESC)
-
- (define-key map [?\S-\ ] 'vip-scroll-back)
- (define-key map " " 'vip-scroll)
- (define-key map "!" 'vip-command-argument)
- (define-key map "\"" 'vip-command-argument)
- (define-key map "#" 'vip-command-argument)
- (define-key map "$" 'vip-goto-eol)
- (define-key map "%" 'vip-paren-match)
- (define-key map "&" 'vip-nil)
- (define-key map "'" 'vip-goto-mark-and-skip-white)
- (define-key map "(" 'vip-backward-sentence)
- (define-key map ")" 'vip-forward-sentence)
- (define-key map "*" 'call-last-kbd-macro)
- (define-key map "+" 'vip-next-line-at-bol)
- (define-key map "," 'vip-repeat-find-opposite)
- (define-key map "-" 'vip-previous-line-at-bol)
- (define-key map "." 'vip-repeat)
- (define-key map "/" 'vip-search-forward)
-
- (define-key map "0" 'vip-beginning-of-line)
- (define-key map "1" 'vip-digit-argument)
- (define-key map "2" 'vip-digit-argument)
- (define-key map "3" 'vip-digit-argument)
- (define-key map "4" 'vip-digit-argument)
- (define-key map "5" 'vip-digit-argument)
- (define-key map "6" 'vip-digit-argument)
- (define-key map "7" 'vip-digit-argument)
- (define-key map "8" 'vip-digit-argument)
- (define-key map "9" 'vip-digit-argument)
-
- (define-key map ":" 'vip-ex)
- (define-key map ";" 'vip-repeat-find)
- (define-key map "<" 'vip-command-argument)
- (define-key map "=" 'vip-command-argument)
- (define-key map ">" 'vip-command-argument)
- (define-key map "?" 'vip-search-backward)
- (define-key map "@" 'vip-nil)
-
- (define-key map "A" 'vip-Append)
- (define-key map "B" 'vip-backward-Word)
- (define-key map "C" 'vip-ctl-c-equivalent)
- (define-key map "D" 'vip-kill-line)
- (define-key map "E" 'vip-end-of-Word)
- (define-key map "F" 'vip-find-char-backward)
- (define-key map "G" 'vip-goto-line)
- (define-key map "H" 'vip-window-top)
- (define-key map "I" 'vip-Insert)
- (define-key map "J" 'vip-join-lines)
- (define-key map "K" 'vip-kill-buffer)
- (define-key map "L" 'vip-window-bottom)
- (define-key map "M" 'vip-window-middle)
- (define-key map "N" 'vip-search-Next)
- (define-key map "O" 'vip-Open-line)
- (define-key map "P" 'vip-Put-back)
- (define-key map "Q" 'vip-query-replace)
- (define-key map "R" 'vip-replace-string)
- (define-key map "S" 'vip-switch-to-buffer-other-window)
- (define-key map "T" 'vip-goto-char-backward)
- (define-key map "U" 'vip-nil)
- (define-key map "V" 'vip-find-file-other-window)
- (define-key map "W" 'vip-forward-Word)
- (define-key map "X" 'vip-ctl-x-equivalent)
- (define-key map "Y" 'vip-yank-line)
- (define-key map "ZZ" 'save-buffers-kill-emacs)
-
- (define-key map "[" 'vip-nil)
- (define-key map "\\" 'vip-escape-to-emacs)
- (define-key map "]" 'vip-nil)
- (define-key map "^" 'vip-bol-and-skip-white)
- (define-key map "_" 'vip-nil)
- (define-key map "`" 'vip-goto-mark)
-
- (define-key map "a" 'vip-append)
- (define-key map "b" 'vip-backward-word)
- (define-key map "c" 'vip-command-argument)
- (define-key map "d" 'vip-command-argument)
- (define-key map "e" 'vip-end-of-word)
- (define-key map "f" 'vip-find-char-forward)
- (define-key map "g" 'vip-info-on-file)
- (define-key map "h" 'vip-backward-char)
- (define-key map "i" 'vip-insert)
- (define-key map "j" 'vip-next-line)
- (define-key map "k" 'vip-previous-line)
- (define-key map "l" 'vip-forward-char)
- (define-key map "m" 'vip-mark-point)
- (define-key map "n" 'vip-search-next)
- (define-key map "o" 'vip-open-line)
- (define-key map "p" 'vip-put-back)
- (define-key map "q" 'vip-nil)
- (define-key map "r" 'vip-replace-char)
- (define-key map "s" 'vip-switch-to-buffer)
- (define-key map "t" 'vip-goto-char-forward)
- (define-key map "u" 'vip-undo)
- (define-key map "v" 'vip-find-file)
- (define-key map "w" 'vip-forward-word)
- (define-key map "x" 'vip-delete-char)
- (define-key map "y" 'vip-command-argument)
- (define-key map "zH" 'vip-line-to-top)
- (define-key map "zM" 'vip-line-to-middle)
- (define-key map "zL" 'vip-line-to-bottom)
- (define-key map "z\C-m" 'vip-line-to-top)
- (define-key map "z." 'vip-line-to-middle)
- (define-key map "z-" 'vip-line-to-bottom)
-
- (define-key map "{" 'vip-backward-paragraph)
- (define-key map "|" 'vip-goto-col)
- (define-key map "}" 'vip-forward-paragraph)
- (define-key map "~" 'vip-nil)
- (define-key map "\177" 'vip-delete-backward-char)
+ (define-key map "\C-a" #'beginning-of-line)
+ (define-key map "\C-b" #'vip-scroll-back)
+ (define-key map "\C-c" #'vip-ctl-c)
+ (define-key map "\C-d" #'vip-scroll-up)
+ (define-key map "\C-e" #'vip-scroll-up-one)
+ (define-key map "\C-f" #'vip-scroll)
+ (define-key map "\C-g" #'vip-keyboard-quit)
+ (define-key map "\C-h" #'help-command)
+ (define-key map "\C-m" #'vip-scroll-back)
+ (define-key map "\C-n" #'vip-other-window)
+ (define-key map "\C-o" #'vip-open-line-at-point)
+ (define-key map "\C-u" #'vip-scroll-down)
+ (define-key map "\C-x" #'vip-ctl-x)
+ (define-key map "\C-y" #'vip-scroll-down-one)
+ (define-key map "\C-z" #'vip-change-mode-to-emacs)
+ (define-key map "\e" #'vip-ESC)
+
+ (define-key map [?\S-\ ] #'vip-scroll-back)
+ (define-key map " " #'vip-scroll)
+ (define-key map "!" #'vip-command-argument)
+ (define-key map "\"" #'vip-command-argument)
+ (define-key map "#" #'vip-command-argument)
+ (define-key map "$" #'vip-goto-eol)
+ (define-key map "%" #'vip-paren-match)
+ (define-key map "&" #'vip-nil)
+ (define-key map "'" #'vip-goto-mark-and-skip-white)
+ (define-key map "(" #'vip-backward-sentence)
+ (define-key map ")" #'vip-forward-sentence)
+ (define-key map "*" #'call-last-kbd-macro)
+ (define-key map "+" #'vip-next-line-at-bol)
+ (define-key map "," #'vip-repeat-find-opposite)
+ (define-key map "-" #'vip-previous-line-at-bol)
+ (define-key map "." #'vip-repeat)
+ (define-key map "/" #'vip-search-forward)
+
+ (define-key map "0" #'vip-beginning-of-line)
+ (define-key map "1" #'vip-digit-argument)
+ (define-key map "2" #'vip-digit-argument)
+ (define-key map "3" #'vip-digit-argument)
+ (define-key map "4" #'vip-digit-argument)
+ (define-key map "5" #'vip-digit-argument)
+ (define-key map "6" #'vip-digit-argument)
+ (define-key map "7" #'vip-digit-argument)
+ (define-key map "8" #'vip-digit-argument)
+ (define-key map "9" #'vip-digit-argument)
+
+ (define-key map ":" #'vip-ex)
+ (define-key map ";" #'vip-repeat-find)
+ (define-key map "<" #'vip-command-argument)
+ (define-key map "=" #'vip-command-argument)
+ (define-key map ">" #'vip-command-argument)
+ (define-key map "?" #'vip-search-backward)
+ (define-key map "@" #'vip-nil)
+
+ (define-key map "A" #'vip-Append)
+ (define-key map "B" #'vip-backward-Word)
+ (define-key map "C" #'vip-ctl-c-equivalent)
+ (define-key map "D" #'vip-kill-line)
+ (define-key map "E" #'vip-end-of-Word)
+ (define-key map "F" #'vip-find-char-backward)
+ (define-key map "G" #'vip-goto-line)
+ (define-key map "H" #'vip-window-top)
+ (define-key map "I" #'vip-Insert)
+ (define-key map "J" #'vip-join-lines)
+ (define-key map "K" #'vip-kill-buffer)
+ (define-key map "L" #'vip-window-bottom)
+ (define-key map "M" #'vip-window-middle)
+ (define-key map "N" #'vip-search-Next)
+ (define-key map "O" #'vip-Open-line)
+ (define-key map "P" #'vip-Put-back)
+ (define-key map "Q" #'vip-query-replace)
+ (define-key map "R" #'vip-replace-string)
+ (define-key map "S" #'vip-switch-to-buffer-other-window)
+ (define-key map "T" #'vip-goto-char-backward)
+ (define-key map "U" #'vip-nil)
+ (define-key map "V" #'vip-find-file-other-window)
+ (define-key map "W" #'vip-forward-Word)
+ (define-key map "X" #'vip-ctl-x-equivalent)
+ (define-key map "Y" #'vip-yank-line)
+ (define-key map "ZZ" #'save-buffers-kill-emacs)
+
+ (define-key map "[" #'vip-nil)
+ (define-key map "\\" #'vip-escape-to-emacs)
+ (define-key map "]" #'vip-nil)
+ (define-key map "^" #'vip-bol-and-skip-white)
+ (define-key map "_" #'vip-nil)
+ (define-key map "`" #'vip-goto-mark)
+
+ (define-key map "a" #'vip-append)
+ (define-key map "b" #'vip-backward-word)
+ (define-key map "c" #'vip-command-argument)
+ (define-key map "d" #'vip-command-argument)
+ (define-key map "e" #'vip-end-of-word)
+ (define-key map "f" #'vip-find-char-forward)
+ (define-key map "g" #'vip-info-on-file)
+ (define-key map "h" #'vip-backward-char)
+ (define-key map "i" #'vip-insert)
+ (define-key map "j" #'vip-next-line)
+ (define-key map "k" #'vip-previous-line)
+ (define-key map "l" #'vip-forward-char)
+ (define-key map "m" #'vip-mark-point)
+ (define-key map "n" #'vip-search-next)
+ (define-key map "o" #'vip-open-line)
+ (define-key map "p" #'vip-put-back)
+ (define-key map "q" #'vip-nil)
+ (define-key map "r" #'vip-replace-char)
+ (define-key map "s" #'vip-switch-to-buffer)
+ (define-key map "t" #'vip-goto-char-forward)
+ (define-key map "u" #'vip-undo)
+ (define-key map "v" #'vip-find-file)
+ (define-key map "w" #'vip-forward-word)
+ (define-key map "x" #'vip-delete-char)
+ (define-key map "y" #'vip-command-argument)
+ (define-key map "zH" #'vip-line-to-top)
+ (define-key map "zM" #'vip-line-to-middle)
+ (define-key map "zL" #'vip-line-to-bottom)
+ (define-key map "z\C-m" #'vip-line-to-top)
+ (define-key map "z." #'vip-line-to-middle)
+ (define-key map "z-" #'vip-line-to-bottom)
+
+ (define-key map "{" #'vip-backward-paragraph)
+ (define-key map "|" #'vip-goto-col)
+ (define-key map "}" #'vip-forward-paragraph)
+ (define-key map "~" #'vip-nil)
+ (define-key map "\177" #'vip-delete-backward-char)
map))
(defun vip-version ()
@@ -306,8 +298,8 @@ If nil then it is bound to `delete-backward-char'."
;;;###autoload
(defun vip-setup ()
"Set up bindings for C-x 7 and C-z that are useful for VIP users."
- (define-key ctl-x-map "7" 'vip-buffer-in-two-windows)
- (global-set-key "\C-z" 'vip-change-mode-to-vi))
+ (define-key ctl-x-map "7" #'vip-buffer-in-two-windows)
+ (global-set-key "\C-z" #'vip-change-mode-to-vi))
(defmacro vip-loop (count body)
"(COUNT BODY) Execute BODY COUNT times."
@@ -375,13 +367,13 @@ No message."
vip-emacs-local-map)))
(vip-change-mode-line "Insert")
(use-local-map vip-insert-local-map)
- (define-key vip-insert-local-map "\e" 'vip-change-mode-to-vi)
- (define-key vip-insert-local-map "\C-z" 'vip-ESC)
+ (define-key vip-insert-local-map "\e" #'vip-change-mode-to-vi)
+ (define-key vip-insert-local-map "\C-z" #'vip-ESC)
(define-key vip-insert-local-map "\C-h"
- (if vip-help-in-insert-mode 'help-command
- 'delete-backward-char))
+ (if vip-help-in-insert-mode #'help-command
+ #'delete-backward-char))
(define-key vip-insert-local-map "\C-w"
- 'vip-delete-backward-word))
+ #'vip-delete-backward-word))
((eq new-mode 'emacs-mode)
(vip-change-mode-line "Emacs:")
(use-local-map vip-emacs-local-map)))
@@ -461,13 +453,13 @@ Type `n' to quit this window for now.\n")
ARG is used as the prefix value for the executed command. If
EVENTS is a list of events, which become the beginning of the command."
(interactive "P")
- (let (com key (old-map (current-local-map)))
+ (let (com (old-map (current-local-map)))
(if events (setq unread-command-events
(append events unread-command-events)))
(setq prefix-arg arg)
(use-local-map vip-emacs-local-map)
(unwind-protect
- (setq com (key-binding (setq key (read-key-sequence nil))))
+ (setq com (key-binding (read-key-sequence nil)))
(use-local-map old-map))
(command-execute com prefix-arg)
(setq prefix-arg nil) ;; reset prefix arg
@@ -617,7 +609,7 @@ obtained so far, and COM is the command part obtained so far."
(defun vip-command-argument (arg)
"Accept a motion command as an argument."
(interactive "P")
- (condition-case conditions
+ (condition-case nil
(vip-prefix-arg-com
last-command-event
(cond ((null arg) nil)
@@ -918,11 +910,11 @@ each line in the region."
(defun vip-read-string (prompt &optional init)
(setq vip-save-minibuffer-local-map (copy-keymap minibuffer-local-map))
- (define-key minibuffer-local-map "\C-h" 'backward-char)
- (define-key minibuffer-local-map "\C-w" 'backward-word)
- (define-key minibuffer-local-map "\e" 'exit-minibuffer)
+ (define-key minibuffer-local-map "\C-h" #'backward-char)
+ (define-key minibuffer-local-map "\C-w" #'backward-word)
+ (define-key minibuffer-local-map "\e" #'exit-minibuffer)
(let (str)
- (condition-case conditions
+ (condition-case nil
(setq str (read-string prompt init))
(quit
(setq minibuffer-local-map vip-save-minibuffer-local-map)
@@ -2651,7 +2643,7 @@ a token has type \(command, address, end-mark) and value."
(progn
(with-output-to-temp-buffer " *delete text*"
(princ (buffer-substring (point) (mark))))
- (condition-case conditions
+ (condition-case nil
(vip-read-string "[Hit return to continue] ")
(quit
(save-excursion (kill-buffer " *delete text*"))
@@ -2759,7 +2751,7 @@ a token has type \(command, address, end-mark) and value."
(progn
(with-output-to-temp-buffer " *text*"
(princ (buffer-substring (point) (mark))))
- (condition-case conditions
+ (condition-case nil
(progn
(vip-read-string "[Hit return to continue] ")
(ex-line-subr com (point) (mark)))
@@ -2829,12 +2821,9 @@ a token has type \(command, address, end-mark) and value."
(define-key ex-map char
(or (lookup-key vip-mode-map char) 'vip-nil)))
(define-key vip-mode-map char
- (eval
- (list 'quote
- (cons 'lambda
- (list '(count)
- '(interactive "p")
- (list 'execute-kbd-macro string 'count))))))))
+ (lambda (count)
+ (interactive "p")
+ (execute-kbd-macro string count)))))
(defun ex-unmap ()
"ex unmap"
@@ -2892,10 +2881,7 @@ a token has type \(command, address, end-mark) and value."
(with-no-warnings
(insert-file file)))))
-(defun ex-set ()
- (eval (list 'setq
- (read-variable "Variable: ")
- (eval (read-minibuffer "Value: ")))))
+(defalias 'ex-set #'set-variable)
(defun ex-shell ()
"ex shell"
@@ -2935,7 +2921,7 @@ vip-s-string"
(setq ex-addresses (cons (car ex-addresses) ex-addresses)))))
;(setq G opt-g)
(let ((beg (car ex-addresses)) (end (car (cdr ex-addresses)))
- (cont t) eol-mark)
+ eol-mark) ;;(cont t)
(save-excursion
(vip-enlarge-region beg end)
(let ((limit (save-excursion
diff --git a/lisp/obsolete/ws-mode.el b/lisp/obsolete/ws-mode.el
index d1ced86c4687..235a1d7e43d5 100644
--- a/lisp/obsolete/ws-mode.el
+++ b/lisp/obsolete/ws-mode.el
@@ -41,144 +41,144 @@
(defvar wordstar-C-k-map
(let ((map (make-keymap)))
(define-key map " " ())
- (define-key map "0" 'ws-set-marker-0)
- (define-key map "1" 'ws-set-marker-1)
- (define-key map "2" 'ws-set-marker-2)
- (define-key map "3" 'ws-set-marker-3)
- (define-key map "4" 'ws-set-marker-4)
- (define-key map "5" 'ws-set-marker-5)
- (define-key map "6" 'ws-set-marker-6)
- (define-key map "7" 'ws-set-marker-7)
- (define-key map "8" 'ws-set-marker-8)
- (define-key map "9" 'ws-set-marker-9)
- (define-key map "b" 'ws-begin-block)
- (define-key map "\C-b" 'ws-begin-block)
- (define-key map "c" 'ws-copy-block)
- (define-key map "\C-c" 'ws-copy-block)
- (define-key map "d" 'save-buffers-kill-emacs)
- (define-key map "\C-d" 'save-buffers-kill-emacs)
- (define-key map "f" 'find-file)
- (define-key map "\C-f" 'find-file)
- (define-key map "h" 'ws-show-markers)
- (define-key map "\C-h" 'ws-show-markers)
- (define-key map "i" 'ws-indent-block)
- (define-key map "\C-i" 'ws-indent-block)
- (define-key map "k" 'ws-end-block)
- (define-key map "\C-k" 'ws-end-block)
- (define-key map "p" 'ws-print-block)
- (define-key map "\C-p" 'ws-print-block)
- (define-key map "q" 'kill-emacs)
- (define-key map "\C-q" 'kill-emacs)
- (define-key map "r" 'insert-file)
- (define-key map "\C-r" 'insert-file)
- (define-key map "s" 'save-some-buffers)
- (define-key map "\C-s" 'save-some-buffers)
- (define-key map "t" 'ws-mark-word)
- (define-key map "\C-t" 'ws-mark-word)
- (define-key map "u" 'ws-exdent-block)
- (define-key map "\C-u" 'keyboard-quit)
- (define-key map "v" 'ws-move-block)
- (define-key map "\C-v" 'ws-move-block)
- (define-key map "w" 'ws-write-block)
- (define-key map "\C-w" 'ws-write-block)
- (define-key map "x" 'save-buffers-kill-emacs)
- (define-key map "\C-x" 'save-buffers-kill-emacs)
- (define-key map "y" 'ws-delete-block)
- (define-key map "\C-y" 'ws-delete-block)
+ (define-key map "0" #'ws-set-marker-0)
+ (define-key map "1" #'ws-set-marker-1)
+ (define-key map "2" #'ws-set-marker-2)
+ (define-key map "3" #'ws-set-marker-3)
+ (define-key map "4" #'ws-set-marker-4)
+ (define-key map "5" #'ws-set-marker-5)
+ (define-key map "6" #'ws-set-marker-6)
+ (define-key map "7" #'ws-set-marker-7)
+ (define-key map "8" #'ws-set-marker-8)
+ (define-key map "9" #'ws-set-marker-9)
+ (define-key map "b" #'ws-begin-block)
+ (define-key map "\C-b" #'ws-begin-block)
+ (define-key map "c" #'ws-copy-block)
+ (define-key map "\C-c" #'ws-copy-block)
+ (define-key map "d" #'save-buffers-kill-emacs)
+ (define-key map "\C-d" #'save-buffers-kill-emacs)
+ (define-key map "f" #'find-file)
+ (define-key map "\C-f" #'find-file)
+ (define-key map "h" #'ws-show-markers)
+ (define-key map "\C-h" #'ws-show-markers)
+ (define-key map "i" #'ws-indent-block)
+ (define-key map "\C-i" #'ws-indent-block)
+ (define-key map "k" #'ws-end-block)
+ (define-key map "\C-k" #'ws-end-block)
+ (define-key map "p" #'ws-print-block)
+ (define-key map "\C-p" #'ws-print-block)
+ (define-key map "q" #'kill-emacs)
+ (define-key map "\C-q" #'kill-emacs)
+ (define-key map "r" #'insert-file)
+ (define-key map "\C-r" #'insert-file)
+ (define-key map "s" #'save-some-buffers)
+ (define-key map "\C-s" #'save-some-buffers)
+ (define-key map "t" #'ws-mark-word)
+ (define-key map "\C-t" #'ws-mark-word)
+ (define-key map "u" #'ws-exdent-block)
+ (define-key map "\C-u" #'keyboard-quit)
+ (define-key map "v" #'ws-move-block)
+ (define-key map "\C-v" #'ws-move-block)
+ (define-key map "w" #'ws-write-block)
+ (define-key map "\C-w" #'ws-write-block)
+ (define-key map "x" #'save-buffers-kill-emacs)
+ (define-key map "\C-x" #'save-buffers-kill-emacs)
+ (define-key map "y" #'ws-delete-block)
+ (define-key map "\C-y" #'ws-delete-block)
map))
(defvar wordstar-C-o-map
(let ((map (make-keymap)))
(define-key map " " ())
- (define-key map "c" 'wordstar-center-line)
- (define-key map "\C-c" 'wordstar-center-line)
- (define-key map "b" 'switch-to-buffer)
- (define-key map "\C-b" 'switch-to-buffer)
- (define-key map "j" 'justify-current-line)
- (define-key map "\C-j" 'justify-current-line)
- (define-key map "k" 'kill-buffer)
- (define-key map "\C-k" 'kill-buffer)
- (define-key map "l" 'list-buffers)
- (define-key map "\C-l" 'list-buffers)
- (define-key map "m" 'auto-fill-mode)
- (define-key map "\C-m" 'auto-fill-mode)
- (define-key map "r" 'set-fill-column)
- (define-key map "\C-r" 'set-fill-column)
- (define-key map "\C-u" 'keyboard-quit)
- (define-key map "wd" 'delete-other-windows)
- (define-key map "wh" 'split-window-right)
- (define-key map "wo" 'other-window)
- (define-key map "wv" 'split-window-below)
+ (define-key map "c" #'wordstar-center-line)
+ (define-key map "\C-c" #'wordstar-center-line)
+ (define-key map "b" #'switch-to-buffer)
+ (define-key map "\C-b" #'switch-to-buffer)
+ (define-key map "j" #'justify-current-line)
+ (define-key map "\C-j" #'justify-current-line)
+ (define-key map "k" #'kill-buffer)
+ (define-key map "\C-k" #'kill-buffer)
+ (define-key map "l" #'list-buffers)
+ (define-key map "\C-l" #'list-buffers)
+ (define-key map "m" #'auto-fill-mode)
+ (define-key map "\C-m" #'auto-fill-mode)
+ (define-key map "r" #'set-fill-column)
+ (define-key map "\C-r" #'set-fill-column)
+ (define-key map "\C-u" #'keyboard-quit)
+ (define-key map "wd" #'delete-other-windows)
+ (define-key map "wh" #'split-window-right)
+ (define-key map "wo" #'other-window)
+ (define-key map "wv" #'split-window-below)
map))
(defvar wordstar-C-q-map
(let ((map (make-keymap)))
(define-key map " " ())
- (define-key map "0" 'ws-find-marker-0)
- (define-key map "1" 'ws-find-marker-1)
- (define-key map "2" 'ws-find-marker-2)
- (define-key map "3" 'ws-find-marker-3)
- (define-key map "4" 'ws-find-marker-4)
- (define-key map "5" 'ws-find-marker-5)
- (define-key map "6" 'ws-find-marker-6)
- (define-key map "7" 'ws-find-marker-7)
- (define-key map "8" 'ws-find-marker-8)
- (define-key map "9" 'ws-find-marker-9)
- (define-key map "a" 'ws-query-replace)
- (define-key map "\C-a" 'ws-query-replace)
- (define-key map "b" 'ws-goto-block-begin)
- (define-key map "\C-b" 'ws-goto-block-begin)
- (define-key map "c" 'end-of-buffer)
- (define-key map "\C-c" 'end-of-buffer)
- (define-key map "d" 'end-of-line)
- (define-key map "\C-d" 'end-of-line)
- (define-key map "f" 'ws-search)
- (define-key map "\C-f" 'ws-search)
- (define-key map "k" 'ws-goto-block-end)
- (define-key map "\C-k" 'ws-goto-block-end)
- (define-key map "l" 'ws-undo)
- (define-key map "\C-l" 'ws-undo)
- (define-key map "p" 'ws-last-cursorp)
- (define-key map "\C-p" 'ws-last-cursorp)
- (define-key map "r" 'beginning-of-buffer)
- (define-key map "\C-r" 'beginning-of-buffer)
- (define-key map "s" 'beginning-of-line)
- (define-key map "\C-s" 'beginning-of-line)
- (define-key map "\C-u" 'keyboard-quit)
- (define-key map "w" 'ws-last-error)
- (define-key map "\C-w" 'ws-last-error)
- (define-key map "y" 'ws-kill-eol)
- (define-key map "\C-y" 'ws-kill-eol)
- (define-key map "\177" 'ws-kill-bol)
+ (define-key map "0" #'ws-find-marker-0)
+ (define-key map "1" #'ws-find-marker-1)
+ (define-key map "2" #'ws-find-marker-2)
+ (define-key map "3" #'ws-find-marker-3)
+ (define-key map "4" #'ws-find-marker-4)
+ (define-key map "5" #'ws-find-marker-5)
+ (define-key map "6" #'ws-find-marker-6)
+ (define-key map "7" #'ws-find-marker-7)
+ (define-key map "8" #'ws-find-marker-8)
+ (define-key map "9" #'ws-find-marker-9)
+ (define-key map "a" #'ws-query-replace)
+ (define-key map "\C-a" #'ws-query-replace)
+ (define-key map "b" #'ws-goto-block-begin)
+ (define-key map "\C-b" #'ws-goto-block-begin)
+ (define-key map "c" #'end-of-buffer)
+ (define-key map "\C-c" #'end-of-buffer)
+ (define-key map "d" #'end-of-line)
+ (define-key map "\C-d" #'end-of-line)
+ (define-key map "f" #'ws-search)
+ (define-key map "\C-f" #'ws-search)
+ (define-key map "k" #'ws-goto-block-end)
+ (define-key map "\C-k" #'ws-goto-block-end)
+ (define-key map "l" #'ws-undo)
+ (define-key map "\C-l" #'ws-undo)
+ ;; (define-key map "p" #'ws-last-cursorp)
+ ;; (define-key map "\C-p" #'ws-last-cursorp)
+ (define-key map "r" #'beginning-of-buffer)
+ (define-key map "\C-r" #'beginning-of-buffer)
+ (define-key map "s" #'beginning-of-line)
+ (define-key map "\C-s" #'beginning-of-line)
+ (define-key map "\C-u" #'keyboard-quit)
+ (define-key map "w" #'ws-last-error)
+ (define-key map "\C-w" #'ws-last-error)
+ (define-key map "y" #'ws-kill-eol)
+ (define-key map "\C-y" #'ws-kill-eol)
+ (define-key map "\177" #'ws-kill-bol)
map))
(defvar wordstar-mode-map
(let ((map (make-keymap)))
- (define-key map "\C-a" 'backward-word)
- (define-key map "\C-b" 'fill-paragraph)
- (define-key map "\C-c" 'scroll-up-command)
- (define-key map "\C-d" 'forward-char)
- (define-key map "\C-e" 'previous-line)
- (define-key map "\C-f" 'forward-word)
- (define-key map "\C-g" 'delete-char)
- (define-key map "\C-h" 'backward-char)
- (define-key map "\C-i" 'indent-for-tab-command)
- (define-key map "\C-j" 'help-for-help)
+ (define-key map "\C-a" #'backward-word)
+ (define-key map "\C-b" #'fill-paragraph)
+ (define-key map "\C-c" #'scroll-up-command)
+ (define-key map "\C-d" #'forward-char)
+ (define-key map "\C-e" #'previous-line)
+ (define-key map "\C-f" #'forward-word)
+ (define-key map "\C-g" #'delete-char)
+ (define-key map "\C-h" #'backward-char)
+ (define-key map "\C-i" #'indent-for-tab-command)
+ (define-key map "\C-j" #'help-for-help)
(define-key map "\C-k" wordstar-C-k-map)
- (define-key map "\C-l" 'ws-repeat-search)
- (define-key map "\C-n" 'open-line)
+ (define-key map "\C-l" #'ws-repeat-search)
+ (define-key map "\C-n" #'open-line)
(define-key map "\C-o" wordstar-C-o-map)
- (define-key map "\C-p" 'quoted-insert)
+ (define-key map "\C-p" #'quoted-insert)
(define-key map "\C-q" wordstar-C-q-map)
- (define-key map "\C-r" 'scroll-down-command)
- (define-key map "\C-s" 'backward-char)
- (define-key map "\C-t" 'kill-word)
- (define-key map "\C-u" 'keyboard-quit)
- (define-key map "\C-v" 'overwrite-mode)
- (define-key map "\C-w" 'scroll-down-line)
- (define-key map "\C-x" 'next-line)
- (define-key map "\C-y" 'kill-complete-line)
- (define-key map "\C-z" 'scroll-up-line)
+ (define-key map "\C-r" #'scroll-down-command)
+ (define-key map "\C-s" #'backward-char)
+ (define-key map "\C-t" #'kill-word)
+ (define-key map "\C-u" #'keyboard-quit)
+ (define-key map "\C-v" #'overwrite-mode)
+ (define-key map "\C-w" #'scroll-down-line)
+ (define-key map "\C-x" #'next-line)
+ (define-key map "\C-y" #'kill-complete-line)
+ (define-key map "\C-z" #'scroll-up-line)
map))
;; wordstar-C-j-map not yet implemented
diff --git a/lisp/obsolete/yow.el b/lisp/obsolete/yow.el
index 76485f989c17..ca8de4f92245 100644
--- a/lisp/obsolete/yow.el
+++ b/lisp/obsolete/yow.el
@@ -1,4 +1,4 @@
-;;; yow.el --- quote random zippyisms
+;;; yow.el --- quote random zippyisms -*- lexical-binding: t; -*-
;; Copyright (C) 1993-1995, 2000-2021 Free Software Foundation, Inc.
@@ -39,8 +39,7 @@
(defcustom yow-file (expand-file-name "yow.lines" data-directory)
"File containing pertinent pinhead phrases."
- :type 'file
- :group 'yow)
+ :type 'file)
(defconst yow-load-message "Am I CONSING yet?...")
(defconst yow-after-load-message "I have SEEN the CONSING!!")
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index b9799d2abe80..8a4aa2b1be07 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -3224,6 +3224,15 @@ s Search for keywords M Like m, but only TODO entries
(defvar org-agenda-overriding-cmd nil)
(defvar org-agenda-overriding-arguments nil)
(defvar org-agenda-overriding-cmd-arguments nil)
+
+(defun org-let (list &rest body) ;FIXME: So many kittens are suffering here.
+ (declare (indent 1))
+ (eval (cons 'let (cons list body))))
+
+(defun org-let2 (list1 list2 &rest body) ;FIXME: Where did our karma go?
+ (declare (indent 2))
+ (eval (cons 'let (cons list1 (list (cons 'let (cons list2 body)))))))
+
(defun org-agenda-run-series (name series)
"Run agenda NAME as a SERIES of agenda commands."
(org-let (nth 1 series) '(org-agenda-prepare name))
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el
index b7319d638ed1..31f5f78eae00 100644
--- a/lisp/org/org-element.el
+++ b/lisp/org/org-element.el
@@ -4206,6 +4206,7 @@ looking into captions:
(lambda (b)
(and (org-element-map b \\='latex-snippet #\\='identity nil t) b))
nil nil nil t)"
+ (declare (indent 2))
;; Ensure TYPES and NO-RECURSION are a list, even of one element.
(let* ((types (if (listp types) types (list types)))
(no-recursion (if (listp no-recursion) no-recursion
@@ -4299,7 +4300,6 @@ looking into captions:
(funcall --walk-tree data)
;; Return value in a proper order.
(nreverse --acc)))))
-(put 'org-element-map 'lisp-indent-function 2)
;; The following functions are internal parts of the parser.
;;
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index 56afdf6ef19a..ac6691db0d55 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -627,18 +627,10 @@ program is needed for, so that the error message can be more informative."
(let ((message-log-max nil))
(apply #'message args)))
-(defun org-let (list &rest body)
- (eval (cons 'let (cons list body))))
-(put 'org-let 'lisp-indent-function 1)
-
-(defun org-let2 (list1 list2 &rest body)
- (eval (cons 'let (cons list1 (list (cons 'let (cons list2 body)))))))
-(put 'org-let2 'lisp-indent-function 2)
-
(defun org-eval (form)
"Eval FORM and return result."
(condition-case error
- (eval form)
+ (eval form t)
(error (format "%%![Error: %s]" error))))
(defvar org-outline-regexp) ; defined in org.el
@@ -1241,31 +1233,29 @@ Return 0. if S is not recognized as a valid value."
When ADDITIONAL-KEYS is not nil, also include SPC and DEL in the
allowed keys for scrolling, as expected in the export dispatch
window."
- (let ((scrlup (if additional-keys '(?\s 22) 22))
- (scrldn (if additional-keys `(?\d 134217846) 134217846)))
- (eval
- `(cl-case ,key
- ;; C-n
- (14 (if (not (pos-visible-in-window-p (point-max)))
- (ignore-errors (scroll-up 1))
- (message "End of buffer")
- (sit-for 1)))
- ;; C-p
- (16 (if (not (pos-visible-in-window-p (point-min)))
- (ignore-errors (scroll-down 1))
- (message "Beginning of buffer")
- (sit-for 1)))
- ;; SPC or
- (,scrlup
- (if (not (pos-visible-in-window-p (point-max)))
- (scroll-up nil)
- (message "End of buffer")
- (sit-for 1)))
- ;; DEL
- (,scrldn (if (not (pos-visible-in-window-p (point-min)))
- (scroll-down nil)
- (message "Beginning of buffer")
- (sit-for 1)))))))
+ (let ((scrlup (if additional-keys '(?\s ?\C-v) ?\C-v))
+ (scrldn (if additional-keys `(?\d ?\M-v) ?\M-v)))
+ (pcase key
+ (?\C-n (if (not (pos-visible-in-window-p (point-max)))
+ (ignore-errors (scroll-up 1))
+ (message "End of buffer")
+ (sit-for 1)))
+ (?\C-p (if (not (pos-visible-in-window-p (point-min)))
+ (ignore-errors (scroll-down 1))
+ (message "Beginning of buffer")
+ (sit-for 1)))
+ ;; SPC or
+ ((guard (memq key scrlup))
+ (if (not (pos-visible-in-window-p (point-max)))
+ (scroll-up nil)
+ (message "End of buffer")
+ (sit-for 1)))
+ ;; DEL
+ ((guard (memq key scrldn))
+ (if (not (pos-visible-in-window-p (point-min)))
+ (scroll-down nil)
+ (message "Beginning of buffer")
+ (sit-for 1))))))
(provide 'org-macs)
diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el
index dc93ef903102..50f65a1215ee 100644
--- a/lisp/play/bubbles.el
+++ b/lisp/play/bubbles.el
@@ -772,117 +772,46 @@ static char * dot3d_xpm[] = {
(defun bubbles-set-graphics-theme-ascii ()
"Set graphics theme to `ascii'."
- (interactive)
+ (interactive nil bubbles-mode)
(setq bubbles-graphics-theme 'ascii)
(bubbles--update-faces-or-images))
(defun bubbles-set-graphics-theme-circles ()
"Set graphics theme to `circles'."
- (interactive)
+ (interactive nil bubbles-mode)
(setq bubbles-graphics-theme 'circles)
(bubbles--initialize-images)
(bubbles--update-faces-or-images))
(defun bubbles-set-graphics-theme-squares ()
"Set graphics theme to `squares'."
- (interactive)
+ (interactive nil bubbles-mode)
(setq bubbles-graphics-theme 'squares)
(bubbles--initialize-images)
(bubbles--update-faces-or-images))
(defun bubbles-set-graphics-theme-diamonds ()
"Set graphics theme to `diamonds'."
- (interactive)
+ (interactive nil bubbles-mode)
(setq bubbles-graphics-theme 'diamonds)
(bubbles--initialize-images)
(bubbles--update-faces-or-images))
(defun bubbles-set-graphics-theme-balls ()
"Set graphics theme to `balls'."
- (interactive)
+ (interactive nil bubbles-mode)
(setq bubbles-graphics-theme 'balls)
(bubbles--initialize-images)
(bubbles--update-faces-or-images))
(defun bubbles-set-graphics-theme-emacs ()
"Set graphics theme to `emacs'."
- (interactive)
+ (interactive nil bubbles-mode)
(setq bubbles-graphics-theme 'emacs)
(bubbles--initialize-images)
(bubbles--update-faces-or-images))
-;; game theme menu
-(defvar bubbles-game-theme-menu
- (let ((menu (make-sparse-keymap "Game Theme")))
- (define-key menu [bubbles-set-game-userdefined]
- (list 'menu-item "User defined" 'bubbles-set-game-userdefined
- :button '(:radio . (eq bubbles-game-theme 'user-defined))))
- (define-key menu [bubbles-set-game-hard]
- (list 'menu-item "Hard" 'bubbles-set-game-hard
- :button '(:radio . (eq bubbles-game-theme 'hard))))
- (define-key menu [bubbles-set-game-difficult]
- (list 'menu-item "Difficult" 'bubbles-set-game-difficult
- :button '(:radio . (eq bubbles-game-theme 'difficult))))
- (define-key menu [bubbles-set-game-medium]
- (list 'menu-item "Medium" 'bubbles-set-game-medium
- :button '(:radio . (eq bubbles-game-theme 'medium))))
- (define-key menu [bubbles-set-game-easy]
- (list 'menu-item "Easy" 'bubbles-set-game-easy
- :button '(:radio . (eq bubbles-game-theme 'easy))))
- menu)
- "Map for bubbles game theme menu.")
-
-;; graphics theme menu
-(defvar bubbles-graphics-theme-menu
- (let ((menu (make-sparse-keymap "Graphics Theme")))
- (define-key menu [bubbles-set-graphics-theme-ascii]
- (list 'menu-item "ASCII" 'bubbles-set-graphics-theme-ascii
- :button '(:radio . (eq bubbles-graphics-theme 'ascii))))
- (define-key menu [bubbles-set-graphics-theme-emacs]
- (list 'menu-item "Emacs" 'bubbles-set-graphics-theme-emacs
- :button '(:radio . (eq bubbles-graphics-theme 'emacs))))
- (define-key menu [bubbles-set-graphics-theme-balls]
- (list 'menu-item "Balls" 'bubbles-set-graphics-theme-balls
- :button '(:radio . (eq bubbles-graphics-theme 'balls))))
- (define-key menu [bubbles-set-graphics-theme-diamonds]
- (list 'menu-item "Diamonds" 'bubbles-set-graphics-theme-diamonds
- :button '(:radio . (eq bubbles-graphics-theme 'diamonds))))
- (define-key menu [bubbles-set-graphics-theme-squares]
- (list 'menu-item "Squares" 'bubbles-set-graphics-theme-squares
- :button '(:radio . (eq bubbles-graphics-theme 'squares))))
- (define-key menu [bubbles-set-graphics-theme-circles]
- (list 'menu-item "Circles" 'bubbles-set-graphics-theme-circles
- :button '(:radio . (eq bubbles-graphics-theme 'circles))))
- menu)
- "Map for bubbles graphics theme menu.")
-
-;; menu
-(defvar bubbles-menu
- (let ((menu (make-sparse-keymap "Bubbles")))
- (define-key menu [bubbles-quit]
- (list 'menu-item "Quit" 'bubbles-quit))
- (define-key menu [bubbles]
- (list 'menu-item "New game" 'bubbles))
- (define-key menu [bubbles-separator-1]
- '("--"))
- (define-key menu [bubbles-save-settings]
- (list 'menu-item "Save all settings" 'bubbles-save-settings))
- (define-key menu [bubbles-customize]
- (list 'menu-item "Edit all settings" 'bubbles-customize))
- (define-key menu [bubbles-game-theme-menu]
- (list 'menu-item "Game Theme" bubbles-game-theme-menu))
- (define-key menu [bubbles-graphics-theme-menu]
- (list 'menu-item "Graphics Theme" bubbles-graphics-theme-menu
- :enable 'bubbles--playing))
- (define-key menu [bubbles-separator-2]
- '("--"))
- (define-key menu [bubbles-undo]
- (list 'menu-item "Undo last move" 'bubbles-undo
- :enable '(and bubbles--playing (listp buffer-undo-list))))
- menu)
- "Map for bubbles menu.")
-
-;; bubbles mode map
+
(defvar bubbles-mode-map
(let ((map (make-sparse-keymap 'bubbles-mode-map)))
;; (suppress-keymap map t)
@@ -897,12 +826,59 @@ static char * dot3d_xpm[] = {
(define-key map "n" 'next-line)
(define-key map "f" 'forward-char)
(define-key map "b" 'backward-char)
- ;; bind menu to mouse
- (define-key map [down-mouse-3] bubbles-menu)
- ;; Put menu in menu-bar
- (define-key map [menu-bar Bubbles] (cons "Bubbles" bubbles-menu))
map)
- "Mode map for bubbles.")
+ "Mode map for `bubbles'.")
+
+(easy-menu-define bubbles-menu bubbles-mode-map
+ "Menu for `bubbles'."
+ '("Bubbles"
+ ["Undo last move" bubbles-undo
+ :enable '(and bubbles--playing (listp buffer-undo-list))]
+ "---"
+ ("Graphics Theme"
+ :enable bubbles--playing
+ ["Circles" bubbles-set-graphics-theme-circles
+ :style radio
+ :selected (eq bubbles-graphics-theme 'circles)]
+ ["Squares" bubbles-set-graphics-theme-squares
+ :style radio
+ :selected (eq bubbles-graphics-theme 'squares)]
+ ["Diamonds" bubbles-set-graphics-theme-diamonds
+ :style radio
+ :selected (eq bubbles-graphics-theme 'diamonds)]
+ ["Balls" bubbles-set-graphics-theme-balls
+ :style radio
+ :selected (eq bubbles-graphics-theme 'balls)]
+ ["Emacs" bubbles-set-graphics-theme-emacs
+ :style radio
+ :selected (eq bubbles-graphics-theme 'emacs)]
+ ["ASCII" bubbles-set-graphics-theme-ascii
+ :style radio
+ :selected (eq bubbles-graphics-theme 'ascii)])
+ ("Game Theme"
+ ["Easy" bubbles-set-game-easy
+ :style radio
+ :selected (eq bubbles-game-theme 'easy)]
+ ["Medium" bubbles-set-game-medium
+ :style radio
+ :selected (eq bubbles-game-theme 'medium)]
+ ["Difficult" bubbles-set-game-difficult
+ :style radio
+ :selected (eq bubbles-game-theme 'difficult)]
+ ["Hard" bubbles-set-game-hard
+ :style radio
+ :selected (eq bubbles-game-theme 'hard)]
+ ["User defined" bubbles-set-game-userdefined
+ :style radio
+ :selected (eq bubbles-game-theme 'user-defined)])
+ ["Edit all settings" bubbles-customize]
+ ["Save all settings" bubbles-save-settings]
+ "---"
+ ["New game" bubbles]
+ ["Quit" bubbles-quit]))
+
+;; bind menu to mouse
+(define-key bubbles-mode-map [down-mouse-3] bubbles-menu)
(define-derived-mode bubbles-mode nil "Bubbles"
"Major mode for playing bubbles.
@@ -938,7 +914,7 @@ columns on its right towards the left.
(defun bubbles-quit ()
"Quit Bubbles."
- (interactive)
+ (interactive nil bubbles-mode)
(message "bubbles-quit")
(bury-buffer))
@@ -1189,7 +1165,7 @@ Use optional parameter POS instead of point if given."
(defun bubbles-plop ()
"Remove active bubbles region."
- (interactive)
+ (interactive nil bubbles-mode)
(when (and bubbles--playing
(> bubbles--neighborhood-score 0))
(setq bubbles--save-data (list bubbles--score (buffer-string)))
@@ -1273,7 +1249,7 @@ Use optional parameter POS instead of point if given."
(defun bubbles-undo ()
"Undo last move."
- (interactive)
+ (interactive nil bubbles-mode)
(when bubbles--save-data
(let ((inhibit-read-only t)
(pos (point)))
diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el
index 9b2626b19da8..47ed6e28b581 100644
--- a/lisp/play/decipher.el
+++ b/lisp/play/decipher.el
@@ -292,7 +292,7 @@ The most useful commands are:
(defun decipher-keypress ()
"Enter a plaintext or ciphertext character."
- (interactive)
+ (interactive nil decipher-mode)
(let ((decipher-function 'decipher-set-map)
buffer-read-only) ;Make buffer writable
(save-excursion
@@ -346,7 +346,7 @@ The most useful commands are:
(defun decipher-undo ()
"Undo a change in Decipher mode."
- (interactive)
+ (interactive nil decipher-mode)
;; If we don't get all the way thru, make last-command indicate that
;; for the following command.
(setq this-command t)
@@ -487,7 +487,7 @@ The most useful commands are:
This records the current alphabet so you can return to it later.
You may have any number of checkpoints.
Type `\\[decipher-restore-checkpoint]' to restore a checkpoint."
- (interactive "sCheckpoint description: ")
+ (interactive "sCheckpoint description: " decipher-mode)
(or (stringp desc)
(setq desc ""))
(let (alphabet
@@ -514,7 +514,7 @@ If point is not on a checkpoint line, moves to the first checkpoint line.
If point is on a checkpoint, restores that checkpoint.
Type `\\[decipher-make-checkpoint]' to make a checkpoint."
- (interactive)
+ (interactive nil decipher-mode)
(beginning-of-line)
(if (looking-at "%!\\([A-Z ]+\\)!")
;; Restore this checkpoint:
@@ -542,7 +542,7 @@ Type `\\[decipher-make-checkpoint]' to make a checkpoint."
This fills any blanks in the cipher alphabet with the unused letters
in alphabetical order. Use this when you have a keyword cipher and
you have determined the keyword."
- (interactive)
+ (interactive nil decipher-mode)
(let ((cipher-char ?A)
(ptr decipher-alphabet)
buffer-read-only ;Make buffer writable
@@ -559,7 +559,7 @@ you have determined the keyword."
(defun decipher-show-alphabet ()
"Display the current cipher alphabet in the message line."
- (interactive)
+ (interactive nil decipher-mode)
(message "%s"
(mapconcat (lambda (a)
(concat
@@ -572,7 +572,7 @@ you have determined the keyword."
"Reprocess the buffer using the alphabet from the top.
This regenerates all deciphered plaintext and clears the undo list.
You should use this if you edit the ciphertext."
- (interactive)
+ (interactive nil decipher-mode)
(message "Reprocessing buffer...")
(let (alphabet
buffer-read-only ;Make buffer writable
@@ -616,13 +616,13 @@ You should use this if you edit the ciphertext."
(defun decipher-frequency-count ()
"Display the frequency count in the statistics buffer."
- (interactive)
+ (interactive nil decipher-mode)
(decipher-analyze)
(decipher-display-regexp "^A" "^[A-Z][A-Z]"))
(defun decipher-digram-list ()
"Display the list of digrams in the statistics buffer."
- (interactive)
+ (interactive nil decipher-mode)
(decipher-analyze)
(decipher-display-regexp "[A-Z][A-Z] +[0-9]" "^$"))
@@ -639,7 +639,7 @@ words, and ends 3 words (`*' represents a space). X comes before 8
different letters, after 7 different letters, and is next to a total
of 11 different letters. It occurs 14 times, making up 9% of the
ciphertext."
- (interactive (list (upcase (following-char))))
+ (interactive (list (upcase (following-char))) decipher-mode)
(decipher-analyze)
(let (start end)
(with-current-buffer (decipher-stats-buffer)
diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el
index 98da26c2e6cd..3cc5d9c8dce0 100644
--- a/lisp/play/handwrite.el
+++ b/lisp/play/handwrite.el
@@ -90,7 +90,7 @@
(define-key map [handwrite] '("Write by hand" . handwrite))
map))
(fset 'menu-bar-handwrite-map menu-bar-handwrite-map)
-
+(make-obsolete-variable 'menu-bar-handwrite-map nil "28.1")
;; User definable variables
diff --git a/lisp/play/snake.el b/lisp/play/snake.el
index bed7cea6ee5e..29effa234603 100644
--- a/lisp/play/snake.el
+++ b/lisp/play/snake.el
@@ -336,38 +336,38 @@ Argument SNAKE-BUFFER is the name of the buffer."
(defun snake-move-left ()
"Make the snake move left."
- (interactive)
+ (interactive nil snake-mode)
(when (zerop (snake-final-x-velocity))
(push '(-1 0) snake-velocity-queue)))
(defun snake-move-right ()
"Make the snake move right."
- (interactive)
+ (interactive nil snake-mode)
(when (zerop (snake-final-x-velocity))
(push '(1 0) snake-velocity-queue)))
(defun snake-move-up ()
"Make the snake move up."
- (interactive)
+ (interactive nil snake-mode)
(when (zerop (snake-final-y-velocity))
(push '(0 -1) snake-velocity-queue)))
(defun snake-move-down ()
"Make the snake move down."
- (interactive)
+ (interactive nil snake-mode)
(when (zerop (snake-final-y-velocity))
(push '(0 1) snake-velocity-queue)))
(defun snake-end-game ()
"Terminate the current game."
- (interactive)
+ (interactive nil snake-mode)
(gamegrid-kill-timer)
(use-local-map snake-null-map)
(gamegrid-add-score snake-score-file snake-score))
(defun snake-start-game ()
"Start a new game of Snake."
- (interactive)
+ (interactive nil snake-mode)
(snake-reset-game)
(snake-set-dot)
(use-local-map snake-mode-map)
@@ -375,7 +375,7 @@ Argument SNAKE-BUFFER is the name of the buffer."
(defun snake-pause-game ()
"Pause (or resume) the current game."
- (interactive)
+ (interactive nil snake-mode)
(setq snake-paused (not snake-paused))
(message (and snake-paused "Game paused (press p to resume)")))
@@ -386,6 +386,7 @@ Argument SNAKE-BUFFER is the name of the buffer."
(define-derived-mode snake-mode special-mode "Snake"
"A mode for playing Snake."
+ :interactive nil
(add-hook 'kill-buffer-hook 'gamegrid-kill-timer nil t)
diff --git a/lisp/play/tetris.el b/lisp/play/tetris.el
index 05e4ffe01119..f43aa47326f2 100644
--- a/lisp/play/tetris.el
+++ b/lisp/play/tetris.el
@@ -506,7 +506,7 @@ Drops the shape one square, testing for collision."
(defun tetris-move-bottom ()
"Drop the shape to the bottom of the playing area."
- (interactive)
+ (interactive nil tetris-mode)
(unless tetris-paused
(let ((hit nil))
(tetris-erase-shape)
@@ -519,7 +519,7 @@ Drops the shape one square, testing for collision."
(defun tetris-move-left ()
"Move the shape one square to the left."
- (interactive)
+ (interactive nil tetris-mode)
(unless tetris-paused
(tetris-erase-shape)
(setq tetris-pos-x (1- tetris-pos-x))
@@ -529,7 +529,7 @@ Drops the shape one square, testing for collision."
(defun tetris-move-right ()
"Move the shape one square to the right."
- (interactive)
+ (interactive nil tetris-mode)
(unless tetris-paused
(tetris-erase-shape)
(setq tetris-pos-x (1+ tetris-pos-x))
@@ -539,7 +539,7 @@ Drops the shape one square, testing for collision."
(defun tetris-move-down ()
"Move the shape one square to the bottom."
- (interactive)
+ (interactive nil tetris-mode)
(unless tetris-paused
(tetris-erase-shape)
(setq tetris-pos-y (1+ tetris-pos-y))
@@ -549,7 +549,7 @@ Drops the shape one square, testing for collision."
(defun tetris-rotate-prev ()
"Rotate the shape clockwise."
- (interactive)
+ (interactive nil tetris-mode)
(unless tetris-paused
(tetris-erase-shape)
(setq tetris-rot (% (+ 1 tetris-rot)
@@ -561,7 +561,7 @@ Drops the shape one square, testing for collision."
(defun tetris-rotate-next ()
"Rotate the shape anticlockwise."
- (interactive)
+ (interactive nil tetris-mode)
(unless tetris-paused
(tetris-erase-shape)
(setq tetris-rot (% (+ 3 tetris-rot)
@@ -573,14 +573,14 @@ Drops the shape one square, testing for collision."
(defun tetris-end-game ()
"Terminate the current game."
- (interactive)
+ (interactive nil tetris-mode)
(gamegrid-kill-timer)
(use-local-map tetris-null-map)
(gamegrid-add-score tetris-score-file tetris-score))
(defun tetris-start-game ()
"Start a new game of Tetris."
- (interactive)
+ (interactive nil tetris-mode)
(tetris-reset-game)
(use-local-map tetris-mode-map)
(let ((period (or (tetris-get-tick-period)
@@ -589,7 +589,7 @@ Drops the shape one square, testing for collision."
(defun tetris-pause-game ()
"Pause (or resume) the current game."
- (interactive)
+ (interactive nil tetris-mode)
(setq tetris-paused (not tetris-paused))
(message (and tetris-paused "Game paused (press p to resume)")))
@@ -600,6 +600,7 @@ Drops the shape one square, testing for collision."
(define-derived-mode tetris-mode nil "Tetris"
"A mode for playing Tetris."
+ :interactive nil
(add-hook 'kill-buffer-hook 'gamegrid-kill-timer nil t)
diff --git a/lisp/plstore.el b/lisp/plstore.el
index 46533664d524..4ca5886bf15e 100644
--- a/lisp/plstore.el
+++ b/lisp/plstore.el
@@ -1,4 +1,5 @@
;;; plstore.el --- secure plist store -*- lexical-binding: t -*-
+
;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
;; Author: Daiki Ueno
@@ -19,7 +20,7 @@
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see .
-;;; Commentary
+;;; Commentary:
;; Plist based data store providing search and partial encryption.
;;
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index d92c8c35b1b9..d569bf898c9d 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -1,4 +1,4 @@
-;;; antlr-mode.el --- major mode for ANTLR grammar files
+;;; antlr-mode.el --- major mode for ANTLR grammar files -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
@@ -87,95 +87,13 @@
(require 'easymenu)
(require 'cc-mode)
-;; Just to get the rid of the byte compiler warning. The code for
-;; this function and its friends are too complex for their own good.
-(declare-function cond-emacs-xemacs-macfn "antlr-mode" (args &optional msg))
-
-;; General Emacs/XEmacs-compatibility compile-time macros
-(eval-when-compile
- (defmacro cond-emacs-xemacs (&rest args)
- (cond-emacs-xemacs-macfn
- args "`cond-emacs-xemacs' must return exactly one element"))
- (defun cond-emacs-xemacs-macfn (args &optional msg)
- (if (atom args) args
- (and (eq (car args) :@) (null msg) ; (:@ ...spliced...)
- (setq args (cdr args)
- msg "(:@ ....) must return exactly one element"))
- (let ((ignore (if (featurep 'xemacs) :EMACS :XEMACS))
- (mode :BOTH) code)
- (while (consp args)
- (if (memq (car args) '(:EMACS :XEMACS :BOTH)) (setq mode (pop args)))
- (if (atom args)
- (or args (error "Used selector %s without elements" mode))
- (or (eq ignore mode)
- (push (cond-emacs-xemacs-macfn (car args)) code))
- (pop args)))
- (cond (msg (if (or args (cdr code)) (error msg) (car code)))
- ((or (null args) (eq ignore mode)) (nreverse code))
- (t (nconc (nreverse code) args))))))
- ;; Emacs/XEmacs-compatibility `defun': remove interactive "_" for Emacs, use
- ;; existing functions when they are `fboundp', provide shortcuts if they are
- ;; known to be defined in a specific Emacs branch (for short .elc)
- (defmacro defunx (name arglist &rest definition)
- (let ((xemacsp (featurep 'xemacs)) reuses)
- (while (memq (car definition)
- '(:try :emacs-and-try :xemacs-and-try))
- (if (eq (pop definition) (if xemacsp :xemacs-and-try :emacs-and-try))
- (setq reuses (car definition)
- definition nil)
- (push (pop definition) reuses)))
- (if (and reuses (symbolp reuses))
- `(defalias ',name ',reuses)
- (let* ((docstring (if (stringp (car definition)) (pop definition)))
- (spec (and (not xemacsp)
- (eq (car-safe (car definition)) 'interactive)
- (null (cddar definition))
- (cadar definition))))
- (if (and (stringp spec)
- (not (string-equal spec ""))
- (eq (aref spec 0) ?_))
- (setq definition
- (cons (if (string-equal spec "_")
- '(interactive)
- `(interactive ,(substring spec 1)))
- (cdr definition))))
- (if (null reuses)
- `(defun ,name ,arglist ,docstring
- ,@(cond-emacs-xemacs-macfn definition))
- ;; no dynamic docstring in this case
- `(eval-and-compile ; no warnings in Emacs
- (defalias ',name
- (cond ,@(mapcar (lambda (func) `((fboundp ',func) ',func))
- (nreverse reuses))
- (t ,(if definition
- `(lambda ,arglist ,docstring
- ,@(cond-emacs-xemacs-macfn definition))
- 'ignore))))))))))
- (defmacro ignore-errors-x (&rest body)
- (let ((specials '((scan-sexps . 4) (scan-lists . 5)))
- spec nils)
- (if (and (featurep 'xemacs)
- (null (cdr body)) (consp (car body))
- (setq spec (assq (caar body) specials))
- (>= (setq nils (- (cdr spec) (length (car body)))) 0))
- `(,@(car body) ,@(make-list nils nil) t)
- `(ignore-errors ,@body)))))
-
;; More compile-time-macros
(eval-when-compile
(defmacro save-buffer-state-x (&rest body) ; similar to EMACS/lazy-lock.el
- (let ((modified (with-no-warnings (gensym "save-buffer-state-x-modified-"))))
- `(let ((,modified (buffer-modified-p)))
- (unwind-protect
- (let ((buffer-undo-list t) (inhibit-read-only t)
- ,@(unless (featurep 'xemacs)
- '((inhibit-point-motion-hooks t) deactivate-mark))
- (inhibit-modification-hooks t)
- buffer-file-name buffer-file-truename)
- ,@body)
- (and (not ,modified) (buffer-modified-p)
- (set-buffer-modified-p nil)))))))
-(put 'save-buffer-state-x 'lisp-indent-function 0)
+ (declare (debug t) (indent 0))
+ `(let ((inhibit-point-motion-hooks t))
+ (with-silent-modifications
+ ,@body))))
(defvar outline-level)
(defvar imenu-use-markers)
@@ -188,7 +106,7 @@
;; Additional to the `defalias' below, we must set `antlr-c-forward-sws' to
;; `c-forward-syntactic-ws' when `c-forward-sws' is not defined after requiring
;; cc-mode.
-(defalias 'antlr-c-forward-sws 'c-forward-sws)
+(defalias 'antlr-c-forward-sws #'c-forward-sws)
;;;;##########################################################################
@@ -231,7 +149,6 @@ value of `antlr-language' if the first group in the string matched by
REGEXP in `antlr-language-limit-n-regexp' is one of the OPTION-VALUEs.
An OPTION-VALUE of nil denotes the fallback element. MODELINE-STRING is
also displayed in the mode line next to \"Antlr\"."
- :group 'antlr
:type '(repeat (group :value (java-mode "")
(function :tag "Major mode")
(string :tag "Mode line string")
@@ -245,7 +162,6 @@ also displayed in the mode line next to \"Antlr\"."
Looks like \(LIMIT . REGEXP). Search for REGEXP from the beginning of
the buffer to LIMIT and use the first group in the matched string to set
the language according to `antlr-language-alist'."
- :group 'antlr
:type '(cons (choice :tag "Limit" (const :tag "No" nil) (integer :value 0))
regexp))
@@ -259,7 +175,6 @@ the language according to `antlr-language-alist'."
If nil, the actions with their surrounding braces are hidden. If a
number, do not hide the braces, only hide the contents if its length is
greater than this number."
- :group 'antlr
:type '(choice (const :tag "Completely hidden" nil)
(integer :tag "Hidden if longer than" :value 3)))
@@ -268,7 +183,6 @@ greater than this number."
If nil, no continuation line of a block comment is changed. If t, they
are changed according to `c-indentation-line'. When not nil and not t,
they are only changed by \\[antlr-indent-command]."
- :group 'antlr
:type '(radio (const :tag "No" nil)
(const :tag "Always" t)
(sexp :tag "With TAB" :format "%t" :value tab)))
@@ -282,7 +196,6 @@ The first element whose MAJOR-MODE is nil or equal to `major-mode' and
whose REGEXP is nil or matches variable `buffer-file-name' is used to
set `tab-width' and `indent-tabs-mode'. This is useful to support both
ANTLR's and Java's indentation styles. Used by `antlr-set-tabs'."
- :group 'antlr
:type '(repeat (group :value (antlr-mode nil 8 nil)
(choice (const :tag "All" nil)
(function :tag "Major mode"))
@@ -294,14 +207,12 @@ ANTLR's and Java's indentation styles. Used by `antlr-set-tabs'."
"If non-nil, cc-mode indentation style used for `antlr-mode'.
See `c-set-style' and for details, where the most interesting part in
`c-style-alist' is the value of `c-basic-offset'."
- :group 'antlr
:type '(choice (const nil) regexp))
(defcustom antlr-indent-item-regexp
"[]}):;|&]" ; & is local ANTLR extension (SGML's and-connector)
"Regexp matching lines which should be indented by one TAB less.
See `antlr-indent-line' and command \\[antlr-indent-command]."
- :group 'antlr
:type 'regexp)
(defcustom antlr-indent-at-bol-alist
@@ -316,7 +227,6 @@ If `antlr-language' equals to a MODE, the line starting at the first
non-whitespace is matched by the corresponding REGEXP, and the line is
part of a header action, indent the line at column 0 instead according
to the normal rules of `antlr-indent-line'."
- :group 'antlr
:type '(repeat (cons (function :tag "Major mode") regexp)))
;; adopt indentation to cc-engine
@@ -337,7 +247,6 @@ to the normal rules of `antlr-indent-line'."
"Non-nil, if the major mode menu should include option submenus.
If nil, the menu just includes a command to insert options. Otherwise,
it includes four submenus to insert file/grammar/rule/subrule options."
- :group 'antlr
:type 'boolean)
(defcustom antlr-tool-version 20701
@@ -349,7 +258,6 @@ version correct option values when using \\[antlr-insert-option].
Don't use a number smaller than 20600 since the stored history of
Antlr's options starts with v2.06.00, see `antlr-options-alists'. You
can make this variable buffer-local."
- :group 'antlr
:type 'integer)
(defcustom antlr-options-auto-colon t
@@ -358,7 +266,6 @@ A `:' is only inserted if this value is non-nil, if a rule or subrule
option is inserted with \\[antlr-insert-option], if there was no rule or
subrule options section before, and if a `:' is not already present
after the section, ignoring whitespace, comments and the init action."
- :group 'antlr
:type 'boolean)
(defcustom antlr-options-style nil
@@ -369,7 +276,6 @@ identifier.
The only style symbol used in the default value of `antlr-options-alist'
is `language-as-string'. See also `antlr-read-value'."
- :group 'antlr
:type '(repeat (symbol :tag "Style symbol")))
(defcustom antlr-options-push-mark t
@@ -380,7 +286,6 @@ number, only set mark if point was outside the options area before and
the number of lines between point and the insert position is greater
than this value. Otherwise, only set mark if point was outside the
options area before."
- :group 'antlr
:type '(radio (const :tag "No" nil)
(const :tag "Always" t)
(integer :tag "Lines between" :value 10)
@@ -391,7 +296,6 @@ options area before."
This string is only used if the option to insert did not exist before
or if there was no `=' after it. In other words, the spacing around an
existing `=' won't be changed when changing an option value."
- :group 'antlr
:type 'string)
@@ -576,13 +480,11 @@ AS-STRING is non-nil and is either t or a symbol which is a member of
"Command used in \\[antlr-run-tool] to run the Antlr tool.
This variable should include all options passed to Antlr except the
option \"-glib\" which is automatically suggested if necessary."
- :group 'antlr
:type 'string)
(defcustom antlr-ask-about-save t
"If not nil, \\[antlr-run-tool] asks which buffers to save.
Otherwise, it saves all modified buffers before running without asking."
- :group 'antlr
:type 'boolean)
(defcustom antlr-makefile-specification
@@ -604,7 +506,6 @@ Then, GEN-VAR is a string with the name of the variable which contains
the file names of all makefile rules. GEN-VAR-FORMAT is a format string
producing the variable of each target with substitution COUNT/%d where
COUNT starts with 1. GEN-SEP is used to separate long variable values."
- :group 'antlr
:type '(list (string :tag "Rule separator")
(choice
(const :tag "Direct targets" nil)
@@ -683,7 +584,6 @@ DIRECTORY is the name of the current directory.")
"Non-nil, if a \"Index\" menu should be added to the menubar.
If it is a string, it is used instead \"Index\". Requires package
imenu."
- :group 'antlr
:type '(choice (const :tag "No menu" nil)
(const :tag "Index menu" t)
(string :tag "Other menu name")))
@@ -719,9 +619,7 @@ imenu."
(easy-menu-define antlr-mode-menu antlr-mode-map
"Major mode menu."
`("Antlr"
- ,@(if (cond-emacs-xemacs
- :EMACS antlr-options-use-submenus
- :XEMACS antlr-options-use-submenus)
+ ,@(if antlr-options-use-submenus
`(("Insert File Option"
:filter ,(lambda (x) (antlr-options-menu-filter 1 x)))
("Insert Grammar Option"
@@ -780,7 +678,6 @@ bound to `antlr-language'. For example, with value
((java-mode . 2) (c++-mode . 0))
Java actions are fontified with level 2 and C++ actions are not
fontified at all."
- :group 'antlr
:type '(choice (const :tag "None" none)
(const :tag "Inherit" inherit)
(const :tag "Default" nil)
@@ -824,62 +721,49 @@ in the grammar's actions and semantic predicates, see
(defface antlr-default '((t nil))
"Face to prevent strings from language dependent highlighting.
-Do not change."
- :group 'antlr)
+Do not change.")
(defface antlr-keyword
- (cond-emacs-xemacs
- '((((class color) (background light))
- (:foreground "black" :EMACS :weight bold :XEMACS :bold t))
- (t :inherit font-lock-keyword-face)))
- "ANTLR keywords."
- :group 'antlr)
+ '((((class color) (background light))
+ (:foreground "black" :weight bold))
+ (t :inherit font-lock-keyword-face))
+ "ANTLR keywords.")
(defface antlr-syntax
- (cond-emacs-xemacs
- '((((class color) (background light))
- (:foreground "black" :EMACS :weight bold :XEMACS :bold t))
- (t :inherit font-lock-constant-face)))
- "ANTLR syntax symbols like :, |, (, ), ...."
- :group 'antlr)
+ '((((class color) (background light))
+ (:foreground "black" :weight bold))
+ (t :inherit font-lock-constant-face))
+ "ANTLR syntax symbols like :, |, (, ), ....")
(defface antlr-ruledef
- (cond-emacs-xemacs
- '((((class color) (background light))
- (:foreground "blue" :EMACS :weight bold :XEMACS :bold t))
- (t :inherit font-lock-function-name-face)))
- "ANTLR rule references (definition)."
- :group 'antlr)
+ '((((class color) (background light))
+ (:foreground "blue" :weight bold))
+ (t :inherit font-lock-function-name-face))
+ "ANTLR rule references (definition).")
(defface antlr-tokendef
- (cond-emacs-xemacs
- '((((class color) (background light))
- (:foreground "blue" :EMACS :weight bold :XEMACS :bold t))
- (t :inherit font-lock-function-name-face)))
- "ANTLR token references (definition)."
- :group 'antlr)
+ '((((class color) (background light))
+ (:foreground "blue" :weight bold))
+ (t :inherit font-lock-function-name-face))
+ "ANTLR token references (definition).")
(defface antlr-ruleref
'((((class color) (background light)) (:foreground "blue4"))
(t :inherit font-lock-type-face))
- "ANTLR rule references (usage)."
- :group 'antlr)
+ "ANTLR rule references (usage).")
(defface antlr-tokenref
'((((class color) (background light)) (:foreground "orange4"))
(t :inherit font-lock-type-face))
- "ANTLR token references (usage)."
- :group 'antlr)
+ "ANTLR token references (usage).")
(defface antlr-literal
- (cond-emacs-xemacs
- '((((class color) (background light))
- (:foreground "brown4" :EMACS :weight bold :XEMACS :bold t))
- (t :inherit font-lock-string-face)))
+ '((((class color) (background light))
+ (:foreground "brown4" :weight bold))
+ (t :inherit font-lock-string-face))
"ANTLR special literal tokens.
It is used to highlight strings matched by the first regexp group of
-`antlr-font-lock-literal-regexp'."
- :group 'antlr)
+`antlr-font-lock-literal-regexp'.")
(defcustom antlr-font-lock-literal-regexp "\"\\(\\sw\\(\\sw\\|-\\)*\\)\""
"Regexp matching literals with special syntax highlighting, or nil.
@@ -887,7 +771,6 @@ If nil, there is no special syntax highlighting for some literals.
Otherwise, it should be a regular expression which must contain a regexp
group. The string matched by the first group is highlighted with
`antlr-font-lock-literal-face'."
- :group 'antlr
:type '(choice (const :tag "None" nil) regexp))
(defvar antlr-class-header-regexp
@@ -895,50 +778,48 @@ group. The string matched by the first group is highlighted with
"Regexp matching class headers.")
(defvar antlr-font-lock-additional-keywords
- (cond-emacs-xemacs
- `((antlr-invalidate-context-cache)
- ("\\$setType[ \t]*(\\([A-Za-z\300-\326\330-\337]\\sw*\\))"
- (1 'antlr-tokendef))
- ("\\$\\sw+" (0 'antlr-keyword))
- ;; the tokens are already fontified as string/docstrings:
- (,(lambda (limit)
- (if antlr-font-lock-literal-regexp
- (antlr-re-search-forward antlr-font-lock-literal-regexp limit)))
- (1 'antlr-literal t)
- :XEMACS (0 nil)) ; XEmacs bug workaround
- (,(lambda (limit)
- (antlr-re-search-forward antlr-class-header-regexp limit))
- (1 'antlr-keyword)
- (2 'antlr-ruledef)
- (3 'antlr-keyword)
- (4 (if (member (match-string 4) '("Lexer" "Parser" "TreeParser"))
- 'antlr-keyword
- 'font-lock-type-face)))
- (,(lambda (limit)
- (antlr-re-search-forward
- "\\<\\(header\\|options\\|tokens\\|exception\\|catch\\|returns\\)\\>"
- limit))
+ `((antlr-invalidate-context-cache)
+ ("\\$setType[ \t]*(\\([A-Za-z\300-\326\330-\337]\\sw*\\))"
+ (1 'antlr-tokendef))
+ ("\\$\\sw+" (0 'antlr-keyword))
+ ;; the tokens are already fontified as string/docstrings:
+ (,(lambda (limit)
+ (if antlr-font-lock-literal-regexp
+ (antlr-re-search-forward antlr-font-lock-literal-regexp limit)))
+ (1 'antlr-literal t))
+ (,(lambda (limit)
+ (antlr-re-search-forward antlr-class-header-regexp limit))
+ (1 'antlr-keyword)
+ (2 'antlr-ruledef)
+ (3 'antlr-keyword)
+ (4 (if (member (match-string 4) '("Lexer" "Parser" "TreeParser"))
+ 'antlr-keyword
+ 'font-lock-type-face)))
+ (,(lambda (limit)
+ (antlr-re-search-forward
+ "\\<\\(header\\|options\\|tokens\\|exception\\|catch\\|returns\\)\\>"
+ limit))
(1 'antlr-keyword))
- (,(lambda (limit)
- (antlr-re-search-forward
- "^\\(private\\|public\\|protected\\)\\>[ \t]*\\(\\(\\sw+[ \t]*\\(:\\)?\\)\\)?"
- limit))
- (1 'font-lock-type-face) ; not XEmacs's java level-3 fruit salad
+ (,(lambda (limit)
+ (antlr-re-search-forward
+ "^\\(private\\|public\\|protected\\)\\>[ \t]*\\(\\(\\sw+[ \t]*\\(:\\)?\\)\\)?"
+ limit))
+ (1 'font-lock-type-face) ; not XEmacs's java level-3 fruit salad
(3 (if (antlr-upcase-p (char-after (match-beginning 3)))
'antlr-tokendef
'antlr-ruledef)
nil t)
(4 'antlr-syntax nil t))
- (,(lambda (limit)
- (antlr-re-search-forward "^\\(\\sw+\\)[ \t]*\\(:\\)?" limit))
+ (,(lambda (limit)
+ (antlr-re-search-forward "^\\(\\sw+\\)[ \t]*\\(:\\)?" limit))
(1 (if (antlr-upcase-p (char-after (match-beginning 0)))
'antlr-tokendef
'antlr-ruledef)
nil t)
(2 'antlr-syntax nil t))
- (,(lambda (limit)
- ;; v:ruleref and v:"literal" is allowed...
- (antlr-re-search-forward "\\(\\sw+\\)[ \t]*\\([=:]\\)?" limit))
+ (,(lambda (limit)
+ ;; v:ruleref and v:"literal" is allowed...
+ (antlr-re-search-forward "\\(\\sw+\\)[ \t]*\\([=:]\\)?" limit))
(1 (if (match-beginning 2)
(if (eq (char-after (match-beginning 2)) ?=)
'antlr-default
@@ -947,9 +828,9 @@ group. The string matched by the first group is highlighted with
'antlr-tokenref
'antlr-ruleref)))
(2 'antlr-default nil t))
- (,(lambda (limit)
- (antlr-re-search-forward "[|&:;(~]\\|)\\([*+?]\\|=>\\)?" limit))
- (0 'antlr-syntax))))
+ (,(lambda (limit)
+ (antlr-re-search-forward "[|&:;(~]\\|)\\([*+?]\\|=>\\)?" limit))
+ (0 'antlr-syntax)))
"Font-lock keywords for ANTLR's normal grammar code.
See `antlr-font-lock-keywords-alist' for the keywords of actions.")
@@ -1015,35 +896,6 @@ Used for `antlr-slow-syntactic-context'.")
;;; Syntax functions -- Emacs vs XEmacs dependent, part 1
;;;===========================================================================
-;; From help.el (XEmacs-21.1), without `copy-syntax-table'
-(defmacro antlr-with-syntax-table (syntab &rest body)
- "Evaluate BODY with the syntax table SYNTAB."
- `(let ((stab (syntax-table)))
- (unwind-protect
- (progn (set-syntax-table ,syntab) ,@body)
- (set-syntax-table stab))))
-(put 'antlr-with-syntax-table 'lisp-indent-function 1)
-(put 'antlr-with-syntax-table 'edebug-form-spec '(form body))
-
-(defunx antlr-default-directory ()
- :xemacs-and-try default-directory
- "Return `default-directory'."
- default-directory)
-
-;; Check Emacs-21.1 simple.el, `shell-command'.
-(defunx antlr-read-shell-command (prompt &optional initial-input history)
- :xemacs-and-try read-shell-command
- "Read a string from the minibuffer, using `shell-command-history'."
- (read-from-minibuffer prompt initial-input nil nil
- (or history 'shell-command-history)))
-
-(defunx antlr-with-displaying-help-buffer (thunk &optional _name)
- :xemacs-and-try with-displaying-help-buffer
- "Make a help buffer and call `thunk' there."
- (with-output-to-temp-buffer "*Help*"
- (save-excursion (funcall thunk))))
-
-
;;;===========================================================================
;;; Context cache
;;;===========================================================================
@@ -1056,26 +908,18 @@ Used for `antlr-slow-syntactic-context'.")
;;;(defvar antlr-statistics-cache 0)
;;;(defvar antlr-statistics-inval 0)
-(defunx antlr-invalidate-context-cache (&rest _dummies)
+(defun antlr-invalidate-context-cache (&rest _dummies)
;; checkdoc-params: (dummies)
"Invalidate context cache for syntactical context information."
- :XEMACS ; XEmacs bug workaround
- (with-current-buffer (get-buffer-create " ANTLR XEmacs bug workaround")
- (buffer-syntactic-context-depth)
- nil)
- :EMACS
;;; (cl-incf antlr-statistics-inval)
(setq antlr-slow-context-cache nil))
-(defunx antlr-syntactic-context ()
+(defun antlr-syntactic-context ()
"Return some syntactic context information.
Return `string' if point is within a string, `block-comment' or
`comment' is point is within a comment or the depth within all
parenthesis-syntax delimiters at point otherwise.
WARNING: this may alter `match-data'."
- :XEMACS
- (or (buffer-syntactic-context) (buffer-syntactic-context-depth))
- :EMACS
(let ((orig (point)) diff state
;; Arg, Emacs's (buffer-modified-tick) changes with font-lock. Use
;; hack that `loudly' is bound during font-locking => cache use will
@@ -1094,9 +938,9 @@ WARNING: this may alter `match-data'."
(if (>= orig antlr-slow-cache-diff-threshold)
(beginning-of-defun)
(goto-char (point-min)))
-;;; (cond ((and diff (< diff 0)) (cl-incf antlr-statistics-full-neg))
-;;; ((and diff (>= diff 3000)) (cl-incf antlr-statistics-full-diff))
-;;; (t (cl-incf antlr-statistics-full-other)))
+ ;; (cond ((and diff (< diff 0)) (cl-incf antlr-statistics-full-neg))
+ ;; ((and diff (>= diff 3000)) (cl-incf antlr-statistics-full-diff))
+ ;; (t (cl-incf antlr-statistics-full-other)))
(setq state (parse-partial-sexp (point) orig)))
(goto-char orig)
(if antlr-slow-context-cache
@@ -1108,52 +952,52 @@ WARNING: this may alter `match-data'."
((nth 4 state) 'comment) ; block-comment? -- we don't care
(t (car state)))))
-;;; (cl-incf (aref antlr-statistics 2))
-;;; (unless (and (eq (current-buffer)
-;;; (caar antlr-slow-context-cache))
-;;; (eq (buffer-modified-tick)
-;;; (cdar antlr-slow-context-cache)))
-;;; (cl-incf (aref antlr-statistics 1))
-;;; (setq antlr-slow-context-cache nil))
-;;; (let* ((orig (point))
-;;; (base (cadr antlr-slow-context-cache))
-;;; (curr (cddr antlr-slow-context-cache))
-;;; (state (cond ((eq orig (car curr)) (cdr curr))
-;;; ((eq orig (car base)) (cdr base))))
-;;; diff diff2)
-;;; (unless state
-;;; (cl-incf (aref antlr-statistics 3))
-;;; (when curr
-;;; (if (< (setq diff (abs (- orig (car curr))))
-;;; (setq diff2 (abs (- orig (car base)))))
-;;; (setq state curr)
-;;; (setq state base
-;;; diff diff2))
-;;; (if (or (>= (1+ diff) (point)) (>= diff 3000))
-;;; (setq state nil))) ; start from bod/bob
-;;; (if state
-;;; (setq state
-;;; (parse-partial-sexp (car state) orig nil nil (cdr state)))
-;;; (if (>= orig 3000) (beginning-of-defun) (goto-char (point-min)))
-;;; (cl-incf (aref antlr-statistics 4))
-;;; (setq cw (list orig (point) base curr))
-;;; (setq state (parse-partial-sexp (point) orig)))
-;;; (goto-char orig)
-;;; (if antlr-slow-context-cache
-;;; (setcdr (cdr antlr-slow-context-cache) (cons orig state))
-;;; (setq antlr-slow-context-cache
-;;; (cons (cons (current-buffer) (buffer-modified-tick))
-;;; (cons (cons orig state) (cons orig state))))))
-;;; (cond ((nth 3 state) 'string)
-;;; ((nth 4 state) 'comment) ; block-comment? -- we don't care
-;;; (t (car state)))))
-
-;;; (beginning-of-defun)
-;;; (let ((state (parse-partial-sexp (point) orig)))
-;;; (goto-char orig)
-;;; (cond ((nth 3 state) 'string)
-;;; ((nth 4 state) 'comment) ; block-comment? -- we don't care
-;;; (t (car state))))))
+;; (cl-incf (aref antlr-statistics 2))
+;; (unless (and (eq (current-buffer)
+;; (caar antlr-slow-context-cache))
+;; (eq (buffer-modified-tick)
+;; (cdar antlr-slow-context-cache)))
+;; (cl-incf (aref antlr-statistics 1))
+;; (setq antlr-slow-context-cache nil))
+;; (let* ((orig (point))
+;; (base (cadr antlr-slow-context-cache))
+;; (curr (cddr antlr-slow-context-cache))
+;; (state (cond ((eq orig (car curr)) (cdr curr))
+;; ((eq orig (car base)) (cdr base))))
+;; diff diff2)
+;; (unless state
+;; (cl-incf (aref antlr-statistics 3))
+;; (when curr
+;; (if (< (setq diff (abs (- orig (car curr))))
+;; (setq diff2 (abs (- orig (car base)))))
+;; (setq state curr)
+;; (setq state base
+;; diff diff2))
+;; (if (or (>= (1+ diff) (point)) (>= diff 3000))
+;; (setq state nil))) ; start from bod/bob
+;; (if state
+;; (setq state
+;; (parse-partial-sexp (car state) orig nil nil (cdr state)))
+;; (if (>= orig 3000) (beginning-of-defun) (goto-char (point-min)))
+;; (cl-incf (aref antlr-statistics 4))
+;; (setq cw (list orig (point) base curr))
+;; (setq state (parse-partial-sexp (point) orig)))
+;; (goto-char orig)
+;; (if antlr-slow-context-cache
+;; (setcdr (cdr antlr-slow-context-cache) (cons orig state))
+;; (setq antlr-slow-context-cache
+;; (cons (cons (current-buffer) (buffer-modified-tick))
+;; (cons (cons orig state) (cons orig state))))))
+;; (cond ((nth 3 state) 'string)
+;; ((nth 4 state) 'comment) ; block-comment? -- we don't care
+;; (t (car state)))))
+
+;; (beginning-of-defun)
+;; (let ((state (parse-partial-sexp (point) orig)))
+;; (goto-char orig)
+;; (cond ((nth 3 state) 'string)
+;; ((nth 4 state) 'comment) ; block-comment? -- we don't care
+;; (t (car state))))))
;;;===========================================================================
@@ -1207,7 +1051,7 @@ strings and actions/semantic predicates."
(defsubst antlr-skip-sexps (count)
"Skip the next COUNT balanced expressions and the comments after it.
Return position before the comments after the last expression."
- (goto-char (or (ignore-errors-x (scan-sexps (point) count)) (point-max)))
+ (goto-char (or (ignore-errors (scan-sexps (point) count)) (point-max)))
(prog1 (point)
(antlr-c-forward-sws)))
@@ -1229,7 +1073,8 @@ See `antlr-font-lock-additional-keywords', `antlr-language' and
antlr-font-lock-keywords-alist))
(if (eq antlr-font-lock-maximum-decoration 'inherit)
font-lock-maximum-decoration
- antlr-font-lock-maximum-decoration)))))))
+ antlr-font-lock-maximum-decoration)))
+ t))))
;;;===========================================================================
@@ -1248,7 +1093,7 @@ IF TOKENREFS-ONLY is non-nil, just return alist with tokenref names."
(continue t))
;; The generic imenu function searches backward, which is slower
;; and more likely not to work during editing.
- (antlr-with-syntax-table antlr-action-syntax-table
+ (with-syntax-table antlr-action-syntax-table
(antlr-invalidate-context-cache)
(goto-char (point-min))
(antlr-skip-file-prelude t)
@@ -1392,37 +1237,37 @@ Move to the beginning of the current rule if point is inside a rule."
A grammar class header and the file prelude are also considered as a
rule."
(save-excursion
- (antlr-with-syntax-table antlr-action-syntax-table
+ (with-syntax-table antlr-action-syntax-table
(not (antlr-outside-rule-p)))))
-(defunx antlr-end-of-rule (&optional arg)
+(defun antlr-end-of-rule (&optional arg)
"Move forward to next end of rule. Do it ARG [default: 1] many times.
A grammar class header and the file prelude are also considered as a
rule. Negative argument ARG means move back to ARGth preceding end of
rule. If ARG is zero, run `antlr-end-of-body'."
- (interactive "_p")
+ (interactive "^p")
(if (zerop arg)
(antlr-end-of-body)
- (antlr-with-syntax-table antlr-action-syntax-table
+ (with-syntax-table antlr-action-syntax-table
(antlr-next-rule arg nil))))
-(defunx antlr-beginning-of-rule (&optional arg)
+(defun antlr-beginning-of-rule (&optional arg)
"Move backward to preceding beginning of rule. Do it ARG many times.
A grammar class header and the file prelude are also considered as a
rule. Negative argument ARG means move forward to ARGth next beginning
of rule. If ARG is zero, run `antlr-beginning-of-body'."
- (interactive "_p")
+ (interactive "^p")
(if (zerop arg)
(antlr-beginning-of-body)
- (antlr-with-syntax-table antlr-action-syntax-table
+ (with-syntax-table antlr-action-syntax-table
(antlr-next-rule (- arg) t))))
-(defunx antlr-end-of-body (&optional msg)
+(defun antlr-end-of-body (&optional msg)
"Move to position after the `;' of the current rule.
A grammar class header is also considered as a rule. With optional
prefix arg MSG, move to `:'."
- (interactive "_")
- (antlr-with-syntax-table antlr-action-syntax-table
+ (interactive "^")
+ (with-syntax-table antlr-action-syntax-table
(let ((orig (point)))
(if (antlr-outside-rule-p)
(error "Outside an ANTLR rule"))
@@ -1440,9 +1285,9 @@ prefix arg MSG, move to `:'."
(error msg))
(antlr-c-forward-sws))))))
-(defunx antlr-beginning-of-body ()
+(defun antlr-beginning-of-body ()
"Move to the first element after the `:' of the current rule."
- (interactive "_")
+ (interactive "^")
(antlr-end-of-body "Class headers and the file prelude are without `:'"))
@@ -1458,7 +1303,7 @@ If non-nil, TRANSFORM is used on literals instead of `downcase-region'."
(let ((literals 0))
(save-excursion
(goto-char (point-min))
- (antlr-with-syntax-table antlr-action-syntax-table
+ (with-syntax-table antlr-action-syntax-table
(antlr-invalidate-context-cache)
(while (antlr-re-search-forward "\"\\(\\sw\\(\\sw\\|-\\)*\\)\"" nil)
(funcall transform (match-beginning 0) (match-end 0))
@@ -1487,10 +1332,10 @@ Display a message unless optional argument SILENT is non-nil."
(antlr-hide-actions 0 t)
(save-excursion
(goto-char (point-min))
- (antlr-with-syntax-table antlr-action-syntax-table
+ (with-syntax-table antlr-action-syntax-table
(antlr-invalidate-context-cache)
(while (antlr-re-search-forward regexp nil)
- (let ((beg (ignore-errors-x (scan-sexps (point) -1))))
+ (let ((beg (ignore-errors (scan-sexps (point) -1))))
(when beg
(if diff ; braces are visible
(if (> (point) (+ beg diff))
@@ -1683,7 +1528,7 @@ like \(AREA . PLACE), see `antlr-option-location'."
(cond ((null pos) 'error)
((looking-at "options[ \t\n]*{")
(goto-char (match-end 0))
- (setq pos (ignore-errors-x (scan-lists (point) 1 1)))
+ (setq pos (ignore-errors (scan-lists (point) 1 1)))
(antlr-option-location orig min0 max0
(point)
(if pos (1- pos) (point-max))
@@ -1708,7 +1553,7 @@ is undefined."
(widen)
(if (eq requested 1)
1
- (antlr-with-syntax-table antlr-action-syntax-table
+ (with-syntax-table antlr-action-syntax-table
(antlr-invalidate-context-cache)
(let* ((orig (point))
(outsidep (antlr-outside-rule-p))
@@ -2086,7 +1931,7 @@ its export vocabulary is used as an import vocabulary."
(unless buffer-file-name
(error "Grammar buffer does not visit a file"))
(let (classes export-vocabs import-vocabs superclasses default-vocab)
- (antlr-with-syntax-table antlr-action-syntax-table
+ (with-syntax-table antlr-action-syntax-table
(goto-char (point-min))
(while (antlr-re-search-forward antlr-class-header-regexp nil)
;; parse class definition --------------------------------------------
@@ -2239,9 +2084,9 @@ Use prefix argument ARG to return \(COMMAND FILE SAVED)."
(setq glibs (car (antlr-superclasses-glibs
supers
(car (antlr-directory-dependencies
- (antlr-default-directory)))))))
- (list (antlr-read-shell-command "Run Antlr on current file with: "
- (concat antlr-tool-command glibs " "))
+ default-directory))))))
+ (list (read-shell-command "Run Antlr on current file with: "
+ (concat antlr-tool-command glibs " "))
buffer-file-name
supers)))
@@ -2263,7 +2108,7 @@ Also insert strings PRE and POST before and after the variable."
"Insert Makefile rules in the current buffer at point.
IN-MAKEFILE is non-nil, if the current buffer is the Makefile. See
command `antlr-show-makefile-rules' for detail."
- (let* ((dirname (antlr-default-directory))
+ (let* ((dirname default-directory)
(deps0 (antlr-directory-dependencies dirname))
(classes (car deps0)) ; CLASS -> (FILE . EVOCAB) ...
(deps (cdr deps0)) ; FILE -> (c . s) (ev . iv) . LANGUAGE
@@ -2342,7 +2187,9 @@ commentary with value `antlr-help-unknown-file-text' is added. The
*Help* buffer always starts with the text in `antlr-help-rules-intro'."
(interactive)
(if (null (derived-mode-p 'makefile-mode))
- (antlr-with-displaying-help-buffer 'antlr-insert-makefile-rules)
+ (with-output-to-temp-buffer "*Help*"
+ (save-excursion
+ (antlr-insert-makefile-rules)))
(push-mark)
(antlr-insert-makefile-rules t)))
@@ -2385,7 +2232,7 @@ to a lesser extent, `antlr-tab-offset-alist'."
(skip-chars-forward " \t")
(setq boi (point))
;; check syntax at beginning of indentation ----------------------------
- (antlr-with-syntax-table antlr-action-syntax-table
+ (with-syntax-table antlr-action-syntax-table
(antlr-invalidate-context-cache)
(setq syntax (antlr-syntactic-context))
(cond ((symbolp syntax)
@@ -2481,7 +2328,7 @@ ANTLR's syntax and influences the auto indentation, see
(interactive "*P")
(if (or arg
(save-excursion (skip-chars-backward " \t") (not (bolp)))
- (antlr-with-syntax-table antlr-action-syntax-table
+ (with-syntax-table antlr-action-syntax-table
(antlr-invalidate-context-cache)
(let ((context (antlr-syntactic-context)))
(not (and (numberp context)
@@ -2524,7 +2371,7 @@ ANTLR's syntax and influences the auto indentation, see
(while settings
(when (boundp (car settings))
(ignore-errors
- (set (car settings) (eval (cadr settings)))))
+ (set (car settings) (eval (cadr settings) t))))
(setq settings (cddr settings)))))
(defun antlr-language-option (search)
@@ -2571,20 +2418,11 @@ the default language."
(cadr (assq antlr-language antlr-language-alist)))))
;; indentation, for the C engine -------------------------------------------
(setq c-buffer-is-cc-mode antlr-language)
- (cond ((fboundp 'c-init-language-vars-for) ; cc-mode 5.30.5+
- (c-init-language-vars-for antlr-language))
- ((fboundp 'c-init-c-language-vars) ; cc-mode 5.30 to 5.30.4
- (c-init-c-language-vars) ; not perfect, but OK
- (setq c-recognize-knr-p nil))
- ((fboundp 'c-init-language-vars) ; cc-mode 5.29
- (let ((init-fn 'c-init-language-vars))
- (funcall init-fn))) ; is a function in v5.29
- (t ; cc-mode upto 5.28
- (antlr-c-init-language-vars))) ; do it myself
+ (c-init-language-vars-for antlr-language)
(c-basic-common-init antlr-language (or antlr-indent-style "gnu"))
(set (make-local-variable 'outline-regexp) "[^#\n\^M]")
- (set (make-local-variable 'outline-level) 'c-outline-level) ;TODO: define own
- (set (make-local-variable 'indent-line-function) 'antlr-indent-line)
+ (set (make-local-variable 'outline-level) #'c-outline-level) ;TODO: define own
+ (set (make-local-variable 'indent-line-function) #'antlr-indent-line)
(set (make-local-variable 'indent-region-function) nil) ; too lazy
(setq comment-start "// "
comment-end ""
@@ -2594,7 +2432,7 @@ the default language."
(when (featurep 'xemacs)
(easy-menu-add antlr-mode-menu))
(set (make-local-variable 'imenu-create-index-function)
- 'antlr-imenu-create-index-function)
+ #'antlr-imenu-create-index-function)
(set (make-local-variable 'imenu-generic-expression) t) ; fool stupid test
(and antlr-imenu-name ; there should be a global variable...
(fboundp 'imenu-add-to-menubar)
@@ -2624,6 +2462,6 @@ Used in `antlr-mode'. Also a useful function in `java-mode-hook'."
(provide 'antlr-mode)
-;;; Local IspellPersDict: .ispell_antlr
+;; Local IspellPersDict: .ispell_antlr
;;; antlr-mode.el ends here
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el
index 99b2ec6d87e5..2f7d7bf7966d 100644
--- a/lisp/progmodes/asm-mode.el
+++ b/lisp/progmodes/asm-mode.el
@@ -73,19 +73,19 @@
;; Note that the comment character isn't set up until asm-mode is called.
(define-key map ":" 'asm-colon)
(define-key map "\C-c;" 'comment-region)
- (define-key map [menu-bar asm-mode] (cons "Asm" (make-sparse-keymap)))
- (define-key map [menu-bar asm-mode comment-region]
- '(menu-item "Comment Region" comment-region
- :help "Comment or uncomment each line in the region"))
- (define-key map [menu-bar asm-mode newline-and-indent]
- '(menu-item "Insert Newline and Indent" newline-and-indent
- :help "Insert a newline, then indent according to major mode"))
- (define-key map [menu-bar asm-mode asm-colon]
- '(menu-item "Insert Colon" asm-colon
- :help "Insert a colon; if it follows a label, delete the label's indentation"))
map)
"Keymap for Asm mode.")
+(easy-menu-define asm-mode-menu asm-mode-map
+ "Menu for Asm mode."
+ '("Asm"
+ ["Insert Colon" asm-colon
+ :help "Insert a colon; if it follows a label, delete the label's indentation"]
+ ["Insert Newline and Indent" newline-and-indent
+ :help "Insert a newline, then indent according to major mode"]
+ ["Comment Region" comment-region
+ :help "Comment or uncomment each line in the region"]))
+
(defconst asm-font-lock-keywords
(append
'(("^\\(\\(\\sw\\|\\s_\\)+\\)\\>:?[ \t]*\\(\\sw+\\(\\.\\sw+\\)*\\)?"
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 484624b86648..9038c7bd95a1 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -2665,7 +2665,7 @@ comment at the start of cc-engine.el for more info."
;; One of the above "near" caches is associated with each of these functions.
;;
;; When searching this cache, these functions first seek an exact match, then
-;; a "close" match from the assiciated near cache. If neither of these
+;; a "close" match from the associated near cache. If neither of these
;; succeed, the nearest preceding entry in the far cache is used.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 44a752695243..db142c0dc3e2 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1305,7 +1305,7 @@ is a legal variable name).")
(group (regexp ,cperl--normal-identifier-regexp))
(opt
(sequence
- (1+ (regexp ,cperl--ws-or-comment-regexp))
+ (regexp ,cperl--ws-or-comment-regexp)
(group (regexp ,cperl--version-regexp))))))
"A regular expression for package NAME VERSION in Perl.
Contains two groups for the package name and version.")
@@ -1764,12 +1764,12 @@ or as help on variables `cperl-tips', `cperl-problems',
(setq-local syntax-propertize-function
(lambda (start end)
(goto-char start)
- ;; Even if cperl-fontify-syntaxically has already gone
+ ;; Even if cperl-fontify-syntactically has already gone
;; beyond `start', syntax-propertize has just removed
;; syntax-table properties between start and end, so we have
;; to re-apply them.
(setq cperl-syntax-done-to start)
- (cperl-fontify-syntaxically end))))
+ (cperl-fontify-syntactically end))))
(setq cperl-font-lock-multiline t) ; Not localized...
(setq-local font-lock-multiline t)
(setq-local font-lock-fontify-region-function
@@ -8407,7 +8407,7 @@ do extra unwind via `cperl-unwind-to-safe'."
(setq end (point)))
(font-lock-default-fontify-region beg end loudly))
-(defun cperl-fontify-syntaxically (end)
+(defun cperl-fontify-syntactically (end)
;; Some vars for debugging only
;; (message "Syntaxifying...")
(let ((dbg (point)) (iend end) (idone cperl-syntax-done-to)
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index c14b18425f6b..397eb269a719 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1342,6 +1342,7 @@ if it already has a value.)
Return the result of evaluation."
;; FIXME: the print-length/level bindings should only be applied while
;; printing, not while evaluating.
+ (defvar elisp--eval-defun-result)
(let ((debug-on-error eval-expression-debug-on-error)
(print-length eval-expression-print-length)
(print-level eval-expression-print-level)
@@ -1357,19 +1358,22 @@ Return the result of evaluation."
(end-of-defun)
(beginning-of-defun)
(setq beg (point))
- (setq form (read (current-buffer)))
+ (setq form (funcall load-read-function (current-buffer)))
(setq end (point)))
;; Alter the form if necessary.
(let ((form (eval-sexp-add-defvars
(elisp--eval-defun-1
- (macroexpand
- `(setq elisp--eval-defun-result ,form))))))
+ (macroexpand form)))))
(eval-region beg end standard-output
(lambda (_ignore)
;; Skipping to the end of the specified region
;; will make eval-region return.
(goto-char end)
- form)))))
+ ;; This `setq' needs to be added *after* passing
+ ;; form through `elisp--eval-defun-1' since it
+ ;; would otherwise "hide" forms like `defvar's and
+ ;; thus defeat their special treatment.
+ `(setq elisp--eval-defun-result ,form))))))
(let ((str (eval-expression-print-format elisp--eval-defun-result)))
(if str (princ str)))
elisp--eval-defun-result))
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index b8c8a827eed9..d01803282aa9 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -483,7 +483,7 @@ Currently, Flymake may provide these keyword-value pairs:
* `:recent-changes', a list of recent changes since the last time
the backend function was called for the buffer. An empty list
- indicates that no changes have been reocrded. If it is the
+ indicates that no changes have been recorded. If it is the
first time that this backend function is called for this
activation of `flymake-mode', then this argument isn't provided
at all (i.e. it's not merely nil).
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index d6ee8bb42368..3e92c6991325 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -279,57 +279,39 @@ See `compilation-error-screen-columns'."
(define-key map "}" 'compilation-next-file)
(define-key map "\t" 'compilation-next-error)
(define-key map [backtab] 'compilation-previous-error)
-
- ;; Set up the menu-bar
- (define-key map [menu-bar grep]
- (cons "Grep" (make-sparse-keymap "Grep")))
-
- (define-key map [menu-bar grep grep-find-toggle-abbreviation]
- '(menu-item "Toggle command abbreviation"
- grep-find-toggle-abbreviation
- :help "Toggle showing verbose command options"))
- (define-key map [menu-bar grep compilation-separator3] '("----"))
- (define-key map [menu-bar grep compilation-kill-compilation]
- '(menu-item "Kill Grep" kill-compilation
- :help "Kill the currently running grep process"))
- (define-key map [menu-bar grep compilation-separator2] '("----"))
- (define-key map [menu-bar grep compilation-compile]
- '(menu-item
- "Compile..." compile
- :help
- "Compile the program including the current buffer. Default: run `make'"))
- (define-key map [menu-bar grep compilation-rgrep]
- '(menu-item "Recursive grep..." rgrep
- :help "User-friendly recursive grep in directory tree"))
- (define-key map [menu-bar grep compilation-lgrep]
- '(menu-item "Local grep..." lgrep
- :help "User-friendly grep in a directory"))
- (define-key map [menu-bar grep compilation-grep-find]
- '(menu-item "Grep via Find..." grep-find
- :help "Run grep via find, with user-specified args"))
- (define-key map [menu-bar grep compilation-grep]
- '(menu-item
- "Another grep..." grep
- :help
- "Run grep, with user-specified args, and collect output in a buffer."))
- (define-key map [menu-bar grep compilation-recompile]
- '(menu-item "Repeat grep" recompile
- :help "Run grep again"))
- (define-key map [menu-bar grep compilation-separator1] '("----"))
- (define-key map [menu-bar grep compilation-first-error]
- '(menu-item
- "First Match" first-error
- :help "Restart at the first match, visit corresponding location"))
- (define-key map [menu-bar grep compilation-previous-error]
- '(menu-item "Previous Match" previous-error
- :help "Visit the previous match and corresponding location"))
- (define-key map [menu-bar grep compilation-next-error]
- '(menu-item "Next Match" next-error
- :help "Visit the next match and corresponding location"))
map)
"Keymap for grep buffers.
`compilation-minor-mode-map' is a cdr of this.")
+(easy-menu-define grep-menu-map grep-mode-map
+ "Menu for grep buffers."
+ '("Grep"
+ ["Next Match" next-error
+ :help "Visit the next match and corresponding location"]
+ ["Previous Match" previous-error
+ :help "Visit the previous match and corresponding location"]
+ ["First Match" first-error
+ :help "Restart at the first match, visit corresponding location"]
+ "----"
+ ["Repeat grep" recompile
+ :help "Run grep again"]
+ ["Another grep..." grep
+ :help "Run grep, with user-specified args, and collect output in a buffer."]
+ ["Grep via Find..." grep-find
+ :help "Run grep via find, with user-specified args"]
+ ["Local grep..." lgrep
+ :help "User-friendly grep in a directory"]
+ ["Recursive grep..." rgrep
+ :help "User-friendly recursive grep in directory tree"]
+ ["Compile..." compile
+ :help "Compile the program including the current buffer. Default: run `make'"]
+ "----"
+ ["Kill Grep" kill-compilation
+ :help "Kill the currently running grep process"]
+ "----"
+ ["Toggle command abbreviation" grep-find-toggle-abbreviation
+ :help "Toggle showing verbose command options"]))
+
(defvar grep-mode-tool-bar-map
;; When bootstrapping, tool-bar-map is not properly initialized yet,
;; so don't do anything.
diff --git a/lisp/progmodes/m4-mode.el b/lisp/progmodes/m4-mode.el
index 7dfaed44282e..d9c09f6fe6bc 100644
--- a/lisp/progmodes/m4-mode.el
+++ b/lisp/progmodes/m4-mode.el
@@ -122,22 +122,22 @@ If m4 is not in your PATH, set this to an absolute file name."
(string-to-syntax "."))))))
(defvar m4-mode-map
- (let ((map (make-sparse-keymap))
- (menu-map (make-sparse-keymap)))
+ (let ((map (make-sparse-keymap)))
(define-key map "\C-c\C-b" 'm4-m4-buffer)
(define-key map "\C-c\C-r" 'm4-m4-region)
(define-key map "\C-c\C-c" 'comment-region)
- (define-key map [menu-bar m4-mode] (cons "M4" menu-map))
- (define-key menu-map [m4c]
- '(menu-item "Comment Region" comment-region
- :help "Comment Region"))
- (define-key menu-map [m4b]
- '(menu-item "M4 Buffer" m4-m4-buffer
- :help "Send contents of the current buffer to m4"))
- (define-key menu-map [m4r]
- '(menu-item "M4 Region" m4-m4-region
- :help "Send contents of the current region to m4"))
- map))
+ map)
+ "Keymap for M4 Mode.")
+
+(easy-menu-define m4-mode-menu m4-mode-map
+ "Menu for M4 Mode."
+ '("M4"
+ ["M4 Region" m4-m4-region
+ :help "Send contents of the current region to m4"]
+ ["M4 Buffer" m4-m4-buffer
+ :help "Send contents of the current buffer to m4"]
+ ["Comment Region" comment-region
+ :help "Comment Region"]))
(defun m4-m4-buffer ()
"Send contents of the current buffer to m4."
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 3d1e7d634a20..3f466e1150bf 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -573,8 +573,7 @@ The function must satisfy this calling convention:
"Abbrev table in use in Makefile buffers.")
(defvar makefile-mode-map
- (let ((map (make-sparse-keymap))
- (opt-map (make-sparse-keymap)))
+ (let ((map (make-sparse-keymap)))
;; set up the keymap
(define-key map "\C-c:" 'makefile-insert-target-ref)
(if makefile-electric-keys
@@ -599,72 +598,62 @@ The function must satisfy this calling convention:
(define-key map "\M-p" 'makefile-previous-dependency)
(define-key map "\M-n" 'makefile-next-dependency)
(define-key map "\e\t" 'completion-at-point)
-
- ;; Make menus.
- (define-key map [menu-bar makefile-mode]
- (cons "Makefile" (make-sparse-keymap "Makefile")))
-
- (define-key map [menu-bar makefile-mode makefile-type]
- (cons "Switch Makefile Type" opt-map))
- (define-key opt-map [makefile-makepp-mode]
- '(menu-item "Makepp" makefile-makepp-mode
- :help "An adapted `makefile-mode' that knows about makepp"
- :button (:radio . (eq major-mode 'makefile-makepp-mode))))
- (define-key opt-map [makefile-imake-mode]
- '(menu-item "Imake" makefile-imake-mode
- :help "An adapted `makefile-mode' that knows about imake"
- :button (:radio . (eq major-mode 'makefile-imake-mode))))
- (define-key opt-map [makefile-mode]
- '(menu-item "Classic" makefile-mode
- :help "`makefile-mode' with no special functionality"
- :button (:radio . (eq major-mode 'makefile-mode))))
- (define-key opt-map [makefile-bsdmake-mode]
- '(menu-item "BSD" makefile-bsdmake-mode
- :help "An adapted `makefile-mode' that knows about BSD make"
- :button (:radio . (eq major-mode 'makefile-bsdmake-mode))))
- (define-key opt-map [makefile-automake-mode]
- '(menu-item "Automake" makefile-automake-mode
- :help "An adapted `makefile-mode' that knows about automake"
- :button (:radio . (eq major-mode 'makefile-automake-mode))))
- (define-key opt-map [makefile-gmake-mode]
- '(menu-item "GNU make" makefile-gmake-mode
- :help "An adapted `makefile-mode' that knows about GNU make"
- :button (:radio . (eq major-mode 'makefile-gmake-mode))))
- (define-key map [menu-bar makefile-mode browse]
- '(menu-item "Pop up Makefile Browser" makefile-switch-to-browser
- ;; XXX: this needs a better string, the function is not documented...
- :help "Pop up Makefile Browser"))
- (define-key map [menu-bar makefile-mode overview]
- '(menu-item "Up To Date Overview" makefile-create-up-to-date-overview
- :help "Create a buffer containing an overview of the state of all known targets"))
- ;; Target related
- (define-key map [menu-bar makefile-mode separator1] '("----"))
- (define-key map [menu-bar makefile-mode pickup-file]
- '(menu-item "Pick File Name as Target" makefile-pickup-filenames-as-targets
- :help "Scan the current directory for filenames to use as targets"))
- (define-key map [menu-bar makefile-mode function]
- '(menu-item "Insert GNU make function" makefile-insert-gmake-function
- :help "Insert a GNU make function call"))
- (define-key map [menu-bar makefile-mode pickup]
- '(menu-item "Find Targets and Macros" makefile-pickup-everything
- :help "Notice names of all macros and targets in Makefile"))
- (define-key map [menu-bar makefile-mode complete]
- '(menu-item "Complete Target or Macro" completion-at-point
- :help "Perform completion on Makefile construct preceding point"))
- (define-key map [menu-bar makefile-mode backslash]
- '(menu-item "Backslash Region" makefile-backslash-region
- :help "Insert, align, or delete end-of-line backslashes on the lines in the region"))
- ;; Motion
- (define-key map [menu-bar makefile-mode separator] '("----"))
- (define-key map [menu-bar makefile-mode prev]
- '(menu-item "Move to Previous Dependency" makefile-previous-dependency
- :help "Move point to the beginning of the previous dependency line"))
- (define-key map [menu-bar makefile-mode next]
- '(menu-item "Move to Next Dependency" makefile-next-dependency
- :help "Move point to the beginning of the next dependency line"))
map)
"The keymap that is used in Makefile mode.")
+(easy-menu-define makefile-mode-menu makefile-mode-map
+ "Menu for Makefile mode."
+ '("Makefile"
+ ;; Motion
+ ["Move to Next Dependency" makefile-next-dependency
+ :help "Move point to the beginning of the next dependency line"]
+ ["Move to Previous Dependency" makefile-previous-dependency
+ :help "Move point to the beginning of the previous dependency line"]
+ "----"
+ ;; Target related
+ ["Backslash Region" makefile-backslash-region
+ :help "Insert, align, or delete end-of-line backslashes on the lines in the region"]
+ ["Complete Target or Macro" completion-at-point
+ :help "Perform completion on Makefile construct preceding point"]
+ ["Find Targets and Macros" makefile-pickup-everything
+ :help "Notice names of all macros and targets in Makefile"]
+ ["Insert GNU make function" makefile-insert-gmake-function
+ :help "Insert a GNU make function call"]
+ ["Pick File Name as Target" makefile-pickup-filenames-as-targets
+ :help "Scan the current directory for filenames to use as targets"]
+ "----"
+ ;; Other.
+ ["Up To Date Overview" makefile-create-up-to-date-overview
+ :help "Create a buffer containing an overview of the state of all known targets"]
+ ["Pop up Makefile Browser" makefile-switch-to-browser
+ ;; XXX: this needs a better string, the function is not documented...
+ :help "Pop up Makefile Browser"]
+ ("Switch Makefile Type"
+ ["GNU make" makefile-gmake-mode
+ :help "An adapted `makefile-mode' that knows about GNU make"
+ :style radio
+ :selected (eq major-mode 'makefile-gmake-mode)]
+ ["Automake" makefile-automake-mode
+ :help "An adapted `makefile-mode' that knows about automake"
+ :style radio
+ :selected (eq major-mode 'makefile-automake-mode)]
+ ["BSD" makefile-bsdmake-mode
+ :help "An adapted `makefile-mode' that knows about BSD make"
+ :style radio
+ :selected (eq major-mode 'makefile-bsdmake-mode)]
+ ["Classic" makefile-mode
+ :help "`makefile-mode' with no special functionality"
+ :style radio
+ :selected (eq major-mode 'makefile-mode)]
+ ["Imake" makefile-imake-mode
+ :help "An adapted `makefile-mode' that knows about imake"
+ :style radio
+ :selected (eq major-mode 'makefile-imake-mode)]
+ ["Makepp" makefile-makepp-mode
+ :help "An adapted `makefile-mode' that knows about makepp"
+ :style radio
+ :selected (eq major-mode 'makefile-makepp-mode)])))
+
(defvar makefile-browser-map
(let ((map (make-sparse-keymap)))
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index f588ad99c9d0..ba59f9c66165 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -403,8 +403,7 @@ This is buffer-local in every such buffer.")
"Syntax-table used in Shell-Script mode. See `sh-feature'.")
(defvar sh-mode-map
- (let ((map (make-sparse-keymap))
- (menu-map (make-sparse-keymap)))
+ (let ((map (make-sparse-keymap)))
(define-key map "\C-c(" 'sh-function)
(define-key map "\C-c\C-w" 'sh-while)
(define-key map "\C-c\C-u" 'sh-until)
@@ -434,74 +433,57 @@ This is buffer-local in every such buffer.")
(define-key map "\C-c:" 'sh-set-shell)
(define-key map [remap backward-sentence] 'sh-beginning-of-command)
(define-key map [remap forward-sentence] 'sh-end-of-command)
- (define-key map [menu-bar sh-script] (cons "Sh-Script" menu-map))
- (define-key menu-map [smie-config-guess]
- '(menu-item "Learn buffer indentation" smie-config-guess
- :help "Learn how to indent the buffer the way it currently is."))
- (define-key menu-map [smie-config-show-indent]
- '(menu-item "Show indentation" smie-config-show-indent
- :help "Show the how the current line would be indented"))
- (define-key menu-map [smie-config-set-indent]
- '(menu-item "Set indentation" smie-config-set-indent
- :help "Set the indentation for the current line"))
-
- (define-key menu-map [sh-pair]
- '(menu-item "Insert braces and quotes in pairs"
- electric-pair-mode
- :button (:toggle . (bound-and-true-p electric-pair-mode))
- :help "Inserting a brace or quote automatically inserts the matching pair"))
-
- (define-key menu-map [sh-s0] '("--"))
- ;; Insert
- (define-key menu-map [sh-function]
- '(menu-item "Function..." sh-function
- :help "Insert a function definition"))
- (define-key menu-map [sh-add]
- '(menu-item "Addition..." sh-add
- :help "Insert an addition of VAR and prefix DELTA for Bourne (type) shell"))
- (define-key menu-map [sh-until]
- '(menu-item "Until Loop" sh-until
- :help "Insert an until loop"))
- (define-key menu-map [sh-repeat]
- '(menu-item "Repeat Loop" sh-repeat
- :help "Insert a repeat loop definition"))
- (define-key menu-map [sh-while]
- '(menu-item "While Loop" sh-while
- :help "Insert a while loop"))
- (define-key menu-map [sh-getopts]
- '(menu-item "Options Loop" sh-while-getopts
- :help "Insert a while getopts loop."))
- (define-key menu-map [sh-indexed-loop]
- '(menu-item "Indexed Loop" sh-indexed-loop
- :help "Insert an indexed loop from 1 to n."))
- (define-key menu-map [sh-select]
- '(menu-item "Select Statement" sh-select
- :help "Insert a select statement "))
- (define-key menu-map [sh-if]
- '(menu-item "If Statement" sh-if
- :help "Insert an if statement"))
- (define-key menu-map [sh-for]
- '(menu-item "For Loop" sh-for
- :help "Insert a for loop"))
- (define-key menu-map [sh-case]
- '(menu-item "Case Statement" sh-case
- :help "Insert a case/switch statement"))
- (define-key menu-map [sh-s1] '("--"))
- (define-key menu-map [sh-exec]
- '(menu-item "Execute region" sh-execute-region
- :help "Pass optional header and region to a subshell for noninteractive execution"))
- (define-key menu-map [sh-exec-interpret]
- '(menu-item "Execute script..." executable-interpret
- :help "Run script with user-specified args, and collect output in a buffer"))
- (define-key menu-map [sh-set-shell]
- '(menu-item "Set shell type..." sh-set-shell
- :help "Set this buffer's shell to SHELL (a string)"))
- (define-key menu-map [sh-backslash-region]
- '(menu-item "Backslash region" sh-backslash-region
- :help "Insert, align, or delete end-of-line backslashes on the lines in the region."))
map)
"Keymap used in Shell-Script mode.")
+(easy-menu-define sh-mode-menu sh-mode-map
+ "Menu for Shell-Script mode."
+ '("Sh-Script"
+ ["Backslash region" sh-backslash-region
+ :help "Insert, align, or delete end-of-line backslashes on the lines in the region."]
+ ["Set shell type..." sh-set-shell
+ :help "Set this buffer's shell to SHELL (a string)"]
+ ["Execute script..." executable-interpret
+ :help "Run script with user-specified args, and collect output in a buffer"]
+ ["Execute region" sh-execute-region
+ :help "Pass optional header and region to a subshell for noninteractive execution"]
+ "---"
+ ;; Insert
+ ["Case Statement" sh-case
+ :help "Insert a case/switch statement"]
+ ["For Loop" sh-for
+ :help "Insert a for loop"]
+ ["If Statement" sh-if
+ :help "Insert an if statement"]
+ ["Select Statement" sh-select
+ :help "Insert a select statement "]
+ ["Indexed Loop" sh-indexed-loop
+ :help "Insert an indexed loop from 1 to n."]
+ ["Options Loop" sh-while-getopts
+ :help "Insert a while getopts loop."]
+ ["While Loop" sh-while
+ :help "Insert a while loop"]
+ ["Repeat Loop" sh-repeat
+ :help "Insert a repeat loop definition"]
+ ["Until Loop" sh-until
+ :help "Insert an until loop"]
+ ["Addition..." sh-add
+ :help "Insert an addition of VAR and prefix DELTA for Bourne (type) shell"]
+ ["Function..." sh-function
+ :help "Insert a function definition"]
+ "---"
+ ;; Other
+ ["Insert braces and quotes in pairs" electric-pair-mode
+ :style toggle
+ :selected (bound-and-true-p electric-pair-mode)
+ :help "Inserting a brace or quote automatically inserts the matching pair"]
+ ["Set indentation" smie-config-set-indent
+ :help "Set the indentation for the current line"]
+ ["Show indentation" smie-config-show-indent
+ :help "Show the how the current line would be indented"]
+ ["Learn buffer indentation" smie-config-guess
+ :help "Learn how to indent the buffer the way it currently is."]))
+
(defvar sh-skeleton-pair-default-alist '((?\( _ ?\)) (?\))
(?\[ ?\s _ ?\s ?\]) (?\])
(?{ _ ?}) (?\}))
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index f934ef7a80e9..55c04e133235 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -134,7 +134,7 @@
(interactive)
(message "Using verilog-mode version %s" verilog-mode-version))
-(defmacro verilog--supressed-warnings (warnings &rest body)
+(defmacro verilog--suppressed-warnings (warnings &rest body)
(declare (indent 1) (debug t))
(cond
((fboundp 'with-suppressed-warnings)
@@ -5550,7 +5550,7 @@ FILENAME to find directory to run in, or defaults to `buffer-file-name'."
;; font-lock-fontify-buffer, but IIUC the problem this is supposed to
;; solve only appears in Emacsen older than font-lock-ensure anyway.
(when fontlocked
- (verilog--supressed-warnings
+ (verilog--suppressed-warnings
((interactive-only font-lock-fontify-buffer))
(font-lock-fontify-buffer))))))))
diff --git a/lisp/simple.el b/lisp/simple.el
index d6ccdad90210..1dfc3374ade3 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -549,7 +549,7 @@ It must be called via `run-hook-with-args-until-success' with no arguments.
If any function on this hook returns a non-nil value, `delete-selection-mode'
will act on that value (see `delete-selection-helper') and will
usually delete the region. If all the functions on this hook return
-nil, it is an indiction that `self-insert-command' needs the region
+nil, it is an indication that `self-insert-command' needs the region
untouched by `delete-selection-mode' and will itself do whatever is
appropriate with the region.
Any function on `post-self-insert-hook' that acts on the region should
@@ -1980,7 +1980,9 @@ This function uses the `read-extended-command-predicate' user option."
;; but actually a prompt other than "M-x" would be confusing,
;; because "M-x" is a well-known prompt to read a command
;; and it serves as a shorthand for "Extended command: ".
- "M-x ")
+ (if (memq 'shift (event-modifiers last-command-event))
+ "M-X "
+ "M-x "))
(lambda (string pred action)
(if (and suggest-key-bindings (eq action 'metadata))
'(metadata
@@ -1994,6 +1996,26 @@ This function uses the `read-extended-command-predicate' user option."
(funcall read-extended-command-predicate sym buffer)))))
t nil 'extended-command-history))))
+(defun command-completion-using-modes-p (symbol buffer)
+ "Say whether SYMBOL has been marked as a mode-specific command in BUFFER."
+ ;; Check the modes.
+ (let ((modes (command-modes symbol)))
+ ;; Common case: Just a single mode.
+ (if (null (cdr modes))
+ (or (provided-mode-derived-p
+ (buffer-local-value 'major-mode buffer) (car modes))
+ (memq (car modes)
+ (buffer-local-value 'local-minor-modes buffer))
+ (memq (car modes) global-minor-modes))
+ ;; Uncommon case: Multiple modes.
+ (apply #'provided-mode-derived-p
+ (buffer-local-value 'major-mode buffer)
+ modes)
+ (seq-intersection modes
+ (buffer-local-value 'local-minor-modes buffer)
+ #'eq)
+ (seq-intersection modes global-minor-modes #'eq))))
+
(defun command-completion-default-include-p (symbol buffer)
"Say whether SYMBOL should be offered as a completion.
If there's a `completion-predicate' for SYMBOL, the result from
@@ -2004,24 +2026,8 @@ BUFFER."
(if (get symbol 'completion-predicate)
;; An explicit completion predicate takes precedence.
(funcall (get symbol 'completion-predicate) symbol buffer)
- ;; Check the modes.
- (let ((modes (command-modes symbol)))
- (or (null modes)
- ;; Common case: Just a single mode.
- (if (null (cdr modes))
- (or (provided-mode-derived-p
- (buffer-local-value 'major-mode buffer) (car modes))
- (memq (car modes)
- (buffer-local-value 'local-minor-modes buffer))
- (memq (car modes) global-minor-modes))
- ;; Uncommon case: Multiple modes.
- (apply #'provided-mode-derived-p
- (buffer-local-value 'major-mode buffer)
- modes)
- (seq-intersection modes
- (buffer-local-value 'local-minor-modes buffer)
- #'eq)
- (seq-intersection modes global-minor-modes #'eq))))))
+ (or (null (command-modes symbol))
+ (command-completion-using-modes-p symbol buffer))))
(defun command-completion-with-modes-p (modes buffer)
"Say whether MODES are in action in BUFFER.
@@ -2189,6 +2195,38 @@ invoking, give a prefix argument to `execute-extended-command'."
suggest-key-bindings
2))))))))
+(defun execute-extended-command-for-buffer (prefixarg &optional
+ command-name typed)
+ "Query user for a command relevant for the current mode, and then execute it.
+This is like `execute-extended-command', but it limits the
+completions to commands that are particularly relevant to the
+current buffer. This includes commands that have been marked as
+being specially designed for the current major mode (and enabled
+minor modes), as well as commands bound in the active local key
+maps."
+ (declare (interactive-only command-execute))
+ (interactive
+ (let* ((execute-extended-command--last-typed nil)
+ (keymaps
+ ;; The major mode's keymap and any active minor modes.
+ (cons
+ (current-local-map)
+ (mapcar
+ #'cdr
+ (seq-filter
+ (lambda (elem)
+ (symbol-value (car elem)))
+ minor-mode-map-alist))))
+ (read-extended-command-predicate
+ (lambda (symbol buffer)
+ (or (command-completion-using-modes-p symbol buffer)
+ (where-is-internal symbol keymaps)))))
+ (list current-prefix-arg
+ (read-extended-command)
+ execute-extended-command--last-typed)))
+ (with-suppressed-warnings ((interactive-only execute-extended-command))
+ (execute-extended-command prefixarg command-name typed)))
+
(defun command-execute (cmd &optional record-flag keys special)
;; BEWARE: Called directly from the C code.
"Execute CMD as an editor command.
@@ -5976,8 +6014,9 @@ START and END specify the portion of the current buffer to be copied."
(defvar activate-mark-hook nil
"Hook run when the mark becomes active.
-It is also run at the end of a command, if the mark is active and
-it is possible that the region may have changed.")
+It is also run when the region is reactivated, for instance after
+using a command that switches back to a buffer that has an active
+mark.")
(defvar deactivate-mark-hook nil
"Hook run when the mark becomes inactive.")
diff --git a/lisp/subr.el b/lisp/subr.el
index 490aec93f19b..2ad31b656eae 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -373,10 +373,18 @@ PREFIX is a string, and defaults to \"g\"."
(defun ignore (&rest _arguments)
"Do nothing and return nil.
-This function accepts any number of ARGUMENTS, but ignores them."
+This function accepts any number of ARGUMENTS, but ignores them.
+Also see `always'."
+ (declare (completion #'ignore))
(interactive)
nil)
+(defun always (&rest _arguments)
+ "Do nothing and return t.
+This function accepts any number of ARGUMENTS, but ignores them.
+Also see `ignore'."
+ t)
+
;; Signal a compile-error if the first arg is missing.
(defun error (&rest args)
"Signal an error, making a message by passing ARGS to `format-message'.
@@ -915,6 +923,7 @@ For an approximate inverse of this, see `key-description'."
(defun undefined ()
"Beep to tell the user this binding is undefined."
+ (declare (completion #'ignore))
(interactive)
(ding)
(if defining-kbd-macro
@@ -1298,6 +1307,7 @@ in a cleaner way with command remapping, like this:
(define-key map "l" #'downcase-word)
(define-key map "c" #'capitalize-word)
(define-key map "x" #'execute-extended-command)
+ (define-key map "X" #'execute-extended-command-for-buffer)
map)
"Default keymap for ESC (meta) commands.
The normal global definition of the character ESC indirects to this keymap.")
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index dba79fbd81cd..41844e6f5c8f 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -100,11 +100,13 @@ Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
"Install key bindings for switching between tabs if the user has configured them."
(when tab-bar-select-tab-modifiers
(global-set-key (vector (append tab-bar-select-tab-modifiers (list ?0)))
- 'tab-bar-switch-to-recent-tab)
- (dotimes (i 9)
+ 'tab-recent)
+ (dotimes (i 8)
(global-set-key (vector (append tab-bar-select-tab-modifiers
(list (+ i 1 ?0))))
- 'tab-bar-select-tab)))
+ 'tab-bar-select-tab))
+ (global-set-key (vector (append tab-bar-select-tab-modifiers (list ?9)))
+ 'tab-last))
;; Don't override user customized key bindings
(unless (global-key-binding [(control tab)])
(global-set-key [(control tab)] 'tab-next))
@@ -113,6 +115,15 @@ Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
(unless (global-key-binding [(control shift iso-lefttab)])
(global-set-key [(control shift iso-lefttab)] 'tab-previous)))
+(defun tab-bar--undefine-keys ()
+ "Uninstall key bindings previously bound by `tab-bar--define-keys'."
+ (when (eq (global-key-binding [(control tab)]) 'tab-next)
+ (global-unset-key [(control tab)]))
+ (when (eq (global-key-binding [(control shift tab)]) 'tab-previous)
+ (global-unset-key [(control shift tab)]))
+ (when (eq (global-key-binding [(control shift iso-lefttab)]) 'tab-previous)
+ (global-unset-key [(control shift iso-lefttab)])))
+
(defun tab-bar--load-buttons ()
"Load the icons for the tab buttons."
(when (and tab-bar-new-button
@@ -181,13 +192,7 @@ update."
(tab-bar--load-buttons))
(if tab-bar-mode
(tab-bar--define-keys)
- ;; Unset only keys bound by tab-bar
- (when (eq (global-key-binding [(control tab)]) 'tab-next)
- (global-unset-key [(control tab)]))
- (when (eq (global-key-binding [(control shift tab)]) 'tab-previous)
- (global-unset-key [(control shift tab)]))
- (when (eq (global-key-binding [(control shift iso-lefttab)]) 'tab-previous)
- (global-unset-key [(control shift iso-lefttab)]))))
+ (tab-bar--undefine-keys)))
(defun tab-bar-handle-mouse (event)
"Text-mode emulation of switching tabs on the tab bar.
@@ -717,6 +722,12 @@ ARG counts from 1."
(setq arg 1))
(tab-bar-switch-to-next-tab (- arg)))
+(defun tab-bar-switch-to-last-tab (&optional arg)
+ "Switch to the last tab or ARGth tab from the end of the tab bar."
+ (interactive "p")
+ (tab-bar-select-tab (- (length (funcall tab-bar-tabs-function))
+ (1- (or arg 1)))))
+
(defun tab-bar-switch-to-recent-tab (&optional arg)
"Switch to ARGth most recently visited tab."
(interactive "p")
@@ -731,7 +742,8 @@ ARG counts from 1."
"Switch to the tab by NAME.
Default values are tab names sorted by recency, so you can use \
\\\\[next-history-element]
-to get the name of the last visited tab, the second last, and so on."
+to get the name of the most recently visited tab, the second
+most recent, and so on."
(interactive
(let* ((recent-tabs (mapcar (lambda (tab)
(alist-get 'name tab))
@@ -747,12 +759,17 @@ to get the name of the last visited tab, the second last, and so on."
(defun tab-bar-move-tab-to (to-index &optional from-index)
"Move tab from FROM-INDEX position to new position at TO-INDEX.
FROM-INDEX defaults to the current tab index.
-FROM-INDEX and TO-INDEX count from 1."
+FROM-INDEX and TO-INDEX count from 1.
+Negative TO-INDEX counts tabs from the end of the tab bar.
+Argument addressing is absolute in contrast to `tab-bar-move-tab'
+where argument addressing is relative."
(interactive "P")
(let* ((tabs (funcall tab-bar-tabs-function))
(from-index (or from-index (1+ (tab-bar--current-tab-index tabs))))
(from-tab (nth (1- from-index) tabs))
- (to-index (max 0 (min (1- (or to-index 1)) (1- (length tabs))))))
+ (to-index (if to-index (prefix-numeric-value to-index) 1))
+ (to-index (if (< to-index 0) (+ (length tabs) (1+ to-index)) to-index))
+ (to-index (max 0 (min (1- to-index) (1- (length tabs))))))
(setq tabs (delq from-tab tabs))
(cl-pushnew from-tab (nthcdr to-index tabs))
(set-frame-parameter nil 'tabs tabs)
@@ -760,7 +777,9 @@ FROM-INDEX and TO-INDEX count from 1."
(defun tab-bar-move-tab (&optional arg)
"Move the current tab ARG positions to the right.
-If a negative ARG, move the current tab ARG positions to the left."
+If a negative ARG, move the current tab ARG positions to the left.
+Argument addressing is relative in contrast to `tab-bar-move-tab-to'
+where argument addressing is absolute."
(interactive "p")
(let* ((tabs (funcall tab-bar-tabs-function))
(from-index (or (tab-bar--current-tab-index tabs) 0))
@@ -828,7 +847,9 @@ called."
"Add a new tab at the absolute position TO-INDEX.
TO-INDEX counts from 1. If no TO-INDEX is specified, then add
a new tab at the position specified by `tab-bar-new-tab-to'.
-
+Negative TO-INDEX counts tabs from the end of the tab bar.
+Argument addressing is absolute in contrast to `tab-bar-new-tab'
+where argument addressing is relative.
After the tab is created, the hooks in
`tab-bar-tab-post-open-functions' are run."
(interactive "P")
@@ -855,15 +876,19 @@ After the tab is created, the hooks in
(when from-index
(setf (nth from-index tabs) from-tab))
- (let ((to-tab (tab-bar--current-tab))
- (to-index (or (if to-index (1- to-index))
- (pcase tab-bar-new-tab-to
- ('leftmost 0)
- ('rightmost (length tabs))
- ('left (or from-index 1))
- ('right (1+ (or from-index 0)))
- ((pred functionp)
- (funcall tab-bar-new-tab-to))))))
+ (let* ((to-tab (tab-bar--current-tab))
+ (to-index (and to-index (prefix-numeric-value to-index)))
+ (to-index (or (if to-index
+ (if (< to-index 0)
+ (+ (length tabs) (1+ to-index))
+ (1- to-index)))
+ (pcase tab-bar-new-tab-to
+ ('leftmost 0)
+ ('rightmost (length tabs))
+ ('left (or from-index 1))
+ ('right (1+ (or from-index 0)))
+ ((pred functionp)
+ (funcall tab-bar-new-tab-to))))))
(setq to-index (max 0 (min (or to-index 0) (length tabs))))
(cl-pushnew to-tab (nthcdr to-index tabs))
@@ -888,7 +913,11 @@ After the tab is created, the hooks in
(defun tab-bar-new-tab (&optional arg)
"Create a new tab ARG positions to the right.
If a negative ARG, create a new tab ARG positions to the left.
-If ARG is zero, create a new tab in place of the current tab."
+If ARG is zero, create a new tab in place of the current tab.
+If no ARG is specified, then add a new tab at the position
+specified by `tab-bar-new-tab-to'.
+Argument addressing is relative in contrast to `tab-bar-new-tab-to'
+where argument addressing is absolute."
(interactive "P")
(if arg
(let* ((tabs (funcall tab-bar-tabs-function))
@@ -1067,7 +1096,7 @@ for the last tab on a frame is determined by
(message "Deleted all other tabs")))))
(defun tab-bar-undo-close-tab ()
- "Restore the last closed tab."
+ "Restore the most recently closed tab."
(interactive)
;; Pop out closed tabs that were on already deleted frames
(while (and tab-bar-closed-tabs
@@ -1258,6 +1287,7 @@ and can restore them."
(defalias 'tab-select 'tab-bar-select-tab)
(defalias 'tab-next 'tab-bar-switch-to-next-tab)
(defalias 'tab-previous 'tab-bar-switch-to-prev-tab)
+(defalias 'tab-last 'tab-bar-switch-to-last-tab)
(defalias 'tab-recent 'tab-bar-switch-to-recent-tab)
(defalias 'tab-move 'tab-bar-move-tab)
(defalias 'tab-move-to 'tab-bar-move-tab-to)
@@ -1669,11 +1699,13 @@ When `switch-to-buffer-obey-display-actions' is non-nil,
nil "[other-tab]")
(message "Display next command buffer in a new tab..."))
+(define-key tab-prefix-map "N" 'tab-new-to)
(define-key tab-prefix-map "2" 'tab-new)
(define-key tab-prefix-map "1" 'tab-close-other)
(define-key tab-prefix-map "0" 'tab-close)
(define-key tab-prefix-map "o" 'tab-next)
(define-key tab-prefix-map "m" 'tab-move)
+(define-key tab-prefix-map "M" 'tab-move-to)
(define-key tab-prefix-map "r" 'tab-rename)
(define-key tab-prefix-map "\r" 'tab-bar-select-tab-by-name)
(define-key tab-prefix-map "b" 'switch-to-buffer-other-tab)
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index e66adb43e75f..9a886d239714 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -481,50 +481,6 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.")
(defvar artist-arrow-point-1 nil)
(defvar artist-arrow-point-2 nil)
-(defvar artist-menu-map
- (let ((map (make-sparse-keymap)))
- (define-key map [spray-chars]
- '(menu-item "Characters for Spray" artist-select-spray-chars
- :help "Choose characters for sprayed by the spray-can"))
- (define-key map [borders]
- '(menu-item "Draw Shape Borders" artist-toggle-borderless-shapes
- :help "Toggle whether shapes are drawn with borders"
- :button (:toggle . (not artist-borderless-shapes))))
- (define-key map [trimming]
- '(menu-item "Trim Line Endings" artist-toggle-trim-line-endings
- :help "Toggle trimming of line-endings"
- :button (:toggle . artist-trim-line-endings)))
- (define-key map [rubber-band]
- '(menu-item "Rubber-banding" artist-toggle-rubber-banding
- :help "Toggle rubber-banding"
- :button (:toggle . artist-rubber-banding)))
- (define-key map [set-erase]
- '(menu-item "Character to Erase..." artist-select-erase-char
- :help "Choose a specific character to erase"))
- (define-key map [set-line]
- '(menu-item "Character for Line..." artist-select-line-char
- :help "Choose the character to insert when drawing lines"))
- (define-key map [set-fill]
- '(menu-item "Character for Fill..." artist-select-fill-char
- :help "Choose the character to insert when filling in shapes"))
- (define-key map [artist-separator] '(menu-item "--"))
- (dolist (op '(("Vaporize" artist-select-op-vaporize-lines vaporize-lines)
- ("Erase" artist-select-op-erase-rectangle erase-rect)
- ("Spray-can" artist-select-op-spray-set-size spray-get-size)
- ("Text" artist-select-op-text-overwrite text-ovwrt)
- ("Ellipse" artist-select-op-circle circle)
- ("Poly-line" artist-select-op-straight-poly-line spolyline)
- ("Square" artist-select-op-square square)
- ("Rectangle" artist-select-op-rectangle rectangle)
- ("Line" artist-select-op-straight-line s-line)
- ("Pen" artist-select-op-pen-line pen-line)))
- (define-key map (vector (nth 2 op))
- `(menu-item ,(nth 0 op)
- ,(nth 1 op)
- :help ,(format "Draw using the %s style" (nth 0 op))
- :button (:radio . (eq artist-curr-go ',(nth 2 op))))))
- map))
-
(defvar artist-mode-map
(let ((map (make-sparse-keymap)))
(setq artist-mode-map (make-sparse-keymap))
@@ -577,10 +533,50 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.")
(define-key map "\C-c\C-a\C-y" 'artist-select-op-paste)
(define-key map "\C-c\C-af" 'artist-select-op-flood-fill)
(define-key map "\C-c\C-a\C-b" 'artist-submit-bug-report)
- (define-key map [menu-bar artist] (cons "Artist" artist-menu-map))
map)
"Keymap for `artist-mode'.")
+(easy-menu-define artist-menu-map artist-mode-map
+ "Menu for `artist-mode'."
+ `("Artist"
+ ,@(mapcar
+ (lambda (op)
+ `[,(nth 0 op) ,(nth 1 op)
+ :help ,(format "Draw using the %s style" (nth 0 op))
+ :style radio
+ :selected (eq artist-curr-go ',(nth 2 op))])
+ '(("Vaporize" artist-select-op-vaporize-lines vaporize-lines)
+ ("Erase" artist-select-op-erase-rectangle erase-rect)
+ ("Spray-can" artist-select-op-spray-set-size spray-get-size)
+ ("Text" artist-select-op-text-overwrite text-ovwrt)
+ ("Ellipse" artist-select-op-circle circle)
+ ("Poly-line" artist-select-op-straight-poly-line spolyline)
+ ("Square" artist-select-op-square square)
+ ("Rectangle" artist-select-op-rectangle rectangle)
+ ("Line" artist-select-op-straight-line s-line)
+ ("Pen" artist-select-op-pen-line pen-line)))
+ "---"
+ ["Character for Fill..." artist-select-fill-char
+ :help "Choose the character to insert when filling in shapes"]
+ ["Character for Line..." artist-select-line-char
+ :help "Choose the character to insert when drawing lines"]
+ ["Character to Erase..." artist-select-erase-char
+ :help "Choose a specific character to erase"]
+ ["Rubber-banding" artist-toggle-rubber-banding
+ :help "Toggle rubber-banding"
+ :style toggle
+ :selected artist-rubber-banding]
+ ["Trim Line Endings" artist-toggle-trim-line-endings
+ :help "Toggle trimming of line-endings"
+ :style toggle
+ :selected artist-trim-line-endings]
+ ["Draw Shape Borders" artist-toggle-borderless-shapes
+ :help "Toggle whether shapes are drawn with borders"
+ :style toggle
+ :selected (not artist-borderless-shapes)]
+ ["Characters for Spray" artist-select-spray-chars
+ :help "Choose characters for sprayed by the spray-can"]))
+
(defvar artist-replacement-table (make-vector 256 0)
"Replacement table for `artist-replace-char'.")
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index a22cd97b309e..301f7017e415 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -3327,7 +3327,7 @@ Use `bibtex-summary-function' to generate summary."
(message "%s %s" key summary))))))
(defun bibtex-copy-summary-as-kill (&optional arg)
- "Push summery of current BibTeX entry to kill ring.
+ "Push summary of current BibTeX entry to kill ring.
Use `bibtex-summary-function' to generate summary.
If prefix ARG is non-nil push BibTeX entry's URL to kill ring
that is generated by calling `bibtex-url'."
diff --git a/lisp/textmodes/conf-mode.el b/lisp/textmodes/conf-mode.el
index d88964aa4f0e..5f34ae152d1a 100644
--- a/lisp/textmodes/conf-mode.el
+++ b/lisp/textmodes/conf-mode.el
@@ -63,8 +63,7 @@ not align (only setting space according to `conf-assignment-space')."
:type 'boolean)
(defvar conf-mode-map
- (let ((map (make-sparse-keymap))
- (menu-map (make-sparse-keymap)))
+ (let ((map (make-sparse-keymap)))
(define-key map "\C-c\C-u" 'conf-unix-mode)
(define-key map "\C-c\C-w" 'conf-windows-mode)
(define-key map "\C-c\C-j" 'conf-javaprop-mode)
@@ -78,52 +77,46 @@ not align (only setting space according to `conf-assignment-space')."
(define-key map "\C-c\"" 'conf-quote-normal)
(define-key map "\C-c'" 'conf-quote-normal)
(define-key map "\C-c\C-a" 'conf-align-assignments)
- (define-key map [menu-bar sh-script] (cons "Conf" menu-map))
- (define-key menu-map [conf-windows-mode]
- '(menu-item "Windows mode"
- conf-windows-mode
- :help "Conf Mode starter for Windows style Conf files"
- :button (:radio . (eq major-mode 'conf-windows-mode))))
- (define-key menu-map [conf-javaprop-mode]
- '(menu-item "Java properties mode"
- conf-javaprop-mode
- :help "Conf Mode starter for Java properties files"
- :button (:radio . (eq major-mode 'conf-javaprop-mode))))
- (define-key menu-map [conf-space-keywords]
- '(menu-item "Space keywords mode..."
- conf-space-keywords
- :help "Enter Conf Space mode using regexp KEYWORDS to match the keywords"
- :button (:radio . (eq major-mode 'conf-space-keywords))))
- (define-key menu-map [conf-ppd-mode]
- '(menu-item "PPD mode"
- conf-ppd-mode
- :help "Conf Mode starter for Adobe/CUPS PPD files"
- :button (:radio . (eq major-mode 'conf-ppd-mode))))
- (define-key menu-map [conf-colon-mode]
- '(menu-item "Colon mode"
- conf-colon-mode
- :help "Conf Mode starter for Colon files"
- :button (:radio . (eq major-mode 'conf-colon-mode))))
- (define-key menu-map [conf-unix-mode]
- '(menu-item "Unix mode"
- conf-unix-mode
- :help "Conf Mode starter for Unix style Conf files"
- :button (:radio . (eq major-mode 'conf-unix-mode))))
- (define-key menu-map [conf-xdefaults-mode]
- '(menu-item "Xdefaults mode"
- conf-xdefaults-mode
- :help "Conf Mode starter for Xdefaults files"
- :button (:radio . (eq major-mode 'conf-xdefaults-mode))))
- (define-key menu-map [c-s0] '("--"))
- (define-key menu-map [conf-quote-normal]
- '(menu-item "Set quote syntax normal" conf-quote-normal
- :help "Set the syntax of \\=' and \" to punctuation"))
- (define-key menu-map [conf-align-assignments]
- '(menu-item "Align assignments" conf-align-assignments
- :help "Align assignments"))
map)
"Local keymap for `conf-mode' buffers.")
+(easy-menu-define conf-mode-menu conf-mode-map
+ "Menu for `conf-mode'."
+ '("Conf"
+ ["Align assignments" conf-align-assignments
+ :help "Align assignments"]
+ ["Set quote syntax normal" conf-quote-normal
+ :help "Set the syntax of \\=' and \" to punctuation"]
+ "---"
+ ["Xdefaults mode" conf-xdefaults-mode
+ :help "Conf Mode starter for Xdefaults files"
+ :style radio
+ :selected (eq major-mode 'conf-xdefaults-mode)]
+ ["Unix mode" conf-unix-mode
+ :help "Conf Mode starter for Unix style Conf files"
+ :style radio
+ :selected (eq major-mode 'conf-unix-mode)]
+ ["Colon mode" conf-colon-mode
+ :help "Conf Mode starter for Colon files"
+ :style radio
+ :selected (eq major-mode 'conf-colon-mode)]
+ ["PPD mode" conf-ppd-mode
+ :help "Conf Mode starter for Adobe/CUPS PPD files"
+ :style radio
+ :selected (eq major-mode 'conf-ppd-mode)]
+ ["Space keywords mode..." conf-space-keywords
+ :help "Enter Conf Space mode using regexp KEYWORDS to match the keywords"
+ :style radio
+ :selected (eq major-mode 'conf-space-keywords)]
+ ["Java properties mode" conf-javaprop-mode
+ :help "Conf Mode starter for Java properties files"
+ :style radio
+ :selected (eq major-mode 'conf-javaprop-mode)]
+ ["Windows mode" conf-windows-mode
+ :help "Conf Mode starter for Windows style Conf files"
+ :style radio
+ :selected (eq major-mode 'conf-windows-mode)]))
+
(defvar conf-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?= "." table)
diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el
index e7d852be3c83..7d9b414bf0c2 100644
--- a/lisp/textmodes/nroff-mode.el
+++ b/lisp/textmodes/nroff-mode.el
@@ -46,38 +46,34 @@
:type 'boolean)
(defvar nroff-mode-map
- (let ((map (make-sparse-keymap))
- (menu-map (make-sparse-keymap)))
+ (let ((map (make-sparse-keymap)))
(define-key map "\t" 'tab-to-tab-stop)
(define-key map "\e?" 'nroff-count-text-lines)
(define-key map "\n" 'nroff-electric-newline)
(define-key map "\en" 'nroff-forward-text-line)
(define-key map "\ep" 'nroff-backward-text-line)
(define-key map "\C-c\C-c" 'nroff-view)
- (define-key map [menu-bar nroff-mode] (cons "Nroff" menu-map))
- (define-key menu-map [nn]
- '(menu-item "Newline" nroff-electric-newline
- :help "Insert newline for nroff mode; special if nroff-electric mode"))
- (define-key menu-map [nc]
- '(menu-item "Count text lines" nroff-count-text-lines
- :help "Count lines in region, except for nroff request lines."))
- (define-key menu-map [nf]
- '(menu-item "Forward text line" nroff-forward-text-line
- :help "Go forward one nroff text line, skipping lines of nroff requests"))
- (define-key menu-map [nb]
- '(menu-item "Backward text line" nroff-backward-text-line
- :help "Go backward one nroff text line, skipping lines of nroff requests"))
- (define-key menu-map [ne]
- '(menu-item "Electric newline mode"
- nroff-electric-mode
- :help "Auto insert closing requests if necessary"
- :button (:toggle . nroff-electric-mode)))
- (define-key menu-map [npm]
- '(menu-item "Preview as man page" nroff-view
- :help "Run man on this file."))
map)
"Major mode keymap for `nroff-mode'.")
+(easy-menu-define nroff-mode-menu nroff-mode-map
+ "Menu for `nroff-mode'."
+ '("Nroff"
+ ["Preview as man page" nroff-view
+ :help "Run man on this file."]
+ ["Electric newline mode" nroff-electric-mode
+ :help "Auto insert closing requests if necessary"
+ :style toggle
+ :selected nroff-electric-mode]
+ ["Backward text line" nroff-backward-text-line
+ :help "Go backward one nroff text line, skipping lines of nroff requests"]
+ ["Forward text line" nroff-forward-text-line
+ :help "Go forward one nroff text line, skipping lines of nroff requests"]
+ ["Count text lines" nroff-count-text-lines
+ :help "Count lines in region, except for nroff request lines."]
+ ["Newline" nroff-electric-newline
+ :help "Insert newline for nroff mode; special if nroff-electric mode"]))
+
(defvar nroff-mode-syntax-table
(let ((st (copy-syntax-table text-mode-syntax-table)))
;; " isn't given string quote syntax in text-mode but it
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el
index ea35641a6c6f..04778ee94d4a 100644
--- a/lisp/textmodes/texnfo-upd.el
+++ b/lisp/textmodes/texnfo-upd.el
@@ -1033,7 +1033,7 @@ However, there does not need to be a title field."
(save-excursion
;; `master-menu-inserted-p' is a kludge to tell
- ;; whether to insert @end detailmenu (see bleow)
+ ;; whether to insert @end detailmenu (see below)
(let (master-menu-inserted-p)
;; Handle top of menu
(insert "\n@menu\n")
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 8cebd4e79f6a..e3c178630ae8 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -1292,7 +1292,7 @@ passing it an updated value of CBARGS as arguments. The first
element in CBARGS should be a plist describing what has happened
so far during the request, as described in the docstring of
`url-retrieve' (if in doubt, specify nil). The current buffer
-then CALLBACK is executed is the retrieval buffer.
+when CALLBACK is executed is the retrieval buffer.
Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a
previous `url-http' call, which is being re-attempted.
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el
index 9ef2da737a44..2548fa4d448e 100644
--- a/lisp/w32-fns.el
+++ b/lisp/w32-fns.el
@@ -255,6 +255,7 @@ bit output with no translation."
(w32-add-charset-info "iso8859-2" 'w32-charset-easteurope 28592)
(w32-add-charset-info "iso8859-3" 'w32-charset-turkish 28593)
(w32-add-charset-info "iso8859-4" 'w32-charset-baltic 28594)
+ (w32-add-charset-info "iso8859-5" 'w32-charset-russian 28595)
(w32-add-charset-info "iso8859-6" 'w32-charset-arabic 28596)
(w32-add-charset-info "iso8859-7" 'w32-charset-greek 28597)
(w32-add-charset-info "iso8859-8" 'w32-charset-hebrew 1255)
diff --git a/lisp/wdired.el b/lisp/wdired.el
index a096abd106f4..3829ff1f9774 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -169,9 +169,9 @@ nonexistent directory will fail."
(define-key map "\C-c\C-k" 'wdired-abort-changes)
(define-key map "\C-c\C-[" 'wdired-abort-changes)
(define-key map "\C-x\C-q" 'wdired-exit)
- (define-key map "\C-m" 'ignore)
- (define-key map "\C-j" 'ignore)
- (define-key map "\C-o" 'ignore)
+ (define-key map "\C-m" 'undefined)
+ (define-key map "\C-j" 'undefined)
+ (define-key map "\C-o" 'undefined)
(define-key map [up] 'wdired-previous-line)
(define-key map "\C-p" 'wdired-previous-line)
(define-key map [down] 'wdired-next-line)
diff --git a/lisp/woman.el b/lisp/woman.el
index 9a03d30bb7f9..d4f7e8c0db7e 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -69,13 +69,7 @@
;; Recommended use
;; ===============
-;; Put this in your .emacs:
-;; (autoload 'woman "woman"
-;; "Decode and browse a UN*X man page." t)
-;; (autoload 'woman-find-file "woman"
-;; "Find, decode and browse a specific UN*X man-page file." t)
-
-;; Then either (1 -- *RECOMMENDED*): If the `MANPATH' environment
+;; Either (1 -- *RECOMMENDED*): If the `MANPATH' environment
;; variable is set then WoMan will use it; otherwise you may need to
;; reset the Lisp variable `woman-manpath', and you may also want to
;; set the Lisp variable `woman-path'. Please see the online
@@ -139,14 +133,8 @@
;; ==============================
;; WoMan supports the GNU Emacs customization facility, and puts
-;; a customization group called `WoMan' in the `Help' group under the
-;; top-level `Emacs' group. In order to be able to customize WoMan
-;; without first loading it, add the following sexp to your .emacs:
-
-;; (defgroup woman nil
-;; "Browse UNIX manual pages `wo (without) man'."
-;; :tag "WoMan" :group 'help :load "woman")
-
+;; a customization group called `woman' in the `help' group under the
+;; top-level `emacs' group.
;; WoMan currently runs two hooks: `woman-pre-format-hook' immediately
;; before formatting a buffer and `woman-post-format-hook' immediately
@@ -1868,13 +1856,15 @@ Argument EVENT is the invoking mouse event."
(defvar bookmark-make-record-function)
-(define-derived-mode woman-mode special-mode "WoMan"
+(define-derived-mode woman-mode man-common "WoMan"
"Turn on (most of) Man mode to browse a buffer formatted by WoMan.
WoMan is an ELisp emulation of much of the functionality of the Emacs
`man' command running the standard UN*X man and ?roff programs.
WoMan author: F.J.Wright@Maths.QMW.ac.uk
See `Man-mode' for additional details.
\\{woman-mode-map}"
+ ;; FIXME: Should all this just be re-arranged so that this can just
+ ;; inherit `man-common' and be done with it?
(let ((Man-build-page-list (symbol-function 'Man-build-page-list))
(Man-strip-page-headers (symbol-function 'Man-strip-page-headers))
(Man-unindent (symbol-function 'Man-unindent))
diff --git a/src/alloc.c b/src/alloc.c
index b86ed4ed2621..e72fc4c4332d 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3498,6 +3498,38 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
return val;
}
+DEFUN ("make-closure", Fmake_closure, Smake_closure, 1, MANY, 0,
+ doc: /* Create a byte-code closure from PROTOTYPE and CLOSURE-VARS.
+Return a copy of PROTOTYPE, a byte-code object, with CLOSURE-VARS
+replacing the elements in the beginning of the constant-vector.
+usage: (make-closure PROTOTYPE &rest CLOSURE-VARS) */)
+ (ptrdiff_t nargs, Lisp_Object *args)
+{
+ Lisp_Object protofun = args[0];
+ CHECK_TYPE (COMPILEDP (protofun), Qbyte_code_function_p, protofun);
+
+ /* Create a copy of the constant vector, filling it with the closure
+ variables in the beginning. (The overwritten part should just
+ contain placeholder values.) */
+ Lisp_Object proto_constvec = AREF (protofun, COMPILED_CONSTANTS);
+ ptrdiff_t constsize = ASIZE (proto_constvec);
+ ptrdiff_t nvars = nargs - 1;
+ if (nvars > constsize)
+ error ("Closure vars do not fit in constvec");
+ Lisp_Object constvec = make_uninit_vector (constsize);
+ memcpy (XVECTOR (constvec)->contents, args + 1, nvars * word_size);
+ memcpy (XVECTOR (constvec)->contents + nvars,
+ XVECTOR (proto_constvec)->contents + nvars,
+ (constsize - nvars) * word_size);
+
+ /* Return a copy of the prototype function with the new constant vector. */
+ ptrdiff_t protosize = PVSIZE (protofun);
+ struct Lisp_Vector *v = allocate_vectorlike (protosize, false);
+ v->header = XVECTOR (protofun)->header;
+ memcpy (v->contents, XVECTOR (protofun)->contents, protosize * word_size);
+ v->contents[COMPILED_CONSTANTS] = constvec;
+ return make_lisp_ptr (v, Lisp_Vectorlike);
+}
/***********************************************************************
@@ -7573,6 +7605,7 @@ N should be nonnegative. */);
defsubr (&Srecord);
defsubr (&Sbool_vector);
defsubr (&Smake_byte_code);
+ defsubr (&Smake_closure);
defsubr (&Smake_list);
defsubr (&Smake_vector);
defsubr (&Smake_record);
diff --git a/src/callproc.c b/src/callproc.c
index cb72b070b7bb..cd0f67fe29b8 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -411,7 +411,11 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
/* If the buffer is (still) a list, it might be a (:file "file") spec. */
if (CONSP (buffer) && EQ (XCAR (buffer), QCfile))
{
- output_file = Fexpand_file_name (XCAR (XCDR (buffer)),
+ Lisp_Object ofile = XCDR (buffer);
+ if (CONSP (ofile))
+ ofile = XCAR (ofile);
+ CHECK_STRING (ofile);
+ output_file = Fexpand_file_name (ofile,
BVAR (current_buffer, directory));
CHECK_STRING (output_file);
buffer = Qnil;
diff --git a/src/data.c b/src/data.c
index ace859d2d0cc..0fa491b17a11 100644
--- a/src/data.c
+++ b/src/data.c
@@ -957,9 +957,17 @@ The value, if non-nil, is a list of mode name symbols. */)
if (NILP (fun))
return Qnil;
+ /* Use a `command-modes' property if present, analogous to the
+ function-documentation property. */
fun = command;
while (SYMBOLP (fun))
- fun = Fsymbol_function (fun);
+ {
+ Lisp_Object modes = Fget (fun, Qcommand_modes);
+ if (!NILP (modes))
+ return modes;
+ else
+ fun = Fsymbol_function (fun);
+ }
if (COMPILEDP (fun))
{
@@ -3981,6 +3989,8 @@ syms_of_data (void)
DEFSYM (Qinteractive_form, "interactive-form");
DEFSYM (Qdefalias_fset_function, "defalias-fset-function");
+ DEFSYM (Qbyte_code_function_p, "byte-code-function-p");
+
defsubr (&Sindirect_variable);
defsubr (&Sinteractive_form);
defsubr (&Scommand_modes);
diff --git a/src/dispnew.c b/src/dispnew.c
index e603c6713637..b3e4587250f8 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3328,7 +3328,7 @@ update_frame_with_menu (struct frame *f, int row, int col)
}
/* Update the mouse position for a frame F. This handles both
- updating the display for mouse-face propreties and updating the
+ updating the display for mouse-face properties and updating the
help echo text.
Returns the number of events generated. */
diff --git a/src/editfns.c b/src/editfns.c
index 991f79abac7a..fb20fc965502 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2945,7 +2945,7 @@ usage: (propertize STRING &rest PROPERTIES) */)
/* Number of args must be odd. */
if ((nargs & 1) == 0)
- error ("Wrong number of arguments");
+ xsignal2 (Qwrong_number_of_arguments, Qpropertize, make_fixnum (nargs));
properties = string = Qnil;
@@ -4448,6 +4448,7 @@ syms_of_editfns (void)
{
DEFSYM (Qbuffer_access_fontify_functions, "buffer-access-fontify-functions");
DEFSYM (Qwall, "wall");
+ DEFSYM (Qpropertize, "propertize");
DEFVAR_LISP ("inhibit-field-text-motion", Vinhibit_field_text_motion,
doc: /* Non-nil means text motion commands don't notice fields. */);
diff --git a/src/font.c b/src/font.c
index a59ebe216b87..7c1d1ff89b10 100644
--- a/src/font.c
+++ b/src/font.c
@@ -4122,7 +4122,7 @@ representing the OpenType features supported by the font by this form:
SCRIPT, LANGSYS, and FEATURE are all symbols representing OpenType
Layout tags.
-In addition to the keys listed abobe, the following keys are reserved
+In addition to the keys listed above, the following keys are reserved
for the specific meanings as below:
The value of :combining-capability is non-nil if the font-backend of
diff --git a/src/indent.c b/src/indent.c
index 0a6b460f7534..6246b544fbd2 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1315,7 +1315,7 @@ compute_motion (ptrdiff_t from, ptrdiff_t frombyte, EMACS_INT fromvpos,
j ^---- next after the point
^--- next char. after the point.
----------
- In case of sigle-column character
+ In case of single-column character
----------
abcdefgh\\
diff --git a/src/nsterm.m b/src/nsterm.m
index b0cf5952fd50..88317f883936 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8377,6 +8377,11 @@ - (void)focusOnDrawingBuffer
surface = [[EmacsSurface alloc] initWithSize:s
ColorSpace:[[[self window] colorSpace]
CGColorSpace]];
+
+ /* Since we're using NSViewLayerContentsRedrawOnSetNeedsDisplay
+ the layer's scale factor is not set automatically, so do it
+ now. */
+ [[self layer] setContentsScale:[[self window] backingScaleFactor]];
}
CGContextRef context = [surface getContext];
@@ -9762,7 +9767,7 @@ - (void) dealloc
for (id object in cache)
CFRelease ((IOSurfaceRef)object);
- [cache removeAllObjects];
+ [cache release];
[super dealloc];
}
diff --git a/src/process.c b/src/process.c
index 3beb9cf71464..b98bc297a3f3 100644
--- a/src/process.c
+++ b/src/process.c
@@ -8255,7 +8255,7 @@ init_process_emacs (int sockfd)
private SIGCHLD handler, allowing catch_child_signal to copy
it into lib_child_handler.
- Unfortunatly in glib commit 2e471acf, the behavior changed to
+ Unfortunately in glib commit 2e471acf, the behavior changed to
always install a signal handler when g_child_watch_source_new
is called and not just the first time it's called. Glib also
now resets signal handlers to SIG_DFL when it no longer has a
diff --git a/src/w32.c b/src/w32.c
index a3c247b8b0df..aade80248110 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -346,6 +346,7 @@ static BOOL g_b_init_get_adapters_addresses;
static BOOL g_b_init_reg_open_key_ex_w;
static BOOL g_b_init_reg_query_value_ex_w;
static BOOL g_b_init_expand_environment_strings_w;
+static BOOL g_b_init_get_user_default_ui_language;
BOOL g_b_init_compare_string_w;
BOOL g_b_init_debug_break_process;
@@ -533,6 +534,7 @@ DWORD multiByteToWideCharFlags;
typedef LONG (WINAPI *RegOpenKeyExW_Proc) (HKEY,LPCWSTR,DWORD,REGSAM,PHKEY);
typedef LONG (WINAPI *RegQueryValueExW_Proc) (HKEY,LPCWSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
typedef DWORD (WINAPI *ExpandEnvironmentStringsW_Proc) (LPCWSTR,LPWSTR,DWORD);
+typedef LANGID (WINAPI *GetUserDefaultUILanguage_Proc) (void);
/* ** A utility function ** */
static BOOL
@@ -1489,6 +1491,28 @@ expand_environment_strings_w (LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize)
return s_pfn_Expand_Environment_Strings_w (lpSrc, lpDst, nSize);
}
+static LANGID WINAPI
+get_user_default_ui_language (void)
+{
+ static GetUserDefaultUILanguage_Proc s_pfn_GetUserDefaultUILanguage = NULL;
+ HMODULE hm_kernel32 = NULL;
+
+ if (is_windows_9x () == TRUE)
+ return 0;
+
+ if (g_b_init_get_user_default_ui_language == 0)
+ {
+ g_b_init_get_user_default_ui_language = 1;
+ hm_kernel32 = LoadLibrary ("Kernel32.dll");
+ if (hm_kernel32)
+ s_pfn_GetUserDefaultUILanguage = (GetUserDefaultUILanguage_Proc)
+ get_proc_addr (hm_kernel32, "GetUserDefaultUILanguage");
+ }
+ if (s_pfn_GetUserDefaultUILanguage == NULL)
+ return 0;
+ return s_pfn_GetUserDefaultUILanguage ();
+}
+
/* Return 1 if P is a valid pointer to an object of size SIZE. Return
@@ -2947,6 +2971,32 @@ init_environment (char ** argv)
LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP,
locale_name, sizeof (locale_name)))
{
+ /* Microsoft are migrating away of locale IDs, replacing them
+ with locale names, such as "en-US", and are therefore
+ deprecating the APIs which use LCID etc. As part of that
+ deprecation, they don't bother inventing LCID and LANGID
+ codes for new locales and language/culture combinations;
+ instead, those get LCID of 0xC000 and LANGID of 0x2000, for
+ which the LCID/LANGID oriented APIs return "ZZZ" as the
+ "language name". Such "language name" is useless for our
+ purposes. So we instead use the default UI language, in the
+ hope of getting something usable. */
+ if (strcmp (locale_name, "ZZZ") == 0)
+ {
+ LANGID lang_id = get_user_default_ui_language ();
+
+ if (lang_id != 0)
+ {
+ /* Disregard the sorting order differences between cultures. */
+ LCID def_lcid = MAKELCID (lang_id, SORT_DEFAULT);
+ char locale_name_def[32];
+
+ if (GetLocaleInfo (def_lcid,
+ LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP,
+ locale_name_def, sizeof (locale_name_def)))
+ strcpy (locale_name, locale_name_def);
+ }
+ }
for (i = 0; i < N_ENV_VARS; i++)
{
if (strcmp (env_vars[i].name, "LANG") == 0)
@@ -10580,6 +10630,7 @@ globals_of_w32 (void)
g_b_init_expand_environment_strings_w = 0;
g_b_init_compare_string_w = 0;
g_b_init_debug_break_process = 0;
+ g_b_init_get_user_default_ui_language = 0;
num_of_processors = 0;
/* The following sets a handler for shutdown notifications for
console apps. This actually applies to Emacs in both console and
diff --git a/src/w32fns.c b/src/w32fns.c
index 86c3db64e7b1..9db367bfafe7 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3893,7 +3893,7 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam,
Essentially, we have no information about the "role" of
modifiers on this key: which contribute into the
produced character (so "are consumed"), and which are
- "extra" (must attache to bindable events).
+ "extra" (must attach to bindable events).
The default above would consume ALL modifiers, so the
character is reported "as is". However, on many layouts
diff --git a/test/Makefile.in b/test/Makefile.in
index f907602a6225..48bbe8712b4d 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -71,6 +71,15 @@ am__v_at_0 = @
am__v_at_1 =
+# Load any GNU ELPA dependencies that are present, for optional tests.
+GNU_ELPA_DIRECTORY ?= $(srcdir)/../../elpa
+# Keep elpa_dependencies dependency-ordered.
+elpa_dependencies = \
+ url-http-ntlm/url-http-ntlm.el \
+ web-server/web-server.el
+elpa_els = $(addprefix $(GNU_ELPA_DIRECTORY)/packages/,$(elpa_dependencies))
+elpa_opts = $(foreach el,$(elpa_els),$(and $(wildcard $(el)),-L $(dir $(el)) -l $(el)))
+
# We never change directory before running Emacs, so a relative file
# name is fine, and makes life easier. If we need to change
# directory, we can use emacs --chdir.
@@ -81,7 +90,7 @@ EMACS_EXTRAOPT=
# Command line flags for Emacs.
# Apparently MSYS bash would convert "-L :" to "-L ;" anyway,
# but we might as well be explicit.
-EMACSOPT = --no-init-file --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(EMACS_EXTRAOPT)
+EMACSOPT = --no-init-file --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(elpa_opts) $(EMACS_EXTRAOPT)
# Prevent any settings in the user environment causing problems.
unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
@@ -105,7 +114,7 @@ export TEST_LOAD_EL ?= \
$(if $(findstring $(MAKECMDGOALS), all check check-maybe),no,yes)
# Additional settings for ert.
-ert_opts =
+ert_opts += $(elpa_opts)
# Maximum length of lines in ert backtraces; nil for no limit.
# (if empty, use the default ert-batch-backtrace-right-margin).
@@ -248,7 +257,7 @@ endef
$(foreach test,${TESTS},$(eval $(call test_template,${test})))
## Get the tests for only a specific directory.
-SUBDIRS = $(sort $(shell find lib-src lisp src -type d ! -path "*resources*" -print))
+SUBDIRS = $(sort $(shell find lib-src lisp misc src -type d ! -path "*resources*" -print))
define subdir_template
.PHONY: check-$(subst /,-,$(1))
diff --git a/test/README b/test/README
index 5f3c10adbe13..1e0e43a8acac 100644
--- a/test/README
+++ b/test/README
@@ -106,8 +106,13 @@ tramp-tests.el). Per default, a mock-up connection method is used
to test a real remote connection, set $REMOTE_TEMPORARY_FILE_DIRECTORY
to a suitable value in order to overwrite the default value:
- env REMOTE_TEMPORARY_FILE_DIRECTORY=/ssh:host:/tmp make ...
+ env REMOTE_TEMPORARY_FILE_DIRECTORY=/ssh:host:/tmp make ...
+Some optional tests require packages from GNU ELPA. By default
+../../elpa will be checked for these packages. If GNU ELPA is checked
+out somewhere else, use
+
+ make GNU_ELPA_DIRECTORY=/path/to/elpa ...
There are also continuous integration tests on
(see
diff --git a/test/file-organization.org b/test/file-organization.org
index 7cf5b88d6d06..d1f92da43246 100644
--- a/test/file-organization.org
+++ b/test/file-organization.org
@@ -43,6 +43,10 @@ Similarly, tests of features implemented in C should reside in
~-tests.el~ added to the base-name of the tested source file. Thus,
tests for ~src/fileio.c~ should be in ~test/src/fileio-tests.el~.
+Some tests do not belong to any one particular file. Such tests
+should be put in the ~misc~ directory and be given a descriptive name
+that does /not/ end with ~-tests.el~.
+
There are also some test materials that cannot be run automatically
(i.e. via ert). These should be placed in ~/test/manual~; they are
not run by the "make check" command and its derivatives.
diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el
index 10854c71d563..09f79c1a089d 100644
--- a/test/lisp/custom-tests.el
+++ b/test/lisp/custom-tests.el
@@ -145,17 +145,6 @@
(widget-apply field :value-to-internal origvalue)
"bar"))))))
-(defconst custom-test-admin-cus-test
- (expand-file-name "admin/cus-test.el" source-directory))
-
-(declare-function cus-test-opts custom-test-admin-cus-test)
-
-(ert-deftest check-for-wrong-custom-types ()
- :tags '(:expensive-test)
- (skip-unless (file-readable-p custom-test-admin-cus-test))
- (load custom-test-admin-cus-test)
- (should (null (cus-test-opts t))))
-
(ert-deftest custom-test-enable-theme-keeps-settings ()
"Test that enabling a theme doesn't change its settings."
(let* ((custom-theme-load-path `(,(ert-resource-directory)))
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 0b70c11b2984..fb84596ad3f4 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -495,6 +495,7 @@ Subtests signal errors if something goes wrong."
(insert "\n"))))
(defun test-byte-comp-compile-and-load (compile &rest forms)
+ (declare (indent 1))
(let ((elfile nil)
(elcfile nil))
(unwind-protect
@@ -513,7 +514,6 @@ Subtests signal errors if something goes wrong."
(load elfile nil 'nomessage))
(when elfile (delete-file elfile))
(when elcfile (delete-file elcfile)))))
-(put 'test-byte-comp-compile-and-load 'lisp-indent-function 1)
(ert-deftest test-byte-comp-macro-expansion ()
(test-byte-comp-compile-and-load t
diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el
index daac43372acc..dcb261c2eb9f 100644
--- a/test/lisp/emacs-lisp/edebug-tests.el
+++ b/test/lisp/emacs-lisp/edebug-tests.el
@@ -219,16 +219,16 @@ index."
(with-current-buffer (find-file-noselect edebug-tests-temp-file)
(setq saved-local-map overriding-local-map)
(setq overriding-local-map edebug-tests-keymap)
- (add-hook 'post-command-hook 'edebug-tests-post-command))
+ (add-hook 'post-command-hook #'edebug-tests-post-command))
(advice-add 'exit-recursive-edit
- :around 'edebug-tests-preserve-keyboard-macro-state)
+ :around #'edebug-tests-preserve-keyboard-macro-state)
(unwind-protect
(kmacro-call-macro nil nil nil kbdmac)
(advice-remove 'exit-recursive-edit
- 'edebug-tests-preserve-keyboard-macro-state)
+ #'edebug-tests-preserve-keyboard-macro-state)
(with-current-buffer (find-file-noselect edebug-tests-temp-file)
(setq overriding-local-map saved-local-map)
- (remove-hook 'post-command-hook 'edebug-tests-post-command)))))
+ (remove-hook 'post-command-hook #'edebug-tests-post-command)))))
(defun edebug-tests-preserve-keyboard-macro-state (orig &rest args)
"Call ORIG with ARGS preserving the value of `executing-kbd-macro'.
@@ -857,12 +857,14 @@ test and possibly others should be updated."
(ert-deftest edebug-tests-trivial-backquote ()
"Edebug can instrument a trivial backquote expression (Bug#23651)."
(edebug-tests-with-normal-env
- (read-only-mode -1)
- (delete-region (point-min) (point-max))
- (insert "`1")
- (read-only-mode)
+ (let ((inhibit-read-only t))
+ (delete-region (point-min) (point-max))
+ (insert "`1"))
(edebug-eval-defun nil)
- (should (string-match-p (regexp-quote "1 (#o1, #x1, ?\\C-a)")
+ ;; `eval-defun' outputs its message to the echo area in a rather
+ ;; funny way, so the "1" and the " (#o1, #x1, ?\C-a)" end up placed
+ ;; there in separate pieces (via `print' rather than via `message').
+ (should (string-match-p (regexp-quote " (#o1, #x1, ?\\C-a)")
edebug-tests-messages))
(setq edebug-tests-messages "")
@@ -912,13 +914,17 @@ test and possibly others should be updated."
(ert-deftest edebug-tests-cl-macrolet ()
"Edebug can instrument `cl-macrolet' expressions. (Bug#29919)"
(edebug-tests-with-normal-env
- (edebug-tests-setup-@ "use-cl-macrolet" '(10) t)
+ (edebug-tests-locate-def "use-cl-macrolet")
(edebug-tests-run-kbd-macro
- "@ SPC SPC"
+ "C-u C-M-x SPC"
(edebug-tests-should-be-at "use-cl-macrolet" "func")
- (edebug-tests-should-match-result-in-messages "+")
- "g"
- (should (equal edebug-tests-@-result "The result of applying + to (1 x) is 11")))))
+ (edebug-tests-should-match-result-in-messages "+"))
+ (let ((edebug-initial-mode 'Go-nonstop))
+ (edebug-tests-setup-@ "use-cl-macrolet" '(10) t))
+ (edebug-tests-run-kbd-macro
+ "@ SPC g"
+ (should (equal edebug-tests-@-result "The result of applying + to (1 x) is 11"))
+ )))
(ert-deftest edebug-tests-backtrace-goto-source ()
"Edebug can jump to instrumented source from its *Edebug-Backtrace* buffer."
diff --git a/test/lisp/emacs-lisp/generator-tests.el b/test/lisp/emacs-lisp/generator-tests.el
index ffcd16ad0949..a1b9f64fdb19 100644
--- a/test/lisp/emacs-lisp/generator-tests.el
+++ b/test/lisp/emacs-lisp/generator-tests.el
@@ -45,6 +45,7 @@
BODY twice: once using ordinary `eval' and once using
lambda-generators. The test ensures that the two forms produce
identical output."
+ (declare (indent 1))
`(progn
(ert-deftest ,name ()
(should
@@ -62,8 +63,6 @@ identical output."
(let ((cps-inhibit-atomic-optimization t))
(iter-lambda () (iter-yield (progn ,@body)))))))))))
-(put 'cps-testcase 'lisp-indent-function 1)
-
(defvar *cps-test-i* nil)
(defun cps-get-test-i ()
*cps-test-i*)
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index 63d7c7b91eae..12bf4f7978ef 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -388,6 +388,8 @@
(ert-deftest rx-regexp ()
(should (equal (rx (regexp "abc") (regex "[de]"))
"\\(?:abc\\)[de]"))
+ (should (equal (rx "a" (regexp "$"))
+ "a\\(?:$\\)"))
(let ((x "a*"))
(should (equal (rx (regexp x) "b")
"\\(?:a*\\)b"))
diff --git a/test/lisp/json-tests.el b/test/lisp/json-tests.el
index 11b61d8b47e3..9886dc0d4571 100644
--- a/test/lisp/json-tests.el
+++ b/test/lisp/json-tests.el
@@ -421,12 +421,21 @@ Point is moved to beginning of the buffer."
"\"\\nasdфыв\\u001f\u007ffgh\\t\"")))
(ert-deftest test-json-encode-key ()
- (should (equal (json-encode-key "") "\"\""))
(should (equal (json-encode-key '##) "\"\""))
(should (equal (json-encode-key :) "\"\""))
- (should (equal (json-encode-key "foo") "\"foo\""))
- (should (equal (json-encode-key 'foo) "\"foo\""))
- (should (equal (json-encode-key :foo) "\"foo\""))
+ (should (equal (json-encode-key "") "\"\""))
+ (should (equal (json-encode-key 'a) "\"a\""))
+ (should (equal (json-encode-key :a) "\"a\""))
+ (should (equal (json-encode-key "a") "\"a\""))
+ (should (equal (json-encode-key t) "\"t\""))
+ (should (equal (json-encode-key :t) "\"t\""))
+ (should (equal (json-encode-key "t") "\"t\""))
+ (should (equal (json-encode-key nil) "\"nil\""))
+ (should (equal (json-encode-key :nil) "\"nil\""))
+ (should (equal (json-encode-key "nil") "\"nil\""))
+ (should (equal (json-encode-key ":a") "\":a\""))
+ (should (equal (json-encode-key ":t") "\":t\""))
+ (should (equal (json-encode-key ":nil") "\":nil\""))
(should (equal (should-error (json-encode-key 5))
'(json-key-format 5)))
(should (equal (should-error (json-encode-key ["foo"]))
@@ -572,6 +581,39 @@ Point is moved to beginning of the buffer."
(should (equal (json-encode-hash-table #s(hash-table)) "{}"))
(should (equal (json-encode-hash-table #s(hash-table data (a 1)))
"{\"a\":1}"))
+ (should (equal (json-encode-hash-table #s(hash-table data (t 1)))
+ "{\"t\":1}"))
+ (should (equal (json-encode-hash-table #s(hash-table data (nil 1)))
+ "{\"nil\":1}"))
+ (should (equal (json-encode-hash-table #s(hash-table data (:a 1)))
+ "{\"a\":1}"))
+ (should (equal (json-encode-hash-table #s(hash-table data (:t 1)))
+ "{\"t\":1}"))
+ (should (equal (json-encode-hash-table #s(hash-table data (:nil 1)))
+ "{\"nil\":1}"))
+ (should (equal (json-encode-hash-table
+ #s(hash-table test equal data ("a" 1)))
+ "{\"a\":1}"))
+ (should (equal (json-encode-hash-table
+ #s(hash-table test equal data ("t" 1)))
+ "{\"t\":1}"))
+ (should (equal (json-encode-hash-table
+ #s(hash-table test equal data ("nil" 1)))
+ "{\"nil\":1}"))
+ (should (equal (json-encode-hash-table
+ #s(hash-table test equal data (":a" 1)))
+ "{\":a\":1}"))
+ (should (equal (json-encode-hash-table
+ #s(hash-table test equal data (":t" 1)))
+ "{\":t\":1}"))
+ (should (equal (json-encode-hash-table
+ #s(hash-table test equal data (":nil" 1)))
+ "{\":nil\":1}"))
+ (should (member (json-encode-hash-table #s(hash-table data (t 2 :nil 1)))
+ '("{\"nil\":1,\"t\":2}" "{\"t\":2,\"nil\":1}")))
+ (should (member (json-encode-hash-table
+ #s(hash-table test equal data (:t 2 ":t" 1)))
+ '("{\":t\":1,\"t\":2}" "{\"t\":2,\":t\":1}")))
(should (member (json-encode-hash-table #s(hash-table data (b 2 a 1)))
'("{\"a\":1,\"b\":2}" "{\"b\":2,\"a\":1}")))
(should (member (json-encode-hash-table #s(hash-table data (c 3 b 2 a 1)))
@@ -638,7 +680,16 @@ Point is moved to beginning of the buffer."
(let ((json-encoding-object-sort-predicate nil)
(json-encoding-pretty-print nil))
(should (equal (json-encode-alist ()) "{}"))
- (should (equal (json-encode-alist '((a . 1))) "{\"a\":1}"))
+ (should (equal (json-encode-alist '((a . 1) (t . 2) (nil . 3)))
+ "{\"a\":1,\"t\":2,\"nil\":3}"))
+ (should (equal (json-encode-alist '((:a . 1) (:t . 2) (:nil . 3)))
+ "{\"a\":1,\"t\":2,\"nil\":3}"))
+ (should (equal (json-encode-alist '(("a" . 1) ("t" . 2) ("nil" . 3)))
+ "{\"a\":1,\"t\":2,\"nil\":3}"))
+ (should (equal (json-encode-alist '((":a" . 1) (":t" . 2) (":nil" . 3)))
+ "{\":a\":1,\":t\":2,\":nil\":3}"))
+ (should (equal (json-encode-alist '((t . 1) (:nil . 2) (":nil" . 3)))
+ "{\"t\":1,\"nil\":2,\":nil\":3}"))
(should (equal (json-encode-alist '((b . 2) (a . 1))) "{\"b\":2,\"a\":1}"))
(should (equal (json-encode-alist '((c . 3) (b . 2) (a . 1)))
"{\"c\":3,\"b\":2,\"a\":1}"))))
@@ -687,8 +738,14 @@ Point is moved to beginning of the buffer."
(should (equal (json-encode-plist ()) "{}"))
(should (equal (json-encode-plist '(:a 1)) "{\"a\":1}"))
(should (equal (json-encode-plist '(:b 2 :a 1)) "{\"b\":2,\"a\":1}"))
- (should (equal (json-encode-plist '(:c 3 :b 2 :a 1))
- "{\"c\":3,\"b\":2,\"a\":1}"))))
+ (should (equal (json-encode-plist '(":d" 4 "c" 3 b 2 :a 1))
+ "{\":d\":4,\"c\":3,\"b\":2,\"a\":1}"))
+ (should (equal (json-encode-plist '(nil 2 t 1))
+ "{\"nil\":2,\"t\":1}"))
+ (should (equal (json-encode-plist '(:nil 2 :t 1))
+ "{\"nil\":2,\"t\":1}"))
+ (should (equal (json-encode-plist '(":nil" 4 "nil" 3 ":t" 2 "t" 1))
+ "{\":nil\":4,\"nil\":3,\":t\":2,\"t\":1}"))))
(ert-deftest test-json-encode-plist-pretty ()
(let ((json-encoding-object-sort-predicate nil)
@@ -950,7 +1007,13 @@ nil, ORIGINAL should stay unchanged by pretty-printing."
;; Nested array.
(json-tests-equal-pretty-print
"{\"key\":[1,2]}"
- "{\n \"key\": [\n 1,\n 2\n ]\n}"))
+ "{\n \"key\": [\n 1,\n 2\n ]\n}")
+ ;; Confusable keys (bug#24252, bug#42545).
+ (json-tests-equal-pretty-print
+ (concat "{\"t\":1,\"nil\":2,\":t\":3,\":nil\":4,"
+ "\"null\":5,\":json-null\":6,\":json-false\":7}")
+ (concat "{\n \"t\": 1,\n \"nil\": 2,\n \":t\": 3,\n \":nil\": 4,"
+ "\n \"null\": 5,\n \":json-null\": 6,\n \":json-false\": 7\n}")))
(ert-deftest test-json-pretty-print-array ()
;; Empty.
diff --git a/test/lisp/jsonrpc-tests.el b/test/lisp/jsonrpc-tests.el
index ea340c370d1b..92306d1c7e55 100644
--- a/test/lisp/jsonrpc-tests.el
+++ b/test/lisp/jsonrpc-tests.el
@@ -244,7 +244,7 @@
:timeout 1)
;; Wait another 0.5 secs just in case the success handlers of
;; one of these last two requests didn't quite have a chance to
- ;; run (Emacs 25.2 apparentely needs this).
+ ;; run (Emacs 25.2 apparently needs this).
(accept-process-output nil 0.5)
(should second-deferred-went-through-p)
(should (eq 1 n-deferred-1))
diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el
index e0a06a28eecb..0fb24d27011d 100644
--- a/test/lisp/net/network-stream-tests.el
+++ b/test/lisp/net/network-stream-tests.el
@@ -32,6 +32,13 @@
;; it pulls in nsm, which then makes the :nowait t' tests fail unless
;; we disable the nsm, which we do by binding 'network-security-level'
+;; Check if the Internet seems to be working. Mainly to pacify
+;; Debian's CI system.
+(defvar internet-is-working
+ (progn
+ (require 'dns)
+ (dns-query "google.com")))
+
(ert-deftest make-local-unix-server ()
(skip-unless (featurep 'make-network-process '(:family local)))
(let* ((file (make-temp-name "/tmp/server-test"))
@@ -291,6 +298,7 @@
(ert-deftest connect-to-tls-ipv4-nowait ()
(skip-unless (executable-find "gnutls-serv"))
(skip-unless (gnutls-available-p))
+ (skip-unless internet-is-working)
(let ((server (make-tls-server 44331))
(times 0)
(network-security-level 'low)
@@ -333,6 +341,7 @@
(ert-deftest connect-to-tls-ipv6-nowait ()
(skip-unless (executable-find "gnutls-serv"))
(skip-unless (gnutls-available-p))
+ (skip-unless internet-is-working)
(skip-unless (not (eq system-type 'windows-nt)))
(skip-unless (featurep 'make-network-process '(:family ipv6)))
(let ((server (make-tls-server 44333))
@@ -417,6 +426,7 @@
(ert-deftest open-network-stream-tls-nowait ()
(skip-unless (executable-find "gnutls-serv"))
(skip-unless (gnutls-available-p))
+ (skip-unless internet-is-working)
(let ((server (make-tls-server 44335))
(times 0)
(network-security-level 'low)
@@ -645,6 +655,7 @@
(ert-deftest open-gnutls-stream-new-api-nowait ()
(skip-unless (executable-find "gnutls-serv"))
(skip-unless (gnutls-available-p))
+ (skip-unless internet-is-working)
(let ((server (make-tls-server 44668))
(times 0)
(network-security-level 'low)
@@ -683,6 +694,7 @@
(ert-deftest open-gnutls-stream-old-api-nowait ()
(skip-unless (executable-find "gnutls-serv"))
(skip-unless (gnutls-available-p))
+ (skip-unless internet-is-working)
(let ((server (make-tls-server 44669))
(times 0)
(network-security-level 'low)
diff --git a/test/lisp/net/ntlm-resources/authinfo b/test/lisp/net/ntlm-resources/authinfo
new file mode 100644
index 000000000000..698391e9313f
--- /dev/null
+++ b/test/lisp/net/ntlm-resources/authinfo
@@ -0,0 +1 @@
+machine localhost port http user ntlm password ntlm
diff --git a/test/lisp/net/ntlm-tests.el b/test/lisp/net/ntlm-tests.el
index 6408ac133491..2420b3b48a9c 100644
--- a/test/lisp/net/ntlm-tests.el
+++ b/test/lisp/net/ntlm-tests.el
@@ -17,11 +17,26 @@
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see .
+;;; Commentary:
+
+;; Run this with `NTLM_TESTS_VERBOSE=1' to get verbose debugging.
+
+;;; Code:
+
(require 'ert)
+(require 'ert-x)
(require 'ntlm)
+(defsubst ntlm-tests-message (format-string &rest arguments)
+ "Print a message conditional on an environment variable being set.
+FORMAT-STRING and ARGUMENTS are passed to the message function."
+ (when (getenv "NTLM_TESTS_VERBOSE")
+ (apply #'message (concat "ntlm-tests: " format-string) arguments)))
+
+
;; This is the Lisp bignum implementation of `ntlm--time-to-timestamp',
;; for reference.
+
(defun ntlm-tests--time-to-timestamp (time)
"Convert TIME to an NTLMv2 timestamp.
Return a unibyte string representing the number of tenths of a
@@ -49,4 +64,357 @@ signed integer. TIME must be on the form (HIGH LOW USEC PSEC)."
(should (equal (ntlm--time-to-timestamp time)
(ntlm-tests--time-to-timestamp time)))))
+(defvar ntlm-tests--username-oem "ntlm"
+ "The username for NTLM authentication tests, in OEM string encoding.")
+(defvar ntlm-tests--username-unicode
+ (ntlm-ascii2unicode ntlm-tests--username-oem
+ (length ntlm-tests--username-oem))
+ "The username for NTLM authentication tests, in Unicode string encoding.")
+
+(defvar ntlm-tests--password "ntlm"
+ "The password used for NTLM authentication tests.")
+
+(defvar ntlm-tests--client-supports-unicode nil
+ "Non-nil if client supports Unicode strings.
+If client only supports OEM strings, nil.")
+
+(defvar ntlm-tests--challenge nil "The global random challenge.")
+
+(defun ntlm-server-build-type-2 ()
+ "Return an NTLM Type 2 message as a string.
+This string will be returned from the NTLM server to the NTLM client."
+ (let ((target (if ntlm-tests--client-supports-unicode
+ (ntlm-ascii2unicode "DOMAIN" (length "DOMAIN"))
+ "DOMAIN"))
+ (target-information ntlm-tests--password)
+ ;; Flag byte 1 flags.
+ (_negotiate-unicode 1)
+ (negotiate-oem 2)
+ (request-target 4)
+ ;; Flag byte 2 flags.
+ (negotiate-ntlm 2)
+ (_negotiate-local-call 4)
+ (_negotiate-always-sign 8)
+ ;; Flag byte 3 flags.
+ (_target-type-domain 1)
+ (_target-type-server 2)
+ (target-type-share 4)
+ (_negotiate-ntlm2-key 8)
+ (negotiate-target-information 128)
+ ;; Flag byte 4 flags, unused.
+ (_negotiate-128 32)
+ (_negotiate-56 128))
+ (concat
+ ;; Signature.
+ "NTLMSSP" (unibyte-string 0)
+ ;; Type 2.
+ (unibyte-string 2 0 0 0)
+ ;; Target length
+ (unibyte-string (length target) 0)
+ ;; Target allocated space.
+ (unibyte-string (length target) 0)
+ ;; Target offset.
+ (unibyte-string 48 0 0 0)
+ ;; Flags.
+ ;; Flag byte 1.
+ ;; Tell the client that this test server only supports OEM
+ ;; strings. This test server will handle Unicode strings
+ ;; anyway though.
+ (unibyte-string (logior negotiate-oem request-target))
+ ;; Flag byte 2.
+ (unibyte-string negotiate-ntlm)
+ ;; Flag byte 3.
+ (unibyte-string (logior negotiate-target-information target-type-share))
+ ;; Flag byte 4. Not sure what 2 means here.
+ (unibyte-string 2)
+ ;; Challenge. Set this to (unibyte-string 1 2 3 4 5 6 7 8)
+ ;; instead of (ntlm-generate-nonce) to hold constant for
+ ;; debugging.
+ (setq ntlm-tests--challenge (ntlm-generate-nonce))
+ ;; Context.
+ (make-string 8 0)
+ (unibyte-string (length target-information) 0)
+ (unibyte-string (length target-information) 0)
+ (unibyte-string 54 0 0 0)
+ target
+ target-information)))
+
+(defun ntlm-server-hash (challenge blob username password)
+ "Hash CHALLENGE, BLOB, USERNAME and PASSWORD for a Type 3 check."
+ (hmac-md5 (concat challenge blob)
+ (hmac-md5 (concat
+ (upcase
+ ;; This calculation always uses
+ ;; Unicode username, even when the
+ ;; server only supports OEM strings.
+ (ntlm-ascii2unicode username (length username))) "")
+ (cadr (ntlm-get-password-hashes password)))))
+
+(defun ntlm-server-check-authorization (authorization-string)
+ "Return t if AUTHORIZATION-STRING correctly authenticates the user."
+ (let* ((binary (base64-decode-string
+ (caddr (split-string authorization-string " "))))
+ (_lm-response-length (md4-unpack-int16 (substring binary 12 14)))
+ (_lm-response-offset
+ (cdr (md4-unpack-int32 (substring binary 16 20))))
+ (ntlm-response-length (md4-unpack-int16 (substring binary 20 22)))
+ (ntlm-response-offset
+ (cdr (md4-unpack-int32 (substring binary 24 28))))
+ (ntlm-hash
+ (substring binary ntlm-response-offset (+ ntlm-response-offset 16)))
+ (username-length (md4-unpack-int16 (substring binary 36 38)))
+ (username-offset (cdr (md4-unpack-int32 (substring binary 40 44))))
+ (username (substring binary username-offset
+ (+ username-offset username-length))))
+ (if (equal ntlm-response-length 24)
+ (let* ((expected
+ (ntlm-smb-owf-encrypt
+ (cadr (ntlm-get-password-hashes ntlm-tests--password))
+ ntlm-tests--challenge))
+ (received (substring binary ntlm-response-offset
+ (+ ntlm-response-offset
+ ntlm-response-length))))
+ (ntlm-tests-message "Got NTLMv1 response:")
+ (ntlm-tests-message "Expected hash: ===%S===" expected)
+ (ntlm-tests-message "Got hash: ===%S===" received)
+ (ntlm-tests-message "Expected username: ===%S==="
+ ntlm-tests--username-oem)
+ (ntlm-tests-message "Got username: ===%S===" username)
+ (and (or (equal username ntlm-tests--username-oem)
+ (equal username ntlm-tests--username-unicode))
+ (equal expected received)))
+ (let* ((ntlm-response-blob
+ (substring binary (+ ntlm-response-offset 16)
+ (+ (+ ntlm-response-offset 16)
+ (- ntlm-response-length 16))))
+ (_ntlm-timestamp (substring ntlm-response-blob 8 16))
+ (_ntlm-nonce (substring ntlm-response-blob 16 24))
+ (_target-length (md4-unpack-int16 (substring binary 28 30)))
+ (_target-offset
+ (cdr (md4-unpack-int32 (substring binary 32 36))))
+ (_workstation-length (md4-unpack-int16 (substring binary 44 46)))
+ (_workstation-offset
+ (cdr (md4-unpack-int32 (substring binary 48 52)))))
+ (cond
+ ;; This test server claims to only support OEM strings,
+ ;; but also checks Unicode strings.
+ ((or (equal username ntlm-tests--username-oem)
+ (equal username ntlm-tests--username-unicode))
+ (let* ((password ntlm-tests--password)
+ (ntlm-hash-from-type-3 (ntlm-server-hash
+ ntlm-tests--challenge
+ ntlm-response-blob
+ ;; Always -oem since
+ ;; `ntlm-server-hash'
+ ;; always converts it to
+ ;; Unicode.
+ ntlm-tests--username-oem
+ password)))
+ (ntlm-tests-message "Got NTLMv2 response:")
+ (ntlm-tests-message "Expected hash: ==%S==" ntlm-hash)
+ (ntlm-tests-message "Got hash: ==%S==" ntlm-hash-from-type-3)
+ (ntlm-tests-message "Expected username: ===%S==="
+ ntlm-tests--username-oem)
+ (ntlm-tests-message " or username: ===%S==="
+ ntlm-tests--username-unicode)
+ (ntlm-tests-message "Got username: ===%S===" username)
+ (equal ntlm-hash ntlm-hash-from-type-3)))
+ (t
+ nil))))))
+
+(require 'eieio)
+(require 'cl-lib)
+
+;; Silence some byte-compiler warnings that occur when
+;; web-server/web-server.el is not found.
+(declare-function ws-send nil)
+(declare-function ws-parse-request nil)
+(declare-function ws-start nil)
+(declare-function ws-stop-all nil)
+
+(require 'web-server nil t)
+(require 'url-http-ntlm nil t)
+
+(defun ntlm-server-do-token (request _process)
+ "Process an NTLM client's REQUEST.
+PROCESS is unused."
+ (with-slots (process headers) request
+ (let* ((header-alist (cdr headers))
+ (authorization-header (assoc ':AUTHORIZATION header-alist))
+ (authorization-string (cdr authorization-header)))
+ (if (and (stringp authorization-string)
+ (string-match "NTLM " authorization-string))
+ (let* ((challenge (substring authorization-string (match-end 0)))
+ (binary (base64-decode-string challenge))
+ (type (aref binary 8))
+ ;; Flag byte 1 flags.
+ (negotiate-unicode 1)
+ (negotiate-oem 2)
+ (flags-byte-1 (aref binary 12))
+ (client-supports-unicode
+ (not (zerop (logand flags-byte-1 negotiate-unicode))))
+ (client-supports-oem
+ (not (zerop (logand flags-byte-1 negotiate-oem))))
+ (connection-header (assoc ':CONNECTION header-alist))
+ (_keep-alive
+ (when connection-header (cdr connection-header)))
+ (response
+ (cl-case type
+ (1
+ ;; Return Type 2 message.
+ (when (and (not client-supports-unicode)
+ (not client-supports-oem))
+ (warn (concat
+ "Weird client supports neither Unicode"
+ " nor OEM strings, using OEM.")))
+ (setq ntlm-tests--client-supports-unicode
+ client-supports-unicode)
+ (concat
+ "HTTP/1.1 401 Unauthorized\r\n"
+ "WWW-Authenticate: NTLM "
+ (base64-encode-string
+ (ntlm-server-build-type-2) t) "\r\n"
+ "WWW-Authenticate: Negotiate\r\n"
+ "WWW-Authenticate: Basic realm=\"domain\"\r\n"
+ "Content-Length: 0\r\n\r\n"))
+ (3
+ (if (ntlm-server-check-authorization
+ authorization-string)
+ "HTTP/1.1 200 OK\r\n\r\nAuthenticated.\r\n"
+ (progn
+ (if process
+ (set-process-filter process nil)
+ (error "Type 3 message found first?"))
+ (concat "HTTP/1.1 401 Unauthorized\r\n\r\n"
+ "Access Denied.\r\n")))))))
+ (if response
+ (ws-send process response)
+ (when process
+ (set-process-filter process nil)))
+ (when (equal type 3)
+ (set-process-filter process nil)
+ (process-send-eof process)))
+ (progn
+ ;; Did not get NTLM anything.
+ (set-process-filter process nil)
+ (process-send-eof process)
+ (concat "HTTP/1.1 401 Unauthorized\r\n\r\n"
+ "Access Denied.\r\n"))))))
+
+(defun ntlm-server-filter (process string)
+ "Read from PROCESS a STRING and treat it as a request from an NTLM client."
+ (let ((request (make-instance 'ws-request
+ :process process :pending string)))
+ (if (ws-parse-request request)
+ (ntlm-server-do-token request process)
+ (error "Failed to parse request"))))
+
+(defun ntlm-server-handler (request)
+ "Handle an HTTP REQUEST."
+ (with-slots (process headers) request
+ (let* ((header-alist (cdr headers))
+ (authorization-header (assoc ':AUTHORIZATION header-alist))
+ (connection-header (assoc ':CONNECTION header-alist))
+ (keep-alive (when connection-header (cdr connection-header)))
+ (response (concat
+ "HTTP/1.1 401 Unauthorized\r\n"
+ "WWW-Authenticate: Negotiate\r\n"
+ "WWW-Authenticate: NTLM\r\n"
+ "WWW-Authenticate: Basic realm=\"domain\"\r\n"
+ "Content-Length: 0\r\n\r\n")))
+ (if (null authorization-header)
+ ;; Tell client to use NTLM. Firefox will create a new
+ ;; connection.
+ (progn
+ (process-send-string process response)
+ (process-send-eof process))
+ (progn
+ (ntlm-server-do-token request nil)
+ (set-process-filter process #'ntlm-server-filter)
+ (if (equal (upcase keep-alive) "KEEP-ALIVE")
+ :keep-alive
+ (error "NTLM server expects keep-alive connection header")))))))
+
+(defun ntlm-server-start ()
+ "Start an NTLM server on port 8080 for testing."
+ (ws-start 'ntlm-server-handler 8080))
+
+(defun ntlm-server-stop ()
+ "Stop the NTLM server."
+ (ws-stop-all))
+
+(defvar ntlm-tests--result-buffer nil "Final NTLM result buffer.")
+
+(require 'url)
+
+(defun ntlm-tests--url-retrieve-internal-around (original &rest arguments)
+ "Save the result buffer from a `url-retrieve-internal' to a global variable.
+ORIGINAL is the original `url-retrieve-internal' function and
+ARGUMENTS are passed to it."
+ (setq ntlm-tests--result-buffer (apply original arguments)))
+
+(defun ntlm-tests--authenticate ()
+ "Authenticate using credentials from the authinfo resource file."
+ (setq ntlm-tests--result-buffer nil)
+ (let ((auth-sources (list (ert-resource-file "authinfo")))
+ (auth-source-do-cache nil)
+ (auth-source-debug (when (getenv "NTLM_TESTS_VERBOSE") 'trivia)))
+ (ntlm-tests-message "Using auth-sources: %S" auth-sources)
+ (url-retrieve-synchronously "http://localhost:8080"))
+ (sleep-for 0.1)
+ (ntlm-tests-message "Results are in: %S" ntlm-tests--result-buffer)
+ (with-current-buffer ntlm-tests--result-buffer
+ (buffer-string)))
+
+(defun ntlm-tests--start-server-authenticate-stop-server ()
+ "Start an NTLM server, authenticate against it, then stop the server."
+ (advice-add #'url-retrieve-internal
+ :around #'ntlm-tests--url-retrieve-internal-around)
+ (ntlm-server-stop)
+ (ntlm-server-start)
+ (let ((result (ntlm-tests--authenticate)))
+ (advice-remove #'url-retrieve-internal
+ #'ntlm-tests--url-retrieve-internal-around)
+ (ntlm-server-stop)
+ result))
+
+(defvar ntlm-tests--successful-result
+ (concat "HTTP/1.1 200 OK\n\nAuthenticated." (unibyte-string 13) "\n")
+ "Expected result of successful NTLM authentication.")
+
+(require 'find-func)
+(defun ntlm-tests--ensure-ws-parse-ntlm-support ()
+ "Ensure NTLM special-case in `ws-parse'."
+ (let* ((hit (find-function-search-for-symbol
+ 'ws-parse nil (locate-file "web-server.el" load-path)))
+ (buffer (car hit))
+ (position (cdr hit)))
+ (with-current-buffer buffer
+ (goto-char position)
+ (search-forward-regexp
+ ":NTLM" (save-excursion (forward-sexp) (point)) t))))
+
+(require 'lisp-mnt)
+(defvar ntlm-tests--dependencies-present
+ (and (featurep 'url-http-ntlm)
+ (version<= "2.0.4"
+ (lm-version (locate-file "url-http-ntlm.el" load-path)))
+ (featurep 'web-server)
+ (ntlm-tests--ensure-ws-parse-ntlm-support))
+ "Non-nil if GNU ELPA test dependencies were loaded.")
+
+(ert-deftest ntlm-authentication ()
+ "Check ntlm.el's implementation of NTLM authentication over HTTP."
+ (skip-unless ntlm-tests--dependencies-present)
+ (should (equal (ntlm-tests--start-server-authenticate-stop-server)
+ ntlm-tests--successful-result)))
+
+(ert-deftest ntlm-authentication-old-compatibility-level ()
+ (skip-unless ntlm-tests--dependencies-present)
+ (setq ntlm-compatibility-level 0)
+ (should (equal (ntlm-tests--start-server-authenticate-stop-server)
+ ntlm-tests--successful-result)))
+
(provide 'ntlm-tests)
+
+;;; ntlm-tests.el ends here
diff --git a/test/lisp/net/socks-tests.el b/test/lisp/net/socks-tests.el
index b378ed2964ec..71bdd74890a5 100644
--- a/test/lisp/net/socks-tests.el
+++ b/test/lisp/net/socks-tests.el
@@ -21,68 +21,151 @@
;;; Code:
+(require 'ert)
(require 'socks)
(require 'url-http)
-(defvar socks-tests-canned-server-port nil)
+(ert-deftest socks-tests-auth-registration-and-suite-offer ()
+ (ert-info ("Default favors user/pass auth")
+ (should (equal socks-authentication-methods
+ '((2 "Username/Password" . socks-username/password-auth)
+ (0 "No authentication" . identity))))
+ (should (equal "\2\0\2" (socks-build-auth-list)))) ; length [offer ...]
+ (let (socks-authentication-methods)
+ (ert-info ("Empty selection/no methods offered")
+ (should (equal "\0" (socks-build-auth-list))))
+ (ert-info ("Simulate library defaults")
+ (socks-register-authentication-method 0 "No authentication"
+ 'identity)
+ (should (equal socks-authentication-methods
+ '((0 "No authentication" . identity))))
+ (should (equal "\1\0" (socks-build-auth-list)))
+ (socks-register-authentication-method 2 "Username/Password"
+ 'socks-username/password-auth)
+ (should (equal socks-authentication-methods
+ '((2 "Username/Password" . socks-username/password-auth)
+ (0 "No authentication" . identity))))
+ (should (equal "\2\0\2" (socks-build-auth-list))))
+ (ert-info ("Removal")
+ (socks-unregister-authentication-method 2)
+ (should (equal socks-authentication-methods
+ '((0 "No authentication" . identity))))
+ (should (equal "\1\0" (socks-build-auth-list)))
+ (socks-unregister-authentication-method 0)
+ (should-not socks-authentication-methods)
+ (should (equal "\0" (socks-build-auth-list))))))
-(defun socks-tests-canned-server-create (verbatim patterns)
- "Create a fake SOCKS server and return the process.
+(ert-deftest socks-tests-filter-response-parsing-v4 ()
+ "Ensure new chunks added on right (Bug#45162)."
+ (let* ((buf (generate-new-buffer "*test-socks-filter*"))
+ (proc (start-process "test-socks-filter" buf "sleep" "1")))
+ (process-put proc 'socks t)
+ (process-put proc 'socks-state socks-state-waiting)
+ (process-put proc 'socks-server-protocol 4)
+ (ert-info ("Receive initial incomplete segment")
+ (socks-filter proc (concat [0 90 0 0 93 184 216]))
+ ;; From example.com: OK status ^ ^ msg start
+ (ert-info ("State still set to waiting")
+ (should (eq (process-get proc 'socks-state) socks-state-waiting)))
+ (ert-info ("Response field is nil because processing incomplete")
+ (should-not (process-get proc 'socks-response)))
+ (ert-info ("Scratch field holds stashed partial payload")
+ (should (string= (concat [0 90 0 0 93 184 216])
+ (process-get proc 'socks-scratch)))))
+ (ert-info ("Last part arrives")
+ (socks-filter proc "\42") ; ?\" 34
+ (ert-info ("State transitions to complete (length check passes)")
+ (should (eq (process-get proc 'socks-state) socks-state-connected)))
+ (ert-info ("Scratch and response fields hold stash w. last chunk")
+ (should (string= (concat [0 90 0 0 93 184 216 34])
+ (process-get proc 'socks-response)))
+ (should (string= (process-get proc 'socks-response)
+ (process-get proc 'socks-scratch)))))
+ (delete-process proc)
+ (kill-buffer buf)))
-`VERBATIM' and `PATTERNS' are dotted alists containing responses.
-Requests are tried in order. On failure, an error is raised."
- (let* ((buf (generate-new-buffer "*canned-socks-server*"))
+(ert-deftest socks-tests-filter-response-parsing-v5 ()
+ "Ensure new chunks added on right (Bug#45162)."
+ (let* ((buf (generate-new-buffer "*test-socks-filter*"))
+ (proc (start-process "test-socks-filter" buf "sleep" "1")))
+ (process-put proc 'socks t)
+ (process-put proc 'socks-state socks-state-waiting)
+ (process-put proc 'socks-server-protocol 5)
+ (ert-info ("Receive initial incomplete segment")
+ ;; From fedora.org: 2605:bc80:3010:600:dead:beef:cafe:fed9
+ ;; 5004 ~~> Version Status (OK) NOOP Addr-Type (4 -> IPv6)
+ (socks-filter proc "\5\0\0\4\x26\x05\xbc\x80\x30\x10\x00\x60")
+ (ert-info ("State still waiting and response emtpy")
+ (should (eq (process-get proc 'socks-state) socks-state-waiting))
+ (should-not (process-get proc 'socks-response)))
+ (ert-info ("Scratch field holds partial payload of pending msg")
+ (should (string= "\5\0\0\4\x26\x05\xbc\x80\x30\x10\x00\x60"
+ (process-get proc 'socks-scratch)))))
+ (ert-info ("Middle chunk arrives")
+ (socks-filter proc "\xde\xad\xbe\xef\xca\xfe\xfe\xd9")
+ (ert-info ("State and response fields still untouched")
+ (should (eq (process-get proc 'socks-state) socks-state-waiting))
+ (should-not (process-get proc 'socks-response)))
+ (ert-info ("Scratch contains new arrival appended (on RHS)")
+ (should (string= (concat "\5\0\0\4"
+ "\x26\x05\xbc\x80\x30\x10\x00\x60"
+ "\xde\xad\xbe\xef\xca\xfe\xfe\xd9")
+ (process-get proc 'socks-scratch)))))
+ (ert-info ("Final part arrives (port number)")
+ (socks-filter proc "\0\0")
+ (ert-info ("State transitions to complete")
+ (should (eq (process-get proc 'socks-state) socks-state-connected)))
+ (ert-info ("Scratch and response fields show last chunk appended")
+ (should (string= (concat "\5\0\0\4"
+ "\x26\x05\xbc\x80\x30\x10\x00\x60"
+ "\xde\xad\xbe\xef\xca\xfe\xfe\xd9"
+ "\0\0")
+ (process-get proc 'socks-scratch)))
+ (should (string= (process-get proc 'socks-response)
+ (process-get proc 'socks-scratch)))))
+ (delete-process proc)
+ (kill-buffer buf)))
+
+(defvar socks-tests-canned-server-patterns nil
+ "Alist containing request/response cons pairs to be tried in order.
+Vectors must match verbatim. Strings are considered regex patterns.")
+
+(defun socks-tests-canned-server-create ()
+ "Create and return a fake SOCKS server."
+ (let* ((port (nth 2 socks-server))
+ (name (format "socks-server:%d" port))
+ (pats socks-tests-canned-server-patterns)
(filt (lambda (proc line)
- (let ((resp (or (assoc-default line verbatim
- (lambda (k s) ; s is line
- (string= (concat k) s)))
- (assoc-default line patterns
- (lambda (p s)
- (string-match-p p s))))))
- (unless resp
+ (pcase-let ((`(,pat . ,resp) (pop pats)))
+ (unless (or (and (vectorp pat) (equal pat (vconcat line)))
+ (string-match-p pat line))
(error "Unknown request: %s" line))
(let ((print-escape-control-characters t))
- (princ (format "<- %s\n" (prin1-to-string line)) buf)
- (princ (format "-> %s\n" (prin1-to-string resp)) buf))
+ (message "[%s] <- %s" name (prin1-to-string line))
+ (message "[%s] -> %s" name (prin1-to-string resp)))
(process-send-string proc (concat resp)))))
- (srv (make-network-process :server 1
- :buffer buf
- :filter filt
- :name "server"
- :family 'ipv4
- :host 'local
- :service socks-tests-canned-server-port)))
- (set-process-query-on-exit-flag srv nil)
- (princ (format "[%s] Listening on localhost:10080\n" srv) buf)
- srv))
-
-;; Add ([5 3 0 1 2] . [5 2]) to the `verbatim' list below to validate
-;; against curl 7.71 with the following options:
-;; $ curl --verbose -U foo:bar --proxy socks5h://127.0.0.1:10080 example.com
-;;
-;; If later implementing version 4a, try these:
-;; [4 1 0 80 0 0 0 1 0 ?e ?x ?a ?m ?p ?l ?e ?. ?c ?o ?m 0] . [0 90 0 0 0 0 0 0]
-;; $ curl --verbose --proxy socks4a://127.0.0.1:10080 example.com
+ (serv (make-network-process :server 1
+ :buffer (get-buffer-create name)
+ :filter filt
+ :name name
+ :family 'ipv4
+ :host 'local
+ :coding 'binary
+ :service port)))
+ (set-process-query-on-exit-flag serv nil)
+ serv))
-(ert-deftest socks-tests-auth-filter-url-http ()
- "Verify correct handling of SOCKS5 user/pass authentication."
- (let* ((socks-server '("server" "127.0.0.1" 10080 5))
- (socks-username "foo")
- (socks-password "bar")
- (url-gateway-method 'socks)
+(defvar socks-tests--hello-world-http-request-pattern
+ (cons "^GET /" (concat "HTTP/1.1 200 OK\r\n"
+ "Content-Type: text/plain\r\n"
+ "Content-Length: 13\r\n\r\n"
+ "Hello World!\n")))
+
+(defun socks-tests-perform-hello-world-http-request ()
+ "Start canned server, validate hello-world response, and finalize."
+ (let* ((url-gateway-method 'socks)
(url (url-generic-parse-url "http://example.com"))
- (verbatim '(([5 2 0 2] . [5 2])
- ([1 3 ?f ?o ?o 3 ?b ?a ?r] . [1 0])
- ([5 1 0 3 11 ?e ?x ?a ?m ?p ?l ?e ?. ?c ?o ?m 0 80]
- . [5 0 0 1 0 0 0 0 0 0])))
- (patterns
- `(("^GET /" . ,(concat "HTTP/1.1 200 OK\r\n"
- "Content-Type: text/plain; charset=UTF-8\r\n"
- "Content-Length: 13\r\n\r\n"
- "Hello World!\n"))))
- (socks-tests-canned-server-port 10080)
- (server (socks-tests-canned-server-create verbatim patterns))
- (tries 10)
+ (server (socks-tests-canned-server-create))
;;
done
;;
@@ -90,14 +173,112 @@ Requests are tried in order. On failure, an error is raised."
(goto-char (point-min))
(should (search-forward "Hello World" nil t))
(setq done t)))
- (buf (url-http url cb '(nil))))
- (ert-info ("Connect to HTTP endpoint over SOCKS5 with USER/PASS method")
- (while (and (not done) (< 0 (cl-decf tries))) ; cl-lib via url-http
- (sleep-for 0.1)))
+ (inhibit-message noninteractive)
+ (buf (url-http url cb '(nil)))
+ (proc (get-buffer-process buf))
+ (attempts 10))
+ (while (and (not done) (< 0 (cl-decf attempts)))
+ (sleep-for 0.1))
(should done)
(delete-process server)
+ (delete-process proc) ; otherwise seems client proc is sometimes reused
(kill-buffer (process-buffer server))
(kill-buffer buf)
(ignore url-gateway-method)))
+;; Unlike curl, socks.el includes the ID field (but otherwise matches):
+;; $ curl --proxy socks4://127.0.0.1:1080 example.com
+
+(ert-deftest socks-tests-v4-basic ()
+ "Show correct preparation of SOCKS4 connect command (Bug#46342)."
+ (let ((socks-server '("server" "127.0.0.1" 10079 4))
+ (url-user-agent "Test/4-basic")
+ (socks-tests-canned-server-patterns
+ `(([4 1 0 80 93 184 216 34 ?f ?o ?o 0] . [0 90 0 0 0 0 0 0])
+ ,socks-tests--hello-world-http-request-pattern))
+ socks-nslookup-program)
+ (ert-info ("Make HTTP request over SOCKS4")
+ (cl-letf (((symbol-function 'socks-nslookup-host)
+ (lambda (host)
+ (should (equal host "example.com"))
+ (list 93 184 216 34)))
+ ((symbol-function 'user-full-name)
+ (lambda () "foo")))
+ (socks-tests-perform-hello-world-http-request)))))
+
+;; Replace first pattern below with ([5 3 0 1 2] . [5 2]) to validate
+;; against curl 7.71 with the following options:
+;; $ curl --verbose -U foo:bar --proxy socks5h://127.0.0.1:10080 example.com
+
+(ert-deftest socks-tests-v5-auth-user-pass ()
+ "Verify correct handling of SOCKS5 user/pass authentication."
+ (should (assq 2 socks-authentication-methods))
+ (let ((socks-server '("server" "127.0.0.1" 10080 5))
+ (socks-username "foo")
+ (socks-password "bar")
+ (url-user-agent "Test/auth-user-pass")
+ (socks-tests-canned-server-patterns
+ `(([5 2 0 2] . [5 2])
+ ([1 3 ?f ?o ?o 3 ?b ?a ?r] . [1 0])
+ ([5 1 0 3 11 ?e ?x ?a ?m ?p ?l ?e ?. ?c ?o ?m 0 80]
+ . [5 0 0 1 0 0 0 0 0 0])
+ ,socks-tests--hello-world-http-request-pattern)))
+ (ert-info ("Make HTTP request over SOCKS5 with USER/PASS auth method")
+ (socks-tests-perform-hello-world-http-request))))
+
+;; Services (like Tor) may be configured without auth but for some
+;; reason still prefer the user/pass method over none when offered both.
+;; Given this library's defaults, the scenario below is possible.
+;;
+;; FYI: RFC 1929 doesn't say that a username or password is required
+;; but notes that the length of both fields should be at least one.
+;; However, both socks.el and curl send zero-length fields (though
+;; curl drops the user part too when the password is empty).
+;;
+;; From Tor's docs /socks-extensions.txt, 1.1 Extent of support:
+;; > We allow username/password fields of this message to be empty ...
+;; line 41 in blob 5fd1f828f3e9d014f7b65fa3bd1d33c39e4129e2
+;; https://gitweb.torproject.org/torspec.git/tree/socks-extensions.txt
+;;
+;; To verify against curl 7.71, swap out the first two pattern pairs
+;; with ([5 3 0 1 2] . [5 2]) and ([1 0 0] . [1 0]), then run:
+;; $ curl verbose -U "foo:" --proxy socks5h://127.0.0.1:10081 example.com
+
+(ert-deftest socks-tests-v5-auth-user-pass-blank ()
+ "Verify correct SOCKS5 user/pass authentication with empty pass."
+ (should (assq 2 socks-authentication-methods))
+ (let ((socks-server '("server" "127.0.0.1" 10081 5))
+ (socks-username "foo") ; defaults to (user-login-name)
+ (socks-password "") ; simulate user hitting enter when prompted
+ (url-user-agent "Test/auth-user-pass-blank")
+ (socks-tests-canned-server-patterns
+ `(([5 2 0 2] . [5 2])
+ ([1 3 ?f ?o ?o 0] . [1 0])
+ ([5 1 0 3 11 ?e ?x ?a ?m ?p ?l ?e ?. ?c ?o ?m 0 80]
+ . [5 0 0 1 0 0 0 0 0 0])
+ ,socks-tests--hello-world-http-request-pattern)))
+ (ert-info ("Make HTTP request over SOCKS5 with USER/PASS auth method")
+ (socks-tests-perform-hello-world-http-request))))
+
+;; Swap out ([5 2 0 1] . [5 0]) with the first pattern below to validate
+;; against curl 7.71 with the following options:
+;; $ curl --verbose --proxy socks5h://127.0.0.1:10082 example.com
+
+(ert-deftest socks-tests-v5-auth-none ()
+ "Verify correct handling of SOCKS5 when auth method 0 requested."
+ (let ((socks-server '("server" "127.0.0.1" 10082 5))
+ (socks-authentication-methods (append socks-authentication-methods
+ nil))
+ (url-user-agent "Test/auth-none")
+ (socks-tests-canned-server-patterns
+ `(([5 1 0] . [5 0])
+ ([5 1 0 3 11 ?e ?x ?a ?m ?p ?l ?e ?. ?c ?o ?m 0 80]
+ . [5 0 0 1 0 0 0 0 0 0])
+ ,socks-tests--hello-world-http-request-pattern)))
+ (socks-unregister-authentication-method 2)
+ (should-not (assq 2 socks-authentication-methods))
+ (ert-info ("Make HTTP request over SOCKS5 with no auth method")
+ (socks-tests-perform-hello-world-http-request)))
+ (should (assq 2 socks-authentication-methods)))
+
;;; socks-tests.el ends here
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 9a83fa667613..016b4d3c8f0c 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -5102,8 +5102,10 @@ INPUT, if non-nil, is a string sent to the process."
(string-match-p
(regexp-quote envvar)
;; We must remove PS1, the output is truncated otherwise.
+ ;; We must suppress "_=VAR...".
(funcall
- this-shell-command-to-string "printenv | grep -v PS1")))))))))
+ this-shell-command-to-string
+ "printenv | grep -v PS1 | grep -v _=")))))))))
(tramp--test--deftest-direct-async-process tramp-test33-environment-variables
"Check that remote processes set / unset environment variables properly.
diff --git a/test/lisp/textmodes/dns-mode-tests.el b/test/lisp/textmodes/dns-mode-tests.el
index 92b6cc9177cc..8bc48732c62d 100644
--- a/test/lisp/textmodes/dns-mode-tests.el
+++ b/test/lisp/textmodes/dns-mode-tests.el
@@ -37,7 +37,7 @@
(dns-mode-soa-increment-serial)
;; Number is updated from 2015080302 to the current date
;; (actually, just ensure the year part is later than 2020).
- (should (string-match "$TTL 86400
+ (should (string-match "\\$TTL 86400
@ IN SOA ns.icann.org. noc.dns.icann.org. (
20[2-9][0-9]+ ;Serial
7200 ;Refresh
diff --git a/test/misc/test-custom-deps.el b/test/misc/test-custom-deps.el
new file mode 100644
index 000000000000..f072adddcb0f
--- /dev/null
+++ b/test/misc/test-custom-deps.el
@@ -0,0 +1,42 @@
+;;; test-custom-deps.el --- Test custom deps -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see .
+
+;;; Commentary:
+
+;; The command `cus-test-deps' loads all (!) custom dependencies and
+;; reports about load errors.
+
+;;; Code:
+
+(require 'ert)
+
+(defconst custom-test-admin-cus-test
+ (expand-file-name "admin/cus-test.el" source-directory))
+
+(declare-function cus-test-deps custom-test-admin-cus-test)
+(defvar cus-test-deps-errors) ; from admin/cus-tests.el
+
+(ert-deftest test-custom-deps ()
+ :tags '(:expensive-test)
+ (skip-unless (file-readable-p custom-test-admin-cus-test))
+ (load custom-test-admin-cus-test)
+ (cus-test-deps)
+ (should-not cus-test-deps-errors))
+
+;;; test-custom-deps.el ends here
diff --git a/test/misc/test-custom-libs.el b/test/misc/test-custom-libs.el
new file mode 100644
index 000000000000..cc2be99dea8d
--- /dev/null
+++ b/test/misc/test-custom-libs.el
@@ -0,0 +1,48 @@
+;;; test-custom-libs.el --- Test custom loads -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see .
+
+;;; Commentary:
+
+;; This file runs for all libraries with autoloads separate emacs
+;; processes of the form "emacs -batch -l LIB".
+
+;;; Code:
+
+(require 'ert)
+
+(defconst custom-test-admin-cus-test
+ (expand-file-name "admin/cus-test.el" source-directory))
+
+(declare-function cus-test-libs custom-test-admin-cus-test)
+(defvar cus-test-libs-errors) ; from admin/cus-tests.el
+
+;; FIXME: Currently fails for:
+;; - lisp/term/ns-win.el
+;; - lisp/org/org-num.el
+(ert-deftest test-custom-libs ()
+ :tags '(:expensive-test)
+ :expected-result :failed ; FIXME: See above.
+ ;; This test is very slow, and IMO not worth the time it takes.
+ (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless (file-readable-p custom-test-admin-cus-test))
+ (load custom-test-admin-cus-test)
+ (cus-test-libs t)
+ (should-not cus-test-libs-errors))
+
+;;; test-custom-deps.el ends here
diff --git a/test/misc/test-custom-noloads.el b/test/misc/test-custom-noloads.el
new file mode 100644
index 000000000000..6fa6a6c90d7c
--- /dev/null
+++ b/test/misc/test-custom-noloads.el
@@ -0,0 +1,45 @@
+;;; test-custom-deps.el --- Test custom noloads -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see .
+
+;;; Commentary:
+
+;; The command `cus-test-noloads' returns a list of variables which
+;; are somewhere declared as custom options, but not loaded by
+;; `custom-load-symbol'.
+
+;;; Code:
+
+(require 'ert)
+
+(defconst custom-test-admin-cus-test
+ (expand-file-name "admin/cus-test.el" source-directory))
+
+(declare-function cus-test-noloads custom-test-admin-cus-test)
+(defvar cus-test-vars-not-cus-loaded) ; from admin/cus-tests.el
+
+;; FIXME: Multiple failures here.
+(ert-deftest custom-test-load ()
+ :tags '(:expensive-test :unstable)
+ :expected-result :failed ; FIXME: See above.
+ (skip-unless (file-readable-p custom-test-admin-cus-test))
+ (load custom-test-admin-cus-test)
+ (cus-test-noloads)
+ (should-not cus-test-vars-not-cus-loaded))
+
+;;; test-custom-deps.el ends here
diff --git a/test/misc/test-custom-opts.el b/test/misc/test-custom-opts.el
new file mode 100644
index 000000000000..fa6b9e66aef3
--- /dev/null
+++ b/test/misc/test-custom-opts.el
@@ -0,0 +1,39 @@
+;;; test-custom-opts.el --- Test custom opts -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see .
+
+;;; Commentary:
+
+;; The command `cus-test-opts' tests many (all?) custom options.
+
+;;; Code:
+
+(require 'ert)
+
+(defconst custom-test-admin-cus-test
+ (expand-file-name "admin/cus-test.el" source-directory))
+
+(declare-function cus-test-opts custom-test-admin-cus-test)
+
+(ert-deftest check-for-wrong-custom-opts ()
+ :tags '(:expensive-test)
+ (skip-unless (file-readable-p custom-test-admin-cus-test))
+ (load custom-test-admin-cus-test)
+ (should (null (cus-test-opts t))))
+
+;;; test-custom-opts.el ends here
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el
index dcec971c12ec..ea80da4819cf 100644
--- a/test/src/editfns-tests.el
+++ b/test/src/editfns-tests.el
@@ -128,6 +128,10 @@
(format (concat "%-3d/" s) 12)
#("12 /X" 4 5 (prop "val"))))))
+(ert-deftest propertize/error-even-number-of-args ()
+ "Number of args for `propertize' must be odd."
+ (should-error (propertize "foo" 'bar) :type 'wrong-number-of-arguments))
+
;; Tests for bug#5131.
(defun transpose-test-reverse-word (start end)
"Reverse characters in a word by transposing pairs of characters."
diff --git a/test/src/keyboard-tests.el b/test/src/keyboard-tests.el
index 607d2eafd45f..41c8cdd15f05 100644
--- a/test/src/keyboard-tests.el
+++ b/test/src/keyboard-tests.el
@@ -23,14 +23,15 @@
(ert-deftest keyboard-unread-command-events ()
"Test `unread-command-events'."
- (should (equal (progn (push ?\C-a unread-command-events)
- (read-event nil nil 1))
- ?\C-a))
- (should (equal (progn (run-with-timer
- 1 nil
- (lambda () (push '(t . ?\C-b) unread-command-events)))
- (read-event nil nil 2))
- ?\C-b)))
+ (let ((unread-command-events nil))
+ (should (equal (progn (push ?\C-a unread-command-events)
+ (read-event nil nil 1))
+ ?\C-a))
+ (should (equal (progn (run-with-timer
+ 1 nil
+ (lambda () (push '(t . ?\C-b) unread-command-events)))
+ (read-event nil nil 2))
+ ?\C-b))))
(ert-deftest keyboard-lossage-size ()
"Test `lossage-size'."
@@ -46,6 +47,28 @@
(should-error (lossage-size (1- min-value)))
(should (= lossage-orig (lossage-size lossage-orig)))))
+;; FIXME: This test doesn't currently work :-(
+;; (ert-deftest keyboard-tests--echo-keystrokes-bug15332 ()
+;; (let ((msgs '())
+;; (unread-command-events nil)
+;; (redisplay--interactive t)
+;; (echo-keystrokes 2))
+;; (setq unread-command-events '(?\C-u))
+;; (let* ((timer1
+;; (run-with-timer 3 1
+;; (lambda ()
+;; (setq unread-command-events '(?5)))))
+;; (timer2
+;; (run-with-timer 2.5 1
+;; (lambda ()
+;; (push (current-message) msgs)))))
+;; (run-with-timer 5 nil
+;; (lambda ()
+;; (cancel-timer timer1)
+;; (cancel-timer timer2)
+;; (throw 'exit msgs)))
+;; (recursive-edit)
+;; (should (equal msgs '("C-u 55-" "C-u 5-" "C-u-"))))))
(provide 'keyboard-tests)
;;; keyboard-tests.el ends here
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index e62bcb3f7c0e..17aef30a4335 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -348,8 +348,7 @@ See Bug#30460."
invocation-directory))
:stop t))))
-;; All the following tests require working DNS, which appears not to
-;; be the case for hydra.nixos.org, so disable them there for now.
+;; The following tests require working DNS
;; This will need updating when IANA assign more IPv6 global ranges.
(defun ipv6-is-available ()
@@ -360,9 +359,16 @@ See Bug#30460."
(= (logand (aref elt 0) #xe000) #x2000)))
(network-interface-list))))
+;; Check if the Internet seems to be working. Mainly to pacify
+;; Debian's CI system.
+(defvar internet-is-working
+ (progn
+ (require 'dns)
+ (dns-query "google.com")))
+
(ert-deftest lookup-family-specification ()
"`network-lookup-address-info' should only accept valid family symbols."
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless internet-is-working)
(with-timeout (60 (ert-fail "Test timed out"))
(should-error (network-lookup-address-info "localhost" 'both))
(should (network-lookup-address-info "localhost" 'ipv4))
@@ -371,20 +377,20 @@ See Bug#30460."
(ert-deftest lookup-unicode-domains ()
"Unicode domains should fail."
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless internet-is-working)
(with-timeout (60 (ert-fail "Test timed out"))
(should-error (network-lookup-address-info "faß.de"))
(should (network-lookup-address-info (puny-encode-domain "faß.de")))))
(ert-deftest unibyte-domain-name ()
"Unibyte domain names should work."
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless internet-is-working)
(with-timeout (60 (ert-fail "Test timed out"))
(should (network-lookup-address-info (string-to-unibyte "google.com")))))
(ert-deftest lookup-google ()
"Check that we can look up google IP addresses."
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless internet-is-working)
(with-timeout (60 (ert-fail "Test timed out"))
(let ((addresses-both (network-lookup-address-info "google.com"))
(addresses-v4 (network-lookup-address-info "google.com" 'ipv4)))
@@ -396,10 +402,12 @@ See Bug#30460."
(ert-deftest non-existent-lookup-failure ()
"Check that looking up non-existent domain returns nil."
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless internet-is-working)
(with-timeout (60 (ert-fail "Test timed out"))
(should (eq nil (network-lookup-address-info "emacs.invalid")))))
+;; End of tests requiring DNS
+
(defmacro process-tests--ignore-EMFILE (&rest body)
"Evaluate BODY, ignoring EMFILE errors."
(declare (indent 0) (debug t))