Merge remote-tracking branch 'origin/master' into 'feature/type-hierarchy'

This commit is contained in:
Andrea Corallo 2024-02-28 20:47:57 +01:00
commit 1fbe56c327
346 changed files with 11100 additions and 6215 deletions

View file

@ -3,8 +3,8 @@
((nil . ((tab-width . 8)
(sentence-end-double-space . t)
(fill-column . 70)
(emacs-lisp-docstring-fill-column . 65)
(fill-column . 72)
(emacs-lisp-docstring-fill-column . 72)
(vc-git-annotate-switches . "-w")
(bug-reference-url-format . "https://debbugs.gnu.org/%s")
(diff-add-log-use-relative-names . t)
@ -23,6 +23,11 @@
(electric-quote-string . nil)
(indent-tabs-mode . t)
(mode . bug-reference-prog)))
(java-mode . ((c-file-style . "GNU")
(electric-quote-comment . nil)
(electric-quote-string . nil)
(indent-tabs-mode . t)
(mode . bug-reference-prog)))
(objc-mode . ((c-file-style . "GNU")
(electric-quote-comment . nil)
(electric-quote-string . nil)
@ -32,7 +37,8 @@
(mode . bug-reference-prog)))
(log-edit-mode . ((log-edit-font-lock-gnu-style . t)
(log-edit-setup-add-author . t)
(vc-git-log-edit-summary-target-len . 50)))
(vc-git-log-edit-summary-target-len . 50)
(fill-column . 64)))
(change-log-mode . ((add-log-time-zone-rule . t)
(fill-column . 74)
(mode . bug-reference)))

View file

@ -116,6 +116,7 @@ Lars Ingebrigtsen <larsi@gnus.org> <larsi@quimbies.gnus.org>
Lars Ingebrigtsen <larsi@gnus.org> <larsi@stories.gnus.org>
Laurence Warne <laurencewarne@gmail.com>
Lin Sun <lin.sun@zoom.us>
Liu Hui <liuhui1610@gmail.com> <ilupin@users.noreply.github.com>
Ludovic Courtès <ludo@gnu.org>
Luke Lee <luke.yx.lee@gmail.com>
Martin Rudalics <rudalics@gmx.at>
@ -129,7 +130,7 @@ Maxim Nikulin <manikulin@gmail.com>
Michael Albinus <michael.albinus@gmx.de> <albinus@detlef>
Michalis V <mvar.40k@gmail.com>
Miha Rihtaršič <miha@kamnitnik.top>
Morgan J. Smith <Morgan.J.Smith@outlook.com>
Morgan Smith <Morgan.J.Smith@outlook.com>
Nick Drozd <nicholasdrozd@gmail.com>
Nicolas Petton <nicolas@petton.fr> <petton.nicolas@gmail.com>
Nitish Chandra <nitishchandrachinta@gmail.com>
@ -146,8 +147,7 @@ Philip Kaludercic <philipk@posteo.net>
Philip Kaludercic <philipk@posteo.net> <philip.kaludercic@fau.de>
Philip Kaludercic <philipk@posteo.net> <philip@icterid>
Philip Kaludercic <philipk@posteo.net> <philip@warpmail.net>
Philipp Stephani <phst@google.com>
Philipp Stephani <phst@google.com> Philipp Stephani <p.stephani2@gmail.com>
Philipp Stephani <p.stephani2@gmail.com>
Phillip Lord <phillip.lord@russet.org.uk> <phillip.lord@newcastle.ac.uk>
Pierre Lorenzon <devel@pollock-nageoire.net>
Pieter van Oostrum <pieter@vanoostrum.org> <pieter-l@vanoostrum.org>

4
BUGS
View file

@ -21,6 +21,10 @@ If necessary, you can read the manual without an info program:
cat info/emacs* | more "+/^File: emacs.*, Node: Bugs,"
If you think you may have found a critical security issue that needs
to be communicated privately, please contact the GNU Emacs maintainers
directly. See admin/MAINTAINERS for their contact details.
Please first check the file etc/PROBLEMS (e.g. with C-h C-p in Emacs) to
make sure it isn't a known issue.

View file

@ -115,9 +115,10 @@ mode after hiding the body of each entry.
Doc-strings should be updated together with the code.
New defcustom's should always have a ':version' tag stating the first
Emacs version in which they will appear. Likewise with defcustom's
whose value is changed -- update their ':version' tag.
New defcustom's and defface's should always have a ':version' tag
stating the first Emacs version in which they will appear. Likewise
with defcustom's or defface's whose value is changed -- update their
':version' tag.
Think about whether your change requires updating the manuals. If you
know it does not, mark the NEWS entry with "---" before the entry. If
@ -170,9 +171,9 @@ test 'out-of-tree' builds as well, i.e.:
** Commit messages
Ordinarily, a change you commit should contain a log entry in its
commit message and should not touch the repository's ChangeLog files.
Here is an example commit message (indented):
Ordinarily, a changeset you commit should contain a description of the
changes in its commit message and should not touch the repository's
ChangeLog files. Here is an example commit message (indented):
Deactivate shifted region
@ -184,8 +185,9 @@ Here is an example commit message (indented):
Deactivate the mark.
Occasionally, commit messages are collected and prepended to a
ChangeLog file, where they can be corrected. It saves time to get
them right the first time, so here are guidelines for formatting them:
generated ChangeLog file, where they can be corrected. It saves time
to get them right the first time, so here are guidelines for
formatting them:
- Start with a single unindented summary line explaining the change;
do not end this line with a period. If possible, try to keep the
@ -194,9 +196,10 @@ them right the first time, so here are guidelines for formatting them:
contexts.
If the summary line starts with a semicolon and a space "; ", the
commit message will be ignored when generating the ChangeLog file.
Use this for minor commits that do not need separate ChangeLog
entries, such as changes in etc/NEWS.
commit message will be skipped and not added to the generated
ChangeLog file. Use this for minor commits that do not need to be
mentioned in the ChangeLog file, such as changes in etc/NEWS, typo
fixes, etc.
- After the summary line, there should be an empty line.
@ -211,8 +214,9 @@ them right the first time, so here are guidelines for formatting them:
enforced by a commit hook.
- If only a single file is changed, the summary line can be the normal
file first line (starting with the asterisk). Then there is no
individual files section.
first line of a ChangeLog entry (starting with the asterisk). Then
there will be no individual ChangeLog entries beyond the one in the
summary line.
- If the commit has more than one author, the commit message should
contain separate lines to mention the other authors, like the
@ -243,12 +247,12 @@ them right the first time, so here are guidelines for formatting them:
- Explaining the rationale for a design choice is best done in comments
in the source code. However, sometimes it is useful to describe just
the rationale for a change; that can be done in the commit message
between the summary line and the file entries.
between the summary line and the following ChangeLog entries.
- Emacs generally follows the GNU coding standards for ChangeLogs: see
https://www.gnu.org/prep/standards/html_node/Change-Logs.html
or run 'info "(standards)Change Logs"'. One exception is that
commits still sometimes quote `like-this' (as the standards used to
- Emacs follows the GNU coding standards for ChangeLog entries: see
https://www.gnu.org/prep/standards/html_node/Change-Logs.html or run
'info "(standards)Change Logs"'. One exception is that commits
still sometimes quote `like-this' (as the standards used to
recommend) rather than 'like-this' or like this (as they do now),
as `...' is so widely used elsewhere in Emacs.
@ -261,9 +265,9 @@ them right the first time, so here are guidelines for formatting them:
in Emacs; that includes spelling and leaving 2 blanks between
sentences.
They are preserved indefinitely, and have a reasonable chance of
being read in the future, so it's better that they have good
presentation.
The ChangeLog entries are preserved indefinitely, and have a
reasonable chance of being read in the future, so it's better that
they have good presentation.
- Use the present tense; describe "what the change does", not "what
the change did".

View file

@ -137530,7 +137530,7 @@
Bind `enable-local-variables' in `hack-connection-local-variables'
* lisp/files-x.el (hack-connection-local-variables):
Bind `enable-local-variables', instead of re-declaring
Bind `enable-local-variables', instead of redeclaring
`safe-local-variable-p'.
2019-03-23 Eli Zaretskii <eliz@gnu.org>
@ -163179,7 +163179,7 @@
Quieten compilation of octave.el
* lisp/progmodes/octave.el (compilation-forget-errors): Re-declare.
* lisp/progmodes/octave.el (compilation-forget-errors): Redeclare.
2018-02-28 Glenn Morris <rgm@gnu.org>

View file

@ -27,6 +27,8 @@
# newly-built Makefile. If the source tree is already configured,
# this file defers to the existing Makefile.
. :=
# If you want non-default build options, or if you want to build in an
# out-of-source tree, you should run 'configure' before running 'make'.
# But run 'autogen.sh' first, if the source was checked out directly
@ -36,30 +38,30 @@
ifeq (help,$(filter help,$(MAKECMDGOALS)))
help:
$(info $ NOTE: This is a brief summary of some common make targets.)
$(info $ For more detailed information, please read the files INSTALL,)
$(info $ INSTALL.REPO, Makefile or visit this URL:)
$(info $ https://www.gnu.org/prep/standards/html_node/Standard-Targets.html)
$(info $ )
$(info $ make all -- compile and build Emacs)
$(info $ make install -- install Emacs)
$(info $ make TAGS -- update tags tables)
$(info $ make clean -- delete built files but preserve configuration)
$(info $ make mostlyclean -- like 'make clean', but leave those files that)
$(info $ usually do not need to be recompiled)
$(info $ make distclean -- delete all build and configuration files,)
$(info $ leave only files included in source distribution)
$(info $ make maintainer-clean -- delete almost everything that can be regenerated)
$(info $ make extraclean -- like maintainer-clean, and also delete)
$(info $ backup and autosave files)
$(info $ make bootstrap -- delete all compiled files to force a new bootstrap)
$(info $ from a clean slate, then build in the normal way)
$(info $ make uninstall -- remove files installed by 'make install')
$(info $ make check -- run the Emacs test suite)
$(info $ make docs -- generate Emacs documentation in info format)
$(info $ make html -- generate documentation in html format)
$(info $ make ps -- generate documentation in ps format)
$(info $ make pdf -- generate documentation in pdf format )
$(info $.NOTE: This is a brief summary of some common make targets.)
$(info $.For more detailed information, please read the files INSTALL,)
$(info $.INSTALL.REPO, Makefile or visit this URL:)
$(info $.https://www.gnu.org/prep/standards/html_node/Standard-Targets.html)
$(info $.)
$(info $.make all -- compile and build Emacs)
$(info $.make install -- install Emacs)
$(info $.make TAGS -- update tags tables)
$(info $.make clean -- delete built files but preserve configuration)
$(info $.make mostlyclean -- like 'make clean', but leave those files that)
$(info $. usually do not need to be recompiled)
$(info $.make distclean -- delete all build and configuration files,)
$(info $. leave only files included in source distribution)
$(info $.make maintainer-clean -- delete almost everything that can be regenerated)
$(info $.make extraclean -- like maintainer-clean, and also delete)
$(info $. backup and autosave files)
$(info $.make bootstrap -- delete all compiled files to force a new bootstrap)
$(info $. from a clean slate, then build in the normal way)
$(info $.make uninstall -- remove files installed by 'make install')
$(info $.make check -- run the Emacs test suite)
$(info $.make docs -- generate Emacs documentation in info format)
$(info $.make html -- generate documentation in html format)
$(info $.make ps -- generate documentation in ps format)
$(info $.make pdf -- generate documentation in pdf format )
@:
.PHONY: help

View file

@ -25,6 +25,9 @@ SOLARIS2
USG
USG5_4
HAIKU Compiling on Haiku.
__ANDROID__ Compiling for the Android operating system.
__ANDROID_API__ A numerical "API level" indicating the version of
Android being compiled for; see http://apilevels.com.
** Distinguishing GUIs **
@ -35,10 +38,14 @@ NS_IMPL_COCOA Compile support for Cocoa (Apple) implementation of NS GUI API.
HAVE_X11 Compile support for the X11 GUI.
HAVE_PGTK Compile support for using GTK itself without directly using X Windows APIs.
HAVE_HAIKU Compile support for the Haiku window system.
HAVE_X_WINDOWS Compile support for X Window system
(It looks like, nowadays, if HAVE_X11 is set, HAVE_X_WINDOWS must
be, and vice versa. At least, this is true for configure, and
msdos; not sure about nt.)
HAVE_X_WINDOWS Compile support for X Window system. Equivalent to HAVE_X11.
HAVE_ANDROID Compiling the Android GUI interface. Enough of this
code is compiled for the build machine cross-compiling
the Android port to produce an Emacs binary that can
run Lisp code in batch mode, for the purpose of running
the byte-compiler.
ANDROID_STUBIFY The Android GUI interface is being compiled for the build
machine, as above.
** X Windows features **
HAVE_X11R6 Whether or not the system has X11R6. (Always defined.)

View file

@ -175,6 +175,9 @@ files.")
("Michalis V" "^mvar")
("Miha Rihtaršič" "Miha Rihtarsic")
("Mikio Nakajima" "Nakajima Mikio")
(nil "montag451@laposte\\.net")
(nil "na@aisrntairetnraoitn")
("Morgan Smith" "Morgan J\\. Smith")
("Nelson Jose dos Santos Ferreira" "Nelson Ferreira")
("Noah Peart" "noah\\.v\\.peart@gmail\\.com")
("Noorul Islam" "Noorul Islam K M")

View file

@ -1583,3 +1583,5 @@ VERY VERY LONG STRIN | VERY VERY LONG STRIN
(ert-info ("Joined by bouncer to #chan@foonet, pal persent")
(ert-info ("Joined by bouncer to #chan@barnet, pal persent")
.UE .
(0.03 ":bob!~u@euegh6mj3y8r2.irc PRIVMSG #chan :alice: See, by good hap, yonder's my lord; I have sweat to see his honour.")
(0.05 ":bob!~u@euegh6mj3y8r2.irc PRIVMSG #chan :alice: But, in defence, by mercy, 'tis most just.")

View file

@ -111,10 +111,10 @@ If nil, the function `gitmerge-default-branch' guesses.")
(defvar gitmerge-mode-font-lock-keywords
`((,gitmerge-log-regexp
(1 font-lock-warning-face)
(2 font-lock-constant-face)
(3 font-lock-builtin-face)
(4 font-lock-comment-face))))
(1 'font-lock-warning-face)
(2 'font-lock-constant-face)
(3 'font-lock-builtin-face)
(4 'font-lock-comment-face))))
(defvar gitmerge--commits nil)
(defvar gitmerge--from nil)

View file

@ -53,7 +53,7 @@ GNULIB_MODULES='
AVOIDED_MODULES='
access btowc chmod close crypto/af_alg dup fchdir fstat
iswblank iswctype iswdigit iswxdigit langinfo lock
iswblank iswctype iswdigit iswxdigit langinfo localename-unsafe-limited lock
mbrtowc mbsinit memchr mkdir msvc-inval msvc-nothrow nl_langinfo
openat-die opendir pthread-h raise
save-cwd select setenv sigprocmask stat stdarg

View file

@ -0,0 +1,21 @@
The GNU Project encourages contributions from anyone who wishes to
advance the development of the GNU system, regardless of gender, race,
ethnic group, physical appearance, religion, cultural background, and
any other demographic characteristics, as well as personal political
views.
People are sometimes discouraged from participating in GNU development
because of certain patterns of communication that strike them as
unfriendly, unwelcoming, rejecting, or harsh. This discouragement
particularly affects members of disprivileged demographics, but it is
not limited to them. Therefore, we ask all contributors to make a
conscious effort, in GNU Project discussions, to communicate in ways
that avoid that outcome — to avoid practices that will predictably and
unnecessarily risk putting some contributors off.
The GNU Kind Communications Guidelines suggest specific ways to
accomplish that goal. You can find the latest version at
https://www.gnu.org/philosophy/kind-communication.html
When sending messages to Emacs mailing lists, we ask you to read and
respect these guidelines.

View file

@ -43,7 +43,7 @@ case "${lang}" in
org="phoenixframework"
;;
"lua")
org="MunifTanjim"
org="tree-sitter-grammars"
;;
"typescript")
sourcedir="tree-sitter-typescript/typescript/src"

View file

@ -1231,6 +1231,7 @@ package will likely install on older systems but crash on startup.])
passthrough="$passthrough --with-mailutils=$with_mailutils"
passthrough="$passthrough --with-pop=$with_pop"
passthrough="$passthrough --with-harfbuzz=$with_harfbuzz"
passthrough="$passthrough --with-threads=$with_threads"
# Now pass through some checking options.
emacs_val="--enable-check-lisp-object-type=$enable_check_lisp_object_type"
@ -1321,6 +1322,7 @@ if test "$ANDROID" = "yes"; then
with_pop=no
with_harfbuzz=no
with_native_compilation=no
with_threads=no
fi
with_rsvg=no
@ -1331,7 +1333,6 @@ if test "$ANDROID" = "yes"; then
with_gpm=no
with_dbus=no
with_gsettings=no
with_threads=no
with_ns=no
# zlib is available in android.
@ -2336,6 +2337,7 @@ fi
AC_DEFUN([AC_TYPE_SIZE_T])
# Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them.
AC_DEFUN([AC_TYPE_UID_T])
ac_cv_type_gid_t=yes # AC_TYPE_GETGROUPS needs this in Autoconf 2.72.
# Check for all math.h functions that Emacs uses; on some platforms,
# -lm is needed for some of these functions.
@ -4086,16 +4088,16 @@ case $with_file_notification,$opsys in
fi ;;
esac
dnl inotify is available only on GNU/Linux.
dnl inotify is available only on Linux-kernel based systems.
case $with_file_notification,$NOTIFY_OBJ in
inotify, | yes,)
AC_CHECK_HEADER([sys/inotify.h])
if test "$ac_cv_header_sys_inotify_h" = yes ; then
AC_CHECK_FUNC([inotify_init1])
if test "$ac_cv_func_inotify_init1" = yes; then
AC_CHECK_FUNCS([inotify_init inotify_init1])
if test "$ac_cv_func_inotify_init" = yes; then
AC_DEFINE([HAVE_INOTIFY], [1], [Define to 1 to use inotify.])
NOTIFY_OBJ=inotify.o
NOTIFY_SUMMARY="yes -lglibc (inotify)"
NOTIFY_SUMMARY="yes (inotify)"
fi
fi ;;
esac
@ -5905,13 +5907,15 @@ pthread_sigmask strsignal setitimer \
sendto recvfrom getsockname getifaddrs freeifaddrs \
gai_strerror sync \
endpwent getgrent endgrent \
renameat2 \
cfmakeraw cfsetspeed __executable_start log2 pthread_setname_np \
pthread_set_name_np])
# getpwent is not present in older versions of Android. (bug#65319)
gl_CHECK_FUNCS_ANDROID([getpwent], [[#include <pwd.h>]])
# renameat2 is not present in older versions of Android.
gl_CHECK_FUNCS_ANDROID([renameat2], [[#include <stdio.h>]])
if test "$ac_cv_func_cfmakeraw" != "yes"; then
# On some systems (Android), cfmakeraw is inline, so AC_CHECK_FUNCS
# cannot find it. Check if some code including termios.h and using

View file

@ -44,12 +44,13 @@ have_working_info = $(filter notintermediate,$(value .FEATURES))
# The workaround is done only for AM_V_ELC and AM_V_ELN,
# since the bug is not annoying elsewhere.
AM_V_AR = @$(info $ AR $@)
. :=
AM_V_AR = @$(info $. AR $@)
AM_V_at = @
AM_V_CC = @$(info $ CC $@)
AM_V_CXX = @$(info $ CXX $@)
AM_V_CCLD = @$(info $ CCLD $@)
AM_V_CXXLD = @$(info $ CXXLD $@)
AM_V_GEN = @$(info $ GEN $@)
AM_V_CC = @$(info $. CC $@)
AM_V_CXX = @$(info $. CXX $@)
AM_V_CCLD = @$(info $. CCLD $@)
AM_V_CXXLD = @$(info $. CXXLD $@)
AM_V_GEN = @$(info $. GEN $@)
AM_V_NO_PD = --no-print-directory
endif

View file

@ -632,15 +632,18 @@ long, by using Auto Fill mode. @xref{Filling}.
@cindex continuation lines, visual wrap prefix
@findex visual-wrap-prefix-mode
@findex global-visual-wrap-prefix-mode
Normally, the first character of each continuation line is
positioned at the beginning of the screen line where it is displayed.
The minor mode @code{visual-wrap-prefix-mode} arranges that
continuation lines be prefixed by slightly adjusted versions of the
fill prefixes (@pxref{Fill Prefix}) of their respective logical lines,
so that indentation characters or the prefixes of source code comments
are replicated across every continuation line, and the appearance of
such comments or indentation is not broken. These prefixes are only
shown on display, and does not change the buffer text in any way.
The minor mode @code{visual-wrap-prefix-mode} and its global
(@pxref{Minor Modes}) counterpart
@code{global-visual-wrap-prefix-mode} arranges that continuation lines
be prefixed by slightly adjusted versions of the fill prefixes
(@pxref{Fill Prefix}) of their respective logical lines, so that
indentation characters or the prefixes of source code comments are
replicated across every continuation line, and the appearance of such
comments or indentation is not broken. These prefixes are only shown
on display, and does not change the buffer text in any way.
Sometimes, you may need to edit files containing many long logical
lines, and it may not be practical to break them all up by adding

View file

@ -205,7 +205,7 @@ Here is an example of a buffer list:
@smallexample
CRM Buffer Size Mode File
. * .emacs 3294 Emacs-Lisp ~/.emacs
. * .emacs 3294 ELisp/l ~/.emacs
% *Help* 101 Help
search.c 86055 C ~/cvs/emacs/src/search.c
% src 20959 Dired by name ~/cvs/emacs/src/

View file

@ -2210,6 +2210,14 @@ keys; its value is the number of seconds of pause required to cause echoing
to start, or zero, meaning don't echo at all. The value takes effect when
there is something to echo. @xref{Echo Area}.
@vindex echo-keystrokes-help
If the variable @code{echo-keystrokes-help} is non-@code{nil} (the
default), the multi-character key sequence echo shown according to
@code{echo-keystrokes} will include a short help text about keys which
will invoke @code{describe-prefix-bindings} (@pxref{Misc Help}) to show
the list of commands for the prefix you already typed. For a related
help facility, see @ref{which-key}.
@cindex mouse pointer
@cindex hourglass pointer display
@vindex display-hourglass

View file

@ -260,6 +260,11 @@ by these buttons, Emacs provides the @code{button-describe} and
@code{widget-describe} commands, that should be run with point over
the button.
@anchor{which-key}
@kbd{M-x which-key} is a global minor mode which helps in discovering
keymaps. It displays keybindings following your currently entered
incomplete command (prefix), in a popup.
@node Name Help
@section Help by Command or Variable Name

View file

@ -1097,6 +1097,12 @@ so that Outline mode will know that sections are contained in
chapters. This works as long as no other command starts with
@samp{@@chap}.
@vindex outline-search-function
Instead of setting the variable @code{outline-regexp}, you can set
the variable @code{outline-search-function} to a function that
matches the current heading and searches for the next one
(@pxref{Outline Minor Mode,,,elisp, the Emacs Lisp Reference Manual}).
@vindex outline-level
You can explicitly specify a rule for calculating the level of a
heading line by setting the variable @code{outline-level}. The value

View file

@ -65,7 +65,7 @@ expanded in the buffer. For the user-level commands for abbrevs, see
@defun make-abbrev-table &optional props
This function creates and returns a new, empty abbrev table---an
obarray containing no symbols. It is a vector filled with zeros.
obarray containing no symbols.
@var{props} is a property list that is applied to the new table
(@pxref{Abbrev Table Properties}).
@end defun

View file

@ -35,7 +35,6 @@ variable binding for @code{no-byte-compile} into it, like this:
* Speed of Byte-Code:: An example of speedup from byte compilation.
* Compilation Functions:: Byte compilation functions.
* Docs and Compilation:: Dynamic loading of documentation strings.
* Dynamic Loading:: Dynamic loading of individual functions.
* Eval During Compile:: Code to be evaluated when you compile.
* Compiler Errors:: Handling compiler error messages.
* Byte-Code Objects:: The data type used for byte-compiled functions.
@ -289,71 +288,6 @@ stands for the name of this file, as a string. Do not use these
constructs in Lisp source files; they are not designed to be clear to
humans reading the file.
@node Dynamic Loading
@section Dynamic Loading of Individual Functions
@cindex dynamic loading of functions
@cindex lazy loading
When you compile a file, you can optionally enable the @dfn{dynamic
function loading} feature (also known as @dfn{lazy loading}). With
dynamic function loading, loading the file doesn't fully read the
function definitions in the file. Instead, each function definition
contains a place-holder which refers to the file. The first time each
function is called, it reads the full definition from the file, to
replace the place-holder.
The advantage of dynamic function loading is that loading the file
should become faster. This is a good thing for a file which contains
many separate user-callable functions, if using one of them does not
imply you will probably also use the rest. A specialized mode which
provides many keyboard commands often has that usage pattern: a user may
invoke the mode, but use only a few of the commands it provides.
The dynamic loading feature has certain disadvantages:
@itemize @bullet
@item
If you delete or move the compiled file after loading it, Emacs can no
longer load the remaining function definitions not already loaded.
@item
If you alter the compiled file (such as by compiling a new version),
then trying to load any function not already loaded will usually yield
nonsense results.
@end itemize
These problems will never happen in normal circumstances with
installed Emacs files. But they are quite likely to happen with Lisp
files that you are changing. The easiest way to prevent these problems
is to reload the new compiled file immediately after each recompilation.
@emph{Experience shows that using dynamic function loading provides
benefits that are hardly measurable, so this feature is deprecated
since Emacs 27.1.}
The byte compiler uses the dynamic function loading feature if the
variable @code{byte-compile-dynamic} is non-@code{nil} at compilation
time. Do not set this variable globally, since dynamic loading is
desirable only for certain files. Instead, enable the feature for
specific source files with file-local variable bindings. For example,
you could do it by writing this text in the source file's first line:
@example
-*-byte-compile-dynamic: t;-*-
@end example
@defvar byte-compile-dynamic
If this is non-@code{nil}, the byte compiler generates compiled files
that are set up for dynamic function loading.
@end defvar
@defun fetch-bytecode function
If @var{function} is a byte-code function object, this immediately
finishes loading the byte code of @var{function} from its
byte-compiled file, if it is not fully loaded already. Otherwise,
it does nothing. It always returns @var{function}.
@end defun
@node Eval During Compile
@section Evaluation During Compilation
@cindex eval during compilation

View file

@ -638,6 +638,16 @@ with @var{n} arguments (the other elements) and an additional
Example: @code{(= 42)}@*
In this example, the function is @code{=}, @var{n} is one, and
the actual function call becomes: @w{@code{(= 42 @var{expval})}}.
@item function call with an @code{_} arg
Call the function (the first element of the function call)
with the specified arguments (the other elements) and replacing
@code{_} with @var{expval}.
Example: @code{(gethash _ memo-table)}
In this example, the function is @code{gethash}, and
the actual function call becomes: @w{@code{(gethash @var{expval}
memo-table)}}.
@end table
@item (app @var{function} @var{pattern})

View file

@ -653,7 +653,6 @@ Byte Compilation
* Speed of Byte-Code:: An example of speedup from byte compilation.
* Compilation Functions:: Byte compilation functions.
* Docs and Compilation:: Dynamic loading of documentation strings.
* Dynamic Loading:: Dynamic loading of individual functions.
* Eval During Compile:: Code to be evaluated when you compile.
* Compiler Errors:: Handling compiler error messages.
* Byte-Code Objects:: The data type used for byte-compiled functions.
@ -884,6 +883,7 @@ Major and Minor Modes
* Minor Modes:: Defining minor modes.
* Mode Line Format:: Customizing the text that appears in the mode line.
* Imenu:: Providing a menu of definitions made in a buffer.
* Outline Minor Mode:: Outline mode to use with other major modes.
* Font Lock Mode:: How modes can highlight text according to syntax.
* Auto-Indentation:: How to teach Emacs to indent for a major mode.
* Desktop Save Mode:: How modes can have buffer state saved between

View file

@ -89,9 +89,9 @@ you are criticizing.
@cindex bugs
@cindex suggestions
Please send comments and corrections using @kbd{M-x
report-emacs-bug}. If you wish to contribute new code (or send a
patch to fix a problem), use @kbd{M-x submit-emacs-patch}.
Please send comments and corrections using @kbd{M-x report-emacs-bug}.
For more details, @xref{Bugs,, Reporting Bugs, emacs, The GNU Emacs
Manual}.
@node Lisp History
@section Lisp History

View file

@ -2562,6 +2562,14 @@ times match.
The optional argument @var{default} specifies the default password to
return if the user enters empty input. If @var{default} is @code{nil},
then @code{read-passwd} returns the null string in that case.
This function uses @code{read-passwd-mode}, a minor mode. It binds two
keys in the minbuffer: @kbd{C-u} (@code{delete-minibuffer-contents})
deletes the password, and @kbd{TAB}
(@code{read-passwd--toggle-visibility}) toggles the visibility of the
password. There is also an additional icon in the mode-line. Clicking
on this icon with @key{mouse-1} toggles the visibility of the password
as well.
@end defun
@node Minibuffer Commands

View file

@ -25,6 +25,7 @@ user. For related topics such as keymaps and syntax tables, see
* Minor Modes:: Defining minor modes.
* Mode Line Format:: Customizing the text that appears in the mode line.
* Imenu:: Providing a menu of definitions made in a buffer.
* Outline Minor Mode:: Outline mode to use with other major modes.
* Font Lock Mode:: How modes can highlight text according to syntax.
* Auto-Indentation:: How to teach Emacs to indent for a major mode.
* Desktop Save Mode:: How modes can have buffer state saved between
@ -507,6 +508,12 @@ variable @code{imenu-generic-expression}, for the two variables
@code{imenu-extract-index-name-function}, or for the variable
@code{imenu-create-index-function} (@pxref{Imenu}).
@item
The mode should specify how Outline minor mode should find the
heading lines, by setting up a buffer-local value for the variables
@code{outline-regexp} or @code{outline-search-function}, and also
for the variable @code{outline-level} (@pxref{Outline Minor Mode}).
@item
The mode can tell ElDoc mode how to retrieve different types of
documentation for whatever is at point, by adding one or more
@ -1182,7 +1189,7 @@ column is sorted in the descending order.
This buffer-local variable specifies the format of the Tabulated List
data. Its value should be a vector. Each element of the vector
represents a data column, and should be a list @code{(@var{name}
@var{width} @var{sort})}, where
@var{width} @var{sort} . @var{props})}, where
@itemize
@item
@ -1199,6 +1206,13 @@ sorted by comparing string values. Otherwise, this should be a
predicate function for @code{sort} (@pxref{Rearrangement}), which
accepts two arguments with the same form as the elements of
@code{tabulated-list-entries} (see below).
@item
@var{props} is a plist (@pxref{Property Lists}) of additional column
properties. If the value of the property @code{:right-align} is
non-@code{nil} then the column should be right-aligned. And the
property @code{:pad-right} specifies the number of additional padding
spaces to the right of the column (by default 1 if omitted).
@end itemize
@end defvar
@ -2994,6 +3008,61 @@ instead.
automatically sets up Imenu if this variable is non-@code{nil}.
@end defvar
@node Outline Minor Mode
@section Outline Minor Mode
@cindex Outline minor mode
@dfn{Outline minor mode} is a buffer-local minor mode that hides
parts of the buffer and leaves only heading lines visible.
This minor mode can be used in conjunction with other major modes
(@pxref{Outline Minor Mode,, Outline Minor Mode, emacs, the Emacs Manual}).
There are two ways to define which lines are headings: with the
variable @code{outline-regexp} or @code{outline-search-function}.
@defvar outline-regexp
This variable is a regular expression.
Any line whose beginning has a match for this regexp is considered a
heading line. Matches that start within a line (not at the left
margin) do not count.
@end defvar
@defvar outline-search-function
Alternatively, when it's impossible to create a regexp that
matches heading lines, you can define a function that helps
Outline minor mode to find heading lines.
The variable @code{outline-search-function} specifies the function with
four arguments: @var{bound}, @var{move}, @var{backward}, and
@var{looking-at}. The function completes two tasks: to match the
current heading line, and to find the next or the previous heading line.
If the argument @var{looking-at} is non-@code{nil}, it should return
non-@code{nil} when point is at the beginning of the outline header line.
If the argument @var{looking-at} is @code{nil}, the first three arguments
are used. The argument @var{bound} is a buffer position that bounds
the search. The match found must not end after that position. A
value of nil means search to the end of the accessible portion of
the buffer. If the argument @var{move} is non-@code{nil}, the
failed search should move to the limit of search and return nil.
If the argument @var{backward} is non-@code{nil}, this function
should search for the previous heading backward.
@end defvar
@defvar outline-level
This variable is a function that takes no arguments
and should return the level of the current heading.
It's required in both cases: whether you define
@code{outline-regexp} or @code{outline-search-function}.
@end defvar
If built with tree-sitter, Emacs can automatically use
Outline minor mode if the major mode sets the following variable.
@defvar treesit-outline-predicate
This variable instructs Emacs how to find lines with outline headings.
It should be a predicate that matches the node on the heading line.
@end defvar
@node Font Lock Mode
@section Font Lock Mode
@cindex Font Lock mode

View file

@ -2122,6 +2122,9 @@ with references to further information.
@item numberp
@xref{Predicates on Numbers, numberp}.
@item obarrayp
@xref{Creating Symbols, obarrayp}.
@item overlayp
@xref{Overlays, overlayp}.
@ -2182,7 +2185,7 @@ This function returns a symbol naming the primitive type of
@code{condition-variable}, @code{cons}, @code{finalizer},
@code{float}, @code{font-entity}, @code{font-object},
@code{font-spec}, @code{frame}, @code{hash-table}, @code{integer},
@code{marker}, @code{mutex}, @code{overlay}, @code{process},
@code{marker}, @code{mutex}, @code{obarray}, @code{overlay}, @code{process},
@code{string}, @code{subr}, @code{symbol}, @code{thread},
@code{vector}, @code{window}, or @code{window-configuration}.
However, if @var{object} is a record, the type specified by its first

View file

@ -28,6 +28,7 @@ these archives).
* Multi-file Packages:: How to package multiple files.
* Package Archives:: Maintaining package archives.
* Archive Web Server:: Interfacing to an archive web server.
* Forwards-Compatibility:: Supporting older versions of Emacs.
@end menu
@node Packaging Basics
@ -399,3 +400,50 @@ Return the file. This will be the tarball for a multi-file
package, or the single file for a simple package.
@end table
@node Forwards-Compatibility
@section Supporting older versions of Emacs
@cindex compatibility compat
Packages that wish to support older releases of Emacs, without giving
up on newer functionality from recent Emacs releases, one can make use
of the Compat package on GNU ELPA. By depending on the package, Emacs
can provide compatibility definitions for missing functionality.
The versioning of Compat follows that of Emacs, so next to the oldest
version that a package relies on (via the @code{emacs}-package), one
can also indicate what the newest version of Emacs is, that a package
wishes to use definitions from:
@example
;; Package-Requires: ((emacs "27.2") (compat "29.1"))
@end example
Note that Compat provides replacement functions with extended
functionality for functions that are already defined (@code{sort},
@code{assoc}, @dots{}). These functions may have changed their
calling convention (additional optional arguments) or may have changed
their behavior. These functions must be looked up explicitly with
@code{compat-function} or called explicitly with @code{compat-call}.
We call them @dfn{Extended Definitions}. In contrast, newly @dfn{Added
Definitions} can be called as usual.
@defmac compat-call fun &rest args
This macro calls the compatibility function @var{fun} with @var{args}.
Many functions provided by Compat can be called directly without this
macro. However in the case where Compat provides an alternative
version of an existing function, the function call has to go through
@code{compat-call}.
@end defmac
@defmac compat-function fun
This macro returns the compatibility function symbol for @var{fun}.
See @code{compat-call} for a more convenient macro to directly call
compatibility functions.
@end defmac
For further details on how to make use of the package, see
@ref{Usage,, Usage, compat, "Compat" Manual}. In case you don't have
the manual installed, you can also read the
@url{https://elpa.gnu.org/packages/doc/compat.html#Usage, Online
Compat manual}.

View file

@ -794,7 +794,7 @@ that comes after it in the buffer position order, i.e., nodes with
start positions greater than the end position of @var{start}.
In the tree shown above, @code{treesit-search-subtree} traverses node
@samp{S} (@var{start}) and nodes marked with @code{o}, where this
@samp{S} (@var{start}) and nodes marked with @code{o}, whereas this
function traverses the nodes marked with numbers. This function is
useful for answering questions like ``what is the first node after
@var{start} in the buffer that satisfies some condition?''
@ -916,32 +916,37 @@ nodes.
@defun treesit-parent-until node predicate &optional include-node
This function repeatedly finds the parents of @var{node}, and returns
the parent that satisfies @var{pred}, a function that takes a node as
argument and returns a boolean that indicates a match. If no parent
satisfies @var{pred}, this function returns @code{nil}.
the parent that satisfies @var{predicate}. @var{predicate} can be
either a function that takes a node as argument and returns @code{t}
or @code{nil}, or a regexp matching node type names, or other valid
predicates described in @var{treesit-thing-settings}. If no parent
satisfies @var{predicates}, this function returns @code{nil}.
Normally this function only looks at the parents of @var{node} but not
@var{node} itself. But if @var{include-node} is non-@code{nil}, this
function returns @var{node} if @var{node} satisfies @var{pred}.
function returns @var{node} if @var{node} satisfies @var{predicate}.
@end defun
@defun treesit-parent-while node pred
@defun treesit-parent-while node predicate
This function goes up the tree starting from @var{node}, and keeps
doing so as long as the nodes satisfy @var{pred}, a function that
doing so as long as the nodes satisfy @var{predicate}, a function that
takes a node as argument. That is, this function returns the highest
parent of @var{node} that still satisfies @var{pred}. Note that if
@var{node} satisfies @var{pred} but its immediate parent doesn't,
parent of @var{node} that still satisfies @var{predicate}. Note that if
@var{node} satisfies @var{predicate} but its immediate parent doesn't,
@var{node} itself is returned.
@end defun
@defun treesit-node-top-level node &optional type
@defun treesit-node-top-level node &optional predicate include-node
This function returns the highest parent of @var{node} that has the
same type as @var{node}. If no such parent exists, it returns
@code{nil}. Therefore this function is also useful for testing
whether @var{node} is top-level.
If @var{type} is non-@code{nil}, this function matches each parent's
type with @var{type} as a regexp, rather than using @var{node}'s type.
If @var{predicate} is @code{nil}, this function uses @var{node}'s type
to find the parent. If @var{predicate} is non-@code{nil}, this
function searches the parent that satisfies @var{predicate}. If
@var{include-node} is non-@code{nil}, this function returns @var{node}
if @var{node} satisfies @var{predicate}.
@end defun
@node Accessing Node Information
@ -1892,6 +1897,10 @@ add-log functions used by @code{add-log-current-defun}.
@item
If @code{treesit-simple-imenu-settings} (@pxref{Imenu}) is
non-@code{nil}, it sets up Imenu.
@item
If @code{treesit-outline-predicate} (@pxref{Outline Minor Mode}) is
non-@code{nil}, it sets up Outline minor mode.
@end itemize
@c TODO: Add treesit-thing-settings stuff once we finalize it.

View file

@ -434,12 +434,44 @@ but their relative order is also preserved:
(9 . "aaa") (9 . "zzz") (9 . "ppp") (9 . "fff")]
@end group
@end example
@xref{Sorting}, for more functions that perform sorting.
See @code{documentation} in @ref{Accessing Documentation}, for a
useful example of @code{sort}.
@end defun
Sometimes, computation of sort keys of list or vector elements is
expensive, and therefore it is important to perform it the minimum
number of times. By contrast, computing the sort keys of elements
inside the @var{predicate} function passed to @code{sort} will generally
perform this computation each time @var{predicate} is called with some
element. If you can separate the computation of the sort key of an
element into a function of its own, you can use the following sorting
function, which guarantees that the key will be computed for each list
or vector element exactly once.
@cindex decorate-sort-undecorate
@cindex Schwartzian transform
@defun sort-on sequence predicate accessor
This function stably sorts @var{sequence}, which can be a list, a
vector, a bool-vector, or a string. It sorts by comparing the sort
keys of the elements using @var{predicate}. The comparison function
@var{predicate} accepts two arguments, the sort keys to compare, and
should return non-@code{nil} if the element corresponding to the first
key should sort before the element corresponding to the second key. The
function computes a sort key of each element by calling the
@var{accessor} function on that element; it does so exactly once for
each element of @var{sequence}. The @var{accessor} function is called
with a single argument, an element of @var{sequence}.
This function implements what is known as @dfn{decorate-sort-undecorate}
paradigm, or the Schwartzian transform. It basically trades CPU for
memory, creating a temporary list with the computed sort keys, then
mapping @code{car} over the result of sorting that temporary list.
Unlike with @code{sort}, the return value is always a new list; the
original @var{sequence} is left intact.
@end defun
@xref{Sorting}, for more functions that perform sorting. See
@code{documentation} in @ref{Accessing Documentation}, for a useful
example of @code{sort}.
@cindex sequence functions in seq
@cindex seq library
@cindex sequences, generalized

View file

@ -177,34 +177,16 @@ know how Lisp reads them. Lisp must ensure that it finds the same
symbol every time it reads the same sequence of characters in the same
context. Failure to do so would cause complete confusion.
@cindex symbol name hashing
@cindex hashing
@cindex obarray
@cindex bucket (in obarray)
When the Lisp reader encounters a name that references a symbol in
the source code, it reads all the characters of that name. Then it
looks up that name in a table called an @dfn{obarray} to find the
symbol that the programmer meant. The technique used in this lookup
is called ``hashing'', an efficient method of looking something up by
converting a sequence of characters to a number, known as a ``hash
code''. For example, instead of searching a telephone book cover to
cover when looking up Jan Jones, you start with the J's and go from
there. That is a simple version of hashing. Each element of the
obarray is a @dfn{bucket} which holds all the symbols with a given
hash code; to look for a given name, it is sufficient to look through
all the symbols in the bucket for that name's hash code. (The same
idea is used for general Emacs hash tables, but they are a different
data type; see @ref{Hash Tables}.)
the source code, it looks up that name in a table called an @dfn{obarray}
to find the symbol that the programmer meant. An obarray is an unordered
container of symbols, indexed by name.
When looking up names, the Lisp reader also considers ``shorthands''.
The Lisp reader also considers ``shorthands''.
If the programmer supplied them, this allows the reader to find a
symbol even if its name isn't present in its full form in the source
code. Of course, the reader needs to be aware of some pre-established
context about such shorthands, much as one needs context to be to able
to refer uniquely to Jan Jones by just the name ``Jan'': it's probably
fine when amongst the Joneses, or when Jan has been mentioned
recently, but very ambiguous in any other situation.
@xref{Shorthands}.
code. @xref{Shorthands}.
@cindex interning
If a symbol with the desired name is found, the reader uses that
@ -236,23 +218,6 @@ to gain access to it is by finding it in some other object or as the
value of a variable. Uninterned symbols are sometimes useful in
generating Lisp code, see below.
In Emacs Lisp, an obarray is actually a vector. Each element of the
vector is a bucket; its value is either an interned symbol whose name
hashes to that bucket, or 0 if the bucket is empty. Each interned
symbol has an internal link (invisible to the user) to the next symbol
in the bucket. Because these links are invisible, there is no way to
find all the symbols in an obarray except using @code{mapatoms} (below).
The order of symbols in a bucket is not significant.
In an empty obarray, every element is 0, so you can create an obarray
with @code{(make-vector @var{length} 0)}. @strong{This is the only
valid way to create an obarray.} Prime numbers as lengths tend
to result in good hashing; lengths one less than a power of two are also
good.
@strong{Do not try to put symbols in an obarray yourself.} This does
not work---only @code{intern} can enter a symbol in an obarray properly.
@cindex CL note---symbol in obarrays
@quotation
@b{Common Lisp note:} Unlike Common Lisp, Emacs Lisp does not provide
@ -262,9 +227,21 @@ Emacs Lisp provides a different namespacing system called
``shorthands'' (@pxref{Shorthands}).
@end quotation
@defun obarray-make &optional size
This function creates and returns a new obarray.
The optional @var{size} may be used to specify the number of symbols
that it is expected to hold, but since obarrays grow automatically
as needed, this rarely provide any benefit.
@end defun
@defun obarrayp object
This function returns @code{t} if @var{object} is an obarray,
@code{nil} otherwise.
@end defun
Most of the functions below take a name and sometimes an obarray as
arguments. A @code{wrong-type-argument} error is signaled if the name
is not a string, or if the obarray is not a vector.
is not a string, or if the obarray is not an obarray object.
@defun symbol-name symbol
This function returns the string that is @var{symbol}'s name. For example:
@ -416,6 +393,10 @@ If @code{unintern} does delete a symbol, it returns @code{t}. Otherwise
it returns @code{nil}.
@end defun
@defun obarray-clear obarray
This function removes all symbols from @var{obarray}.
@end defun
@node Symbol Properties
@section Symbol Properties
@cindex symbol property
@ -761,6 +742,23 @@ instead of @code{snu-}.
;; End:
@end example
Note that if you have two shorthands in the same file where one is the
prefix of the other, the longer shorthand will be attempted first.
This happens regardless of the order you specify shorthands in the
local variables section of your file.
@example
'(
t//foo ; reads to 'my-tricks--foo', not 'my-tricks-/foo'
t/foo ; reads to 'my-tricks-foo'
)
;; Local Variables:
;; read-symbol-shorthands: (("t/" . "my-tricks-")
;; ("t//" . "my-tricks--")
;; End:
@end example
@subsection Exceptions
There are two exceptions to rules governing Shorthand transformations:

View file

@ -289,6 +289,15 @@ also ask you whether or not to sign the text before encryption and if
you answered yes, it will let you select the signing keys.
@end deffn
@defvar epa-keys-select-method
This variable controls the method used for key selection in
@code{epa-select-keys}. The default value @code{buffer} pops up a
special buffer where you can select the keys. If the value is
@code{minibuffer}, @code{epa-select-keys} will instead prompt for the
keys in the minibuffer, where you should type the keys separated by
commas.
@end defvar
@node Cryptographic operations on files
@section Cryptographic Operations on Files
@cindex cryptographic operations on files

View file

@ -1230,25 +1230,30 @@ machine Example.Net login aph-bot password sesame
(defun my-erc-up (network)
(interactive "Snetwork: ")
(pcase network
('libera
(let ((erc-sasl-mechanism 'external))
(erc-tls :server "irc.libera.chat" :port 6697
:client-certificate t)))
('example
(let ((erc-sasl-auth-source-function
#'erc-sasl-auth-source-password-as-host))
(erc-tls :server "irc.example.net" :port 6697
:user "alyssa"
:password "Example.Net")))))
(require 'erc-sasl)
(or (let ((erc-modules (cons 'sasl erc-modules)))
(pcase network
('libera
(let ((erc-sasl-mechanism 'external))
(erc-tls :server "irc.libera.chat"
:client-certificate t)))
('example
(let ((erc-sasl-auth-source-function
#'erc-sasl-auth-source-password-as-host))
(erc-tls :server "irc.example.net"
:user "alyssa"
:password "Example.Net")))))
;; Non-SASL
(call-interactively #'erc-tls)))
@end lisp
You've started storing your credentials with auth-source and have
decided to try SASL on another network as well. But there's a catch:
this network doesn't support @samp{EXTERNAL}. You use
@code{let}-binding to get around this and successfully authenticate to
both networks.
@code{let}-binding to work around this and successfully authenticate
to both networks. (Note that this example assumes you've removed
@code{sasl} from @code{erc-modules} globally and have instead opted to
add it locally when connecting to preconfigured networks.)
@end itemize

File diff suppressed because it is too large Load diff

View file

@ -5832,10 +5832,11 @@ message to the mailing list, and include the original message
@kindex S v @r{(Summary)}
@findex gnus-summary-very-wide-reply
Mail a very wide reply to the author of the current article
(@code{gnus-summary-very-wide-reply}). A @dfn{very wide reply} is a reply
that goes out to all people listed in the @code{To}, @code{From} (or
@code{Reply-To}) and @code{Cc} headers in all the process/prefixed
articles. This command uses the process/prefix convention.
(@code{gnus-summary-very-wide-reply}). A @dfn{very wide reply} is a
reply that goes out to all people listed in the @code{To}, @code{From}
(or @code{Reply-To}) and @code{Cc} headers in all the process/prefixed
articles. This command uses the process/prefix convention. If given a
prefix argument, the body of the current article will also be yanked.
@item S V
@kindex S V @r{(Summary)}
@ -26694,9 +26695,12 @@ buffers. It is enabled with
@table @kbd
@item C-c C-m C-a
@findex gnus-dired-attach
@vindex gnus-dired-attach-at-end
@cindex attachments, selection via dired
Send dired's marked files as an attachment (@code{gnus-dired-attach}).
You will be prompted for a message buffer.
The function prompts for a message buffer, and by default attaches files
to the end of that buffer; customize @code{gnus-dired-attach-at-end} to
place the attachments at point instead.
@item C-c C-m C-l
@findex gnus-dired-find-file-mailcap

View file

@ -3,9 +3,9 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2023-09-19.19}
\def\texinfoversion{2024-02-10.22}
%
% Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc.
% Copyright 1985, 1986, 1988, 1990-2024 Free Software Foundation, Inc.
%
% This texinfo.tex file is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
@ -5238,14 +5238,14 @@
% the current value of \escapechar.
\def\escapeisbackslash{\escapechar=`\\}
% Use \ in index files by default. texi2dvi didn't support @ as the escape
% character (as it checked for "\entry" in the files, and not "@entry"). When
% the new version of texi2dvi has had a chance to become more prevalent, then
% the escape character can change back to @ again. This should be an easy
% change to make now because both @ and \ are only used as escape characters in
% index files, never standing for themselves.
% Uncomment to use \ in index files by default. Old texi2dvi (before 2019)
% didn't support @ as the escape character (as it checked for "\entry" in
% the files, and not "@entry").
% In the future we can remove this flag and simplify the code for
% index files and backslashes, once the support is no longer likely to be
% useful.
%
\set txiindexescapeisbackslash
% \set txiindexescapeisbackslash
% Write the entry in \indextext to the index file.
%
@ -6137,8 +6137,7 @@
% normally unnmhead0 calls unnumberedzzz:
\outer\parseargdef\unnumbered{\unnmhead0{#1}}
\def\unnumberedzzz#1{%
\global\secno=0 \global\subsecno=0 \global\subsubsecno=0
\global\advance\unnumberedno by 1
\global\advance\unnumberedno by 1
%
% Since an unnumbered has no number, no prefix for figures.
\global\let\chaplevelprefix = \empty
@ -6194,8 +6193,8 @@
% normally calls unnumberedseczzz:
\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
\def\unnumberedseczzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
\sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
\global\advance\unnumberedno by 1
\sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno}%
}
% Subsections.
@ -6218,9 +6217,8 @@
% normally calls unnumberedsubseczzz:
\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
\def\unnumberedsubseczzz#1{%
\global\subsubsecno=0 \global\advance\subsecno by 1
\sectionheading{#1}{subsec}{Ynothing}%
{\the\unnumberedno.\the\secno.\the\subsecno}%
\global\advance\unnumberedno by 1
\sectionheading{#1}{subsec}{Ynothing}{\the\unnumberedno}%
}
% Subsubsections.
@ -6244,9 +6242,8 @@
% normally unnumberedsubsubseczzz:
\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
\def\unnumberedsubsubseczzz#1{%
\global\advance\subsubsecno by 1
\sectionheading{#1}{subsubsec}{Ynothing}%
{\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
\global\advance\unnumberedno by 1
\sectionheading{#1}{subsubsec}{Ynothing}{\the\unnumberedno}%
}
% These macros control what the section commands do, according
@ -8205,8 +8202,6 @@
\let\commondummyword\unmacrodo
\xdef\macrolist{\macrolist}%
\endgroup
\else
\errmessage{Macro #1 not defined}%
\fi
}

View file

@ -523,9 +523,11 @@ is used as the group to change to. The default host name is the same.
@cindex @option{sudo} method
@cindex method @option{doas}
@cindex @option{doas} method
@cindex method @option{androidsu}
@cindex @option{androidsu} method
If the @option{su}, @option{sudo} or @option{doas} option should be
performed on another host, it can be comnbined with a leading
performed on another host, it can be combined with a leading
@option{ssh} or @option{plink} option. That means that @value{tramp}
connects first to the other host with non-administrative credentials,
and changes to administrative credentials on that host afterwards. In
@ -533,6 +535,11 @@ a simple case, the syntax looks like
@file{@trampfn{ssh@value{postfixhop}user@@host|sudo,,/path/to/file}}.
@xref{Ad-hoc multi-hops}.
The @option{su} method and other shell-based methods conflict with
non-standard @command{su} implementations popular among Android users
and the restricted command-line utilities distributed with that system.
The @option{androidsu} method enables accessing files through
@command{su} on such systems, but multi-hops are not supported.
@anchor{Quick Start Guide sudoedit method}
@section Using @command{sudoedit}
@ -1059,6 +1066,20 @@ session.
These methods support the @samp{-P} argument.
@item @option{dockercp}
@item @option{podmancp}
@cindex method @option{dockercp}
@cindex @option{dockercp} method
@cindex method @option{podmancp}
@cindex @option{podmancp} method
These methods are similar to @option{docker} or @option{podman}, but
they use the command @command{docker cp} or @command{podman cp} for
transferring large files.
These copy commands do not support file globs, and they ignore a user
name.
@item @option{fcp}
@cindex method @option{fcp}
@cindex @option{fcp} method
@ -5238,9 +5259,14 @@ Does @value{tramp} support @acronym{SSH} security keys?
Yes. @command{OpenSSH} has added support for @acronym{FIDO} hardware
devices via special key types @option{*-sk}. @value{tramp} supports
the additional handshaking messages for them. This requires at least
@command{OpenSSH} 8.2, and a @acronym{FIDO} @acronym{U2F} compatible
security key, like yubikey, solokey, nitrokey, or titankey.
@command{OpenSSH} 8.2, and a @acronym{FIDO} @acronym{U2F} or
@acronym{FIDO2} compatible security key, like yubikey, solokey,
nitrokey, or titankey.
@c @uref{https://docs.fedoraproject.org/en-US/quick-docs/using-yubikeys/}
@strong{Note} that there are reports on problems of handling FIDO2
(residential) keys by @command{ssh-agent}. As workaround, you might
disable @command{ssh-agent} for such keys.
@item
@value{tramp} does not connect to Samba or MS Windows hosts running

211
doc/translations/README Normal file
View file

@ -0,0 +1,211 @@
* Translating the Emacs manuals
** Copyright assignment
People who contribute translated documents should provide a copyright
assignment to the Free Software Foundation. See the "Copyright
Assignment" section in the Emacs manual.
** Translated documents license
The translated documents are distributed under the same license as the
original documents: the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation.
See https://www.gnu.org/licenses/fdl-1.3.html for more information.
If you have any questions regarding the use of the FDL license in your
translation work that do not appear in the FAQ, feel free to contact the
GNU project.
See https://www.gnu.org/contact/ for more information.
** Location of the translated files
*** Texinfo source files
The source files of the translated manuals are located in the
doc/translations directory, under the sub-directory corresponding to the
translated language.
E.g., French manual sources are found under doc/translations/fr.
The structure of each language's folder should match that of the English
manuals (i.e. include misc, man, lispref, lispintro, emacs).
*** Built files
Translated deliverables in Info format are built at release time and are
made available for local installation.
** Source files format
The manuals and their translations are written in the Texinfo format
(with the exception of the org-mode manual, which is written in Org, and
illustrations for the Introduction to Emacs Lisp Programming, which are
EPS files).
See https://www.gnu.org/software/Texinfo/ for more information.
You must install the Texinfo package in order to verify the translated
files, and refer to the Texinfo manual for information on the various
Texinfo features.
Emacs has a Texinfo mode that highlights the parts of the Texinfo code
to be translated for easy reference.
*** Texinfo specific issues
Until the Emacs/Texinfo projects provide better solutions, here are a
few rules to follow:
- Under each @node, add an @anchor that has the same content as the
original English @node.
- Translate the @node content but leave the @anchor in English.
- Most Emacs manuals are set to include the docstyle.Texi file. This
file adds the "@documentencoding UTF-8" directive to the targeted
manual. There is no need to add this directive in a manual that
includes docstyle.texi.
- Add a @documentlanguage directive that includes your language.
E.g., @documentlanguage zh
This directive currently has little effect but will be useful in the
future.
- The @author directive can be used for the translator's name.
E.g., @author traduit en français par Achile Talon
** Fixing the original document
During the course of the translation, you might encounter passages in
the original document that need to be updated or otherwise corrected, or
even run into a bug in Emacs. If you cannot immediately correct the
problem, please file a bug report promptly.
See the 'Bugs' section in the Emacs manual.
** Sending your contributions
Send your contributions (files or revisions) for review to the Emacs
development list at emacs-devel@gnu.org. Subscribing to the list is not
obligatory.
Always send contributions in the format of the original document. Most
of the content in the Emacs manuals is in Texinfo format, so please do
not send contributions in derivative formats (e.g. info, html, docbook,
plain text, etc.)
Before sending files for review, please ensure that they have been
thoroughly checked for spelling/grammar/typography by at least using the
tools provided by Emacs.
Please also make sure that the Texinfo files build properly on your
system.
Send your contributions as patches (git diff -p --stat), and prefer the
git format-patch form, since that format allows for easier review and
easier installation of the changes by the persons with write access to
the repository.
The Emacs project has a lot of coding, documentation and commenting
conventions. Sending such patches allows the project managers to make
sure that the contributions comply with the various conventions.
** Discussing translation issues
Translation-related discussions are welcome on the emacs development
list. Discussions specific to your language do not have to be in
English.
** Translation teams
The number of words in the Emacs manuals is over 2,000,000 words and
growing. While one individual could theoretically translate all the
files, it is more practical to work in language teams.
If you have a small group of translators willing to help, please make
sure that the files are properly reviewed before sending them to the
Emacs development list (see above).
Please refer to the translation-related documents maintained by the GNU
Project, and contact your language translation team to learn the
practices they have developed over the years.
See https://www.gnu.org/server/standards/README.translations.html for
more information.
** Translation processes
Emacs does not yet provide tools that significantly help the translation
process. A few useful functions would be:
- automatic lookup of a list of glossary items when starting to work on
a translation "unit" (paragraph or otherwise); such glossary terms
should be easily insertable at point,
- automatic lookup of past translations to check for similarity and
improve homogeneity over the whole document set; such past translation
matches should be easily insertable at point, etc.
*** Using the PO format as an intermediate translation format
Although the PO format has not been developed with documentation in
mind, it is well-known among free software translation teams, and you
can easily use the po4a utility to convert Texinfo to PO for work in
translation tools that support the PO format.
See https://po4a.org for more information.
However, regardless of the intermediate file format that you might use,
you should only send files in the original format (Texinfo, org-mode,
eps) for review and installation.
*** Free tools that you can use in your processes
A number of free software tools are available outside the Emacs project,
to help translators (both amateur and professional) in the translation
process.
If they have any features that you think Emacs should implement, you are
welcome to provide patches to the Emacs project.
Such tools include:
- the GNOME Translation Editor, https://wiki.gnome.org/Apps/Gtranslator/
- KDE's Lokalize, https://apps.kde.org/lokalize/
- OmegaT, https://omegat.org
- the Okapi Framework, https://www.okapiframework.org
- pootle, https://pootle.translatehouse.org
etc.
* Licence of this document
Copyright (C) 2024 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty provided the copyright notice
and this notice are preserved. This file is offered as-is, without any
warranty.
Local Variables:
mode: outline
paragraph-separate: "[ ]*$"
coding: utf-8
End:

View file

@ -334,6 +334,11 @@ has changed in some way. At present, ERC does not perform this step
automatically on your behalf, even if a change was made in a
'Custom-mode' buffer or via 'setopt'.
** New broadcast-oriented slash commands /AME, /GME, and /GMSG.
Also available as the library functions 'erc-cmd-AME', 'erc-cmd-GME',
and 'erc-cmd-GMSG', these new slash commands can prove handy in test
environments.
** Miscellaneous UX changes.
Some minor quality-of-life niceties have finally made their way to
ERC. For example, fool visibility has become togglable with the new
@ -435,9 +440,12 @@ contains unique closures and thus no longer proves effective for
traversing inserted messages. For now, ERC only provides an internal
means of visiting messages, but a public interface is forthcoming.
Also affecting the 'stamp' module is the deprecation of the function
'erc-insert-aligned' and its removal from client code. Additionally,
the module now merges its 'invisible' property with existing ones and
includes all white space around stamps when doing so.
'erc-insert-aligned' and its removal from the default client's code.
In the same library, the function 'erc-munge-invisibility-spec' has
been renamed to 'erc-stamp--manage-local-options-state' to better
reflect its purpose. Additionally, the module now merges its
'invisible' property with existing ones and includes all white space
around stamps when doing so.
This "propertizing" of surrounding white space extends to all
'stamp'-applied properties, like 'field', in all intervening space
@ -499,6 +507,16 @@ encouraged to keep a module's name aligned with its group's as well as
the provided feature of its containing library, if only for the usual
reasons of namespace hygiene and discoverability.
*** The function 'erc-open' no longer uses the 'TGT-LIST' parameter.
ERC has always used the parameter to initialize the local variable
'erc-default-recipients', which stores a list of routing targets with
the topmost considered "active." However, since at least ERC 5.1, a
buffer and its active target effectively mate for life, making
'TGT-LIST', in practice, a read-only list of a single target. And
because that target must also appear as the 'CHANNEL' parameter,
'TGT-LIST' mainly serves to reinforce 'erc-open's reputation of being
unruly.
*** ERC supports arbitrary CHANTYPES.
Specifically, channels can be prefixed with any predesignated
character, mainly to afford more flexibility to specialty services,
@ -681,8 +699,6 @@ by toggling a provided compatibility switch. See source code around
the function 'erc-send-action' for details.
*** Miscellaneous changes
Two helper macros from GNU ELPA's Compat library are now available to
third-party modules as 'erc-compat-call' and 'erc-compat-function'.
In 'erc-button-alist', 'Info-goto-node' has been supplanted by plain
old 'info', and the "<URL:...>" entry has been removed because it was
more or less redundant. In all ERC buffers, the "<TAB>" key is now
@ -1364,7 +1380,7 @@ reconnection attempts that ERC will make per server.
in seconds, that ERC will wait between successive reconnect attempts.
*** erc-server-send-ping-timeout: Determines when to consider a connection
stalled and restart it. The default is after 120 seconds.
stalled and restart it. The default is after 120 seconds.
*** erc-system-name: Determines the system name to use when logging in.
The default is to figure this out by calling `system-name'.
@ -2325,7 +2341,7 @@ in XEmacs.
Please use M-x customize-variable RET erc-modules RET to change the
default if it does not suite your needs.
** THe symbol used in `erc-nickserv-passwords' for debian.org IRC servers
** The symbol used in `erc-nickserv-passwords' for debian.org IRC servers
(formerly called OpenProjects, now FreeNode) has changed from
openprojects to freenode. You may need to update your configuration
for a successful automatic nickserv identification.

226
etc/NEWS
View file

@ -76,7 +76,7 @@ see the variable 'url-request-extra-headers'.
+++
** 'completion-auto-help' now affects 'icomplete-in-buffer'.
Previously, completion-auto-help mostly affected only minibuffer
Previously, 'completion-auto-help' mostly affected only minibuffer
completion. Now, if 'completion-auto-help' has the value 'lazy', then
Icomplete's in-buffer display of possible completions will only appear
after the 'completion-at-point' command has been invoked twice, and if
@ -85,12 +85,12 @@ completely suppressed. Thus, if you use 'icomplete-in-buffer', ensure
'completion-auto-help' is not customized to 'lazy' or nil.
+++
** The *Completions* buffer now always accompanies 'icomplete-in-buffer'.
Previously, it was not consistent when the *Completions* buffer would
appear when using 'icomplete-in-buffer'. Now the *Completions* buffer
** The "*Completions*" buffer now always accompanies 'icomplete-in-buffer'.
Previously, it was not consistent whether the "*Completions*" buffer would
appear when using 'icomplete-in-buffer'. Now the "*Completions*" buffer
and Icomplete's in-buffer display of possible completions always
appear together. If you would prefer to see only Icomplete's
in-buffer display, and not the *Completions* buffer, you can add this
in-buffer display, and not the "*Completions*" buffer, you can add this
to your init:
(advice-add 'completion-at-point :after #'minibuffer-hide-completions)
@ -130,6 +130,17 @@ the signature) the automatically inferred function type as well.
This user option controls outline visibility in the output buffer of
'describe-bindings' when 'describe-bindings-outline' is non-nil.
---
*** 'C-h m' ('describe-mode') uses outlining by default.
Set 'describe-mode-outline' to nil to get back the old behavior.
** Outline Mode
+++
*** 'outline-minor-mode' is supported in tree-sitter major modes.
It can be used in all tree-sitter major modes that set either the
variable 'treesit-simple-imenu-settings' or 'treesit-outline-predicate'.
** X selection requests are now handled much faster and asynchronously.
This means it should be less necessary to disable the likes of
'select-active-regions' when Emacs is running over a slow network
@ -258,7 +269,7 @@ right-aligned to is controlled by the new user option
** Windows
*** New action alist entry 'post-command-select-window' for display-buffer.
*** New action alist entry 'post-command-select-window' for 'display-buffer'.
It specifies whether the window of the displayed buffer should be
selected or deselected at the end of executing the current command.
@ -305,8 +316,17 @@ between the auto save file and the current file.
---
** 'ffap-lax-url' now defaults to nil.
Previously, it was set to 'ffap-lax-url' to t but this broke remote file
name detection.
Previously, it was set to t but this broke remote file name detection.
+++
** Multi-character key echo now ends with a suggestion to use Help.
Customize 'echo-keystrokes-help' to nil to prevent that.
+++
** 'read-passwd' can toggle the visibility of passwords.
Use 'TAB' in the minibuffer to show or hide the password. Likewise,
there is an icon on the mode-line, which toggles the visibility of the
password when clicking with 'mouse-1'.
* Editing Changes in Emacs 30.1
@ -318,7 +338,9 @@ will receive a 'wrap-prefix' automatically computed from the line's
surrounding context, such that continuation lines are indented on
display as if they were filled with 'M-q' or similar. Unlike 'M-q',
the indentation only happens on display, and doesn't change the buffer
text in any way.
text in any way. The global minor mode
'global-visual-wrap-prefix-mode' enables this minor mode in all
buffers.
(This minor mode is the 'adaptive-wrap' ELPA package renamed and
lightly edited for inclusion in Emacs.)
@ -418,6 +440,11 @@ respectively, in addition to the existing translations 'C-x 8 / e' and
* Changes in Specialized Modes and Packages in Emacs 30.1
---
** Titdic-cnv
Most of the variables and functions in the file have been renamed to
make sure they all use a 'tit-' namespace prefix.
---
** Trace
In batch mode, tracing now sends the trace to stdout.
@ -431,7 +458,7 @@ configurations such as X11 when the X server does not support at least
version 2.1 of the X Input Extension, and 'xterm-mouse-mode'.
** 'xterm-mouse-mode'
This mode now emits `wheel-up/down/right/left' events instead of
This mode now emits 'wheel-up/down/right/left' events instead of
'mouse-4/5/6/7' events for the mouse wheel.
It uses the 'mouse-wheel-up/down/left/right-event'
variables to decide which button maps to which wheel event (if any).
@ -440,11 +467,14 @@ variables to decide which button maps to which wheel event (if any).
---
*** New user option 'Info-url-alist'.
This user option associates manual-names with URLs. It affects the
This user option associates manual names with URLs. It affects the
'Info-goto-node-web' command. By default, associations for all
Emacs-included manuals are set. Further associations can be added for
arbitrary Info manuals.
*** Emacs can now display Info manuals compressed with 'lzip'.
This requires the 'lzip' program to be installed on your system.
+++
** New command 'lldb'.
Run the LLDB debugger, analogous to the 'gud-gdb' command.
@ -572,6 +602,14 @@ It allows tweaking the thresholds for rename and copy detection.
** Diff mode
---
*** New user option 'diff-refine-nonmodified'.
When this is non-nil, 'diff-refine' will highlight lines that were added
or removed in their entirety (as opposed to modified lines, where some
parts of the line were modified), using the same faces as for
highlighting the words added and removed within modified lines. The
default value is nil.
+++
*** 'diff-ignore-whitespace-hunk' can now be applied to all hunks.
When called with a non-nil prefix argument,
@ -689,7 +727,7 @@ arguments of the form 'VAR=VALUE', 'env' will first set 'VAR' to
Now, you can pass an argument like "u+w,o-r" to Eshell's 'umask'
command, which will give write permission for owners of newly-created
files and deny read permission for users who are not members of the
file's group. See the Info node '(coreutils)File permissions' for
file's group. See the Info node "(coreutils) File permissions" for
more information on this notation.
+++
@ -808,14 +846,14 @@ in the minibuffer history, with more recent candidates appearing first.
*** 'completion-category-overrides' supports more metadata.
The new supported completion properties are 'cycle-sort-function',
'display-sort-function', 'annotation-function', 'affixation-function',
'group-function'. You can now customize them for any category in
and 'group-function'. You can now customize them for any category in
'completion-category-overrides' that will override the properties
defined in completion metadata.
+++
*** 'completion-extra-properties' supports more metadata.
The new supported completion properties are 'category',
'group-function', 'display-sort-function', 'cycle-sort-function'.
'group-function', 'display-sort-function', and 'cycle-sort-function'.
** Pcomplete
@ -864,6 +902,16 @@ mode line. 'header' will display in the header line;
** Tramp
+++
*** New connection method "androidsu".
This provides access to system files with elevated privileges granted by
the idiosyncratic 'su' implementations and system utilities customary on
Android.
+++
*** New connection methods "dockercp" and "podmancp".
These are the external methods counterparts of "docker" and "podman".
+++
*** New connection methods "toolbox" and "flatpak".
They allow accessing system containers provided by Toolbox or
@ -1057,8 +1105,8 @@ which calls 'xref-find-definitions'. If the previous one worked
better for you, use 'define-key' in your init script to bind
'js-find-symbol' to that combination again.
** Json mode
`js-json-mode` does not derive from `js-mode` any more so as not
** Json mode.
'js-json-mode' does not derive from 'js-mode' any more so as not
to confuse tools like Eglot or YASnippet into thinking that those
buffers contain Javascript code.
@ -1097,6 +1145,12 @@ The gmane.org website is, sadly, down since a number of years with no
prospect of it coming back. Therefore, it is no longer valid to set
the user option 'nnweb-type' to 'gmane'.
---
*** New user option 'gnus-mode-line-logo'.
This allows the user to either disable the display of any logo or
specify which logo will be displayed as part of the
buffer-identification in the mode-line of Gnus buffers.
** Rmail
---
@ -1168,6 +1222,11 @@ Previously, the '@' character, which normally has 'symbol' syntax,
would combine with a following Lisp symbol and interfere with symbol
searching.
---
*** 'emacs-lisp-docstring-fill-column' now defaults to 72.
It was previously 65. The new default formats documentation strings to
fit on fewer lines without negatively impacting readability.
** CPerl mode
---
@ -1188,8 +1247,8 @@ comment, like Perl mode does.
*** New command 'cperl-file-style'.
This command sets the indentation style for the current buffer. To
change the default style, either use the option with the same name or
use the command cperl-set-style.
change the default style, either use the user option with the same name
or use the command 'cperl-set-style'.
*** Commands using the Perl info page are obsolete.
The Perl documentation in info format is no longer distributed with
@ -1297,21 +1356,51 @@ will return the URL for that bug.
This allows for rcirc logs to use a custom timestamp format, than the
chat buffers use by default.
---
*** New command 'Buffer-menu-toggle-internal'.
This command toggles the display of internal buffers in Buffer Menu mode;
that is, buffers not visiting a file and whose names start with a space.
Previously, such buffers were never shown. This command is bound to 'I'
in Buffer Menu mode.
** Customize
+++
*** New command 'customize-dirlocals'.
This command pops up a buffer to edit the settings in ".dir-locals.el".
---
** New command 'customize-toggle-option'.
This command can toggle boolean options for the duration of a session.
** Calc
+++
*** Calc parses fractions written using U+2044 FRACTION SLASH
Fractions of the form 123456 are handled as if written 123:456. Note
in particular the difference in behavior from U+2215 DIVISION SLASH
*** Calc parses fractions written using U+2044 FRACTION SLASH.
Fractions of the form "123456" are handled as if written "123:456".
Note in particular the difference in behavior from U+2215 DIVISION SLASH
and U+002F SOLIDUS, which result in division rather than a rational
fraction. You may also be interested to know that precomposed
fraction characters, such as ½ (U+00BD VULGAR FRACTION ONE HALF), are
also recognized as rational fractions. They have been since 2004, but
it looks like it was never mentioned in the NEWS, or even the manual.
fraction. You may also be interested to know that precomposed fraction
characters, such as ½ (U+00BD VULGAR FRACTION ONE HALF), are also
recognized as rational fractions. They have been since 2004, but it
looks like it was never mentioned in the NEWS, or even the manual.
** IELM
---
*** IELM now remembers input history between sessions.
The new user option 'ielm-history-file-name' is the name of the file
where IELM input history will be saved. Customize it to nil to revert
to the old behavior of not remembering input history between sessions.
** EasyPG
+++
*** New user option 'epa-keys-select-method'.
This allows the user to customize the key selection method, which can be
either by using a pop-up buffer or from the minibuffer. The pop-up
buffer method is the default, which preserves previous behavior.
* New Modes and Packages in Emacs 30.1
@ -1367,13 +1456,30 @@ This minor mode generates the tags table automatically based on the
current project configuration, and later updates it as you edit the
files and save the changes.
+++
** New package Compat.
Emacs now comes with a stub implementation of the
forwards-compatibility Compat package from GNU ELPA. This allows
built-in packages to use the library more effectively, and helps
preventing the installation of Compat if unnecessary.
* Incompatible Lisp Changes in Emacs 30.1
---
** Old derived.el functions removed.
The following functions have been deleted because they were only used
by code compiled with Emacs<21:
'derived-mode-init-mode-variables', 'derived-mode-merge-abbrev-tables',
'derived-mode-merge-keymaps', 'derived-mode-merge-syntax-tables',
'derived-mode-run-hooks', 'derived-mode-set-abbrev-table',
'derived-mode-set-keymap', 'derived-mode-set-syntax-table',
'derived-mode-setup-function-name'.
+++
** 'M-TAB' now invokes 'completion-at-point' also in Text mode.
By default, Text mode no longer binds 'M-TAB' to
'ispell-complete-word'. Instead this mode arranges for
'ispell-complete-word'. Instead, this mode arranges for
'completion-at-point', globally bound to 'M-TAB', to perform word
completion as well. You can have Text mode bind 'M-TAB' to
'ispell-complete-word' as it did in previous Emacs versions, or
@ -1481,8 +1587,12 @@ values.
* Lisp Changes in Emacs 30.1
+++
** 'define-advice' now sets the new advice's 'name' property to NAME
Named advice defined with 'define-advice' can now be removed with
** Pcase's functions (in 'pred' and 'app') can specify the argument position.
For example, instead of '(pred (< 5))' you can write '(pred (> _ 5))'.
+++
** 'define-advice' now sets the new advice's 'name' property to NAME.
Named advices defined with 'define-advice' can now be removed with
'(advice-remove SYMBOL NAME)' in addition to '(advice-remove SYMBOL
SYMBOL@NAME)'.
@ -1499,10 +1609,10 @@ It puts a limit to the amount by which Emacs can temporarily increase
+++
** New special form 'handler-bind'.
Provides a functionality similar to `condition-case` except it runs the
handler code without unwinding the stack, such that we can record the
backtrace and other dynamic state at the point of the error.
See the Info node "(elisp) Handling Errors".
It provides a functionality similar to 'condition-case' except it runs
the handler code without unwinding the stack, such that we can record
the backtrace and other dynamic state at the point of the error. See
the Info node "(elisp) Handling Errors".
+++
** New 'pop-up-frames' action alist entry for 'display-buffer'.
@ -1513,6 +1623,11 @@ precedence over the variable when present.
Mostly used internally to do a kind of topological sort of
inheritance hierarchies.
** New function 'sort-on'.
This function implements the Schwartzian transform, and is appropriate
for sorting lists when the computation of the sort key of a list
element can be expensive.
** New API for 'derived-mode-p' and control of the graph of major modes.
*** 'derived-mode-p' now takes the list of modes as a single argument.
@ -1826,6 +1941,21 @@ name 'ignored-return-value'.
The warning will only be issued for calls to functions declared
'important-return-value' or 'side-effect-free' (but not 'error-free').
---
*** Warn about docstrings that contain control characters.
The compiler now warns about docstrings with control characters other
than newline and tab. This is often a result of improper escaping.
Example:
(defun my-fun ()
"Uses c:\remote\dir\files and the key \C-x."
...)
where the docstring contains four control characters 'CR', 'DEL', 'FF'
and 'C-x'.
The warning name is 'docstrings-control-chars'.
---
*** The warning about wide docstrings can now be disabled separately.
Its warning name is 'docstrings-wide'.
@ -1836,6 +1966,13 @@ The declaration '(important-return-value t)' sets the
'important-return-value' property which indicates that the function
return value should probably not be thrown away implicitly.
** Bytecode is now always loaded eagerly.
Bytecode compiled with older Emacs versions for lazy loading using
'byte-compile-dynamic' is now loaded all at once.
As a consequence, 'fetch-bytecode' has no use, does nothing, and is
now obsolete. The variable 'byte-compile-dynamic' has no effect any
more; compilation will always yield bytecode for eager loading.
+++
** New functions 'file-user-uid' and 'file-group-gid'.
These functions are like 'user-uid' and 'group-gid', respectively, but
@ -1891,6 +2028,31 @@ The 'test' parameter is omitted if it is 'eql' (the default), as is
'data' if empty. 'rehash-size', 'rehash-threshold' and 'size' are
always omitted, and ignored if present when the object is read back in.
** Obarrays
+++
*** New obarray type.
Obarrays are now represented by an opaque type instead of using vectors.
They are created by 'obarray-make' and manage their internal storage
automatically, which means that the size parameter to 'obarray-make' can
safely be omitted. That is, they do not become slower as they fill up.
The old vector representation is still accepted by functions operating
on obarrays, but 'obarrayp' only returns t for obarray objects.
'type-of' now returns 'obarray' for obarray objects.
Old code which (incorrectly) created "obarrays" as Lisp vectors filled
with something other than 0, as in '(make-vector N nil)', will no longer
work, and should be rewritten to use 'obarray-make'. Alternatively, you
can fill the vector with 0.
+++
*** New function 'obarray-clear' removes all symbols from an obarray.
---
*** 'obarray-size' and 'obarray-default-size' are now obsolete.
They pertained to the internal storage size which is now irrelevant.
+++
** 'treesit-install-language-grammar' can handle local directory instead of URL.
It is now possible to pass a directory of a local repository as URL

View file

@ -1158,6 +1158,11 @@ few or no entries have changed.
* New Modes and Packages in Emacs 25.1
** New preloaded package 'obarray'
Provides obarray operations under the 'obarray-' prefix, such as
'obarray-make', 'obarrayp', and 'obarray-map'.
** pinentry.el allows GnuPG passphrase to be prompted through the
minibuffer instead of a graphical dialog, depending on whether the gpg
command is called from Emacs (i.e., INSIDE_EMACS environment variable

View file

@ -432,7 +432,7 @@ than the corresponding .el file.
Alternatively, if you set the option 'load-prefer-newer' non-nil,
Emacs will load whichever version of a file is the newest.
*** Watch out for the EMACSLOADPATH environment variable
*** Watch out for the EMACSLOADPATH environment variable.
EMACSLOADPATH overrides which directories the function "load" will search.
@ -441,7 +441,7 @@ environment.
** Keyboard problems
*** PGTK build of Emacs running on Wayland doesn't recognize Hyper modifier
*** PGTK build of Emacs running on Wayland doesn't recognize Hyper modifier.
If you arrange for the Wayland compositor to send the Hyper key
modifier (e.g., via XKB customizations), the Hyper modifier will still
@ -452,6 +452,17 @@ Since GDK 3.x is no longer developed, this bug in GDK will probably
never be solved. And the Emacs PGTK build cannot yet support GTK4,
where this problem is reportedly solved.
*** Emacs built with GTK lags in its response to keyboard input.
This can happen when input methods are used. It happens because Emacs
behaves in an unconventional way with respect to GTK input methods: it
registers to receive keyboard input as unprocessed key events with
metadata (as opposed to receiving them as text strings). Most GTK
programs use the latter approach, so some modern input methods have
bugs and misbehave when faced with the way Emacs does it.
A workaround is to set GTK_IM_MODULE=none in the environment, or maybe
find a different input method without these problems.
*** Unable to enter the M-| key on some German keyboards.
Some users have reported that M-| suffers from "keyboard ghosting".
This can't be fixed by Emacs, as the keypress never gets passed to it
@ -476,6 +487,29 @@ You are probably using a shell that doesn't support job control, even
though the system itself is capable of it. Either use a different shell,
or set the variable 'cannot-suspend' to a non-nil value.
*** Emacs running on WSL receives stray characters as input.
For example, you could see Emacs inserting 'z' characters even though
nothing is typed on the keyboard, and even if you unplug the keyboard.
The reason is a bug in the WSL X server's handling of key-press and
key-repeat events. A workaround is to use the Cygwin or native
MS-Windows build of Emacs instead.
*** On MS-Windows, the Windows key gets "stuck".
When this problem happens, Windows behaves as if the Windows key were
permanently pressed down. This could be a side effect of Emacs on
MS-Windows hooking keyboard input on a low level, in order to support
registering the Windows keys as hot keys. If that hook takes too much
time for some reason, Windows can decide to remove the hook, which
then has this effect.
This is arguably a bug in Emacs, for which we don't yet have a
solution. To work around, set the 'LowLevelHooksTimeout' value in the
registry key "HKEY_CURRENT_USER\Control Panel\Desktop" to a number
higher than 200 msec; the maximum allowed value is 1000 msec (create
the value if it doesn't exist under that key).
** Mailers and other helper programs
*** movemail compiled with POP support can't connect to the POP server.
@ -545,15 +579,6 @@ As a workaround, input the passphrase with a GUI-capable pinentry
program like 'pinentry-gnome' or 'pinentry-qt5'. Alternatively, you
can use the 'pinentry' package from Emacs 25.
*** Emacs running on WSL receives stray characters as input.
For example, you could see Emacs inserting 'z' characters even though
nothing is typed on the keyboard, and even if you unplug the keyboard.
The reason is a bug in the WSL X server's handling of key-press and
key-repeat events. A workaround is to use the Cygwin or native
MS-Windows build of Emacs instead.
** Problems with hostname resolution
*** Emacs does not know your host's fully-qualified domain name.

View file

@ -56,6 +56,7 @@ class Lisp_Object:
"PVEC_BOOL_VECTOR": "struct Lisp_Bool_Vector",
"PVEC_BUFFER": "struct buffer",
"PVEC_HASH_TABLE": "struct Lisp_Hash_Table",
"PVEC_OBARRAY": "struct Lisp_Obarray",
"PVEC_TERMINAL": "struct terminal",
"PVEC_WINDOW_CONFIGURATION": "struct save_window_data",
"PVEC_SUBR": "struct Lisp_Subr",

View file

@ -125,7 +125,7 @@ For more information see the adwaita-icon-theme repository at:
https://gitlab.gnome.org/GNOME/adwaita-icon-theme
Emacs images and their source in the Adwaita/scalable directory:
Emacs images and their source in the Adwaita/symbolic directory:
checked.svg ui/checkbox-checked-symbolic.svg
unchecked.svg ui/checkbox-symbolic.svg
@ -137,3 +137,8 @@ Emacs images and their source in the Adwaita/scalable directory:
left.svg ui/pan-start-symbolic.svg
right.svg ui/pan-end-symbolic.svg
up.svg ui/pan-up-symbolic.svg
conceal.svg actions/view-conceal-symbolic.svg
reveal.svg actions/view-reveal-symbolic.svg
conceal.pbm and reveal.pbm are generated from the respective *.svg
files, using the ImageMagick converter tool.

BIN
etc/images/conceal.pbm Normal file

Binary file not shown.

4
etc/images/conceal.svg Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
<path d="m 1.53125 0.46875 l -1.0625 1.0625 l 14 14 l 1.0625 -1.0625 l -2.382812 -2.382812 c 1.265624 -1.0625 2.171874 -2.496094 2.589843 -4.097657 c -0.914062 -3.523437 -4.097656 -5.984375 -7.738281 -5.988281 c -1.367188 0.011719 -2.707031 0.371094 -3.894531 1.042969 z m 6.46875 3.53125 c 2.210938 0 4 1.789062 4 4 c -0.003906 0.800781 -0.246094 1.578125 -0.699219 2.238281 l -1.46875 -1.46875 c 0.105469 -0.242187 0.164063 -0.503906 0.167969 -0.769531 c 0 -1.105469 -0.894531 -2 -2 -2 c -0.265625 0.003906 -0.527344 0.0625 -0.769531 0.167969 l -1.46875 -1.46875 c 0.660156 -0.453125 1.4375 -0.695313 2.238281 -0.699219 z m -6.144531 0.917969 c -0.753907 0.898437 -1.296875 1.957031 -1.59375 3.09375 c 0.914062 3.523437 4.097656 5.984375 7.738281 5.988281 c 0.855469 -0.007812 1.703125 -0.152344 2.511719 -0.425781 l -1.667969 -1.667969 c -0.277344 0.058594 -0.5625 0.089844 -0.84375 0.09375 c -2.210938 0 -4 -1.789062 -4 -4 c 0.003906 -0.28125 0.035156 -0.566406 0.09375 -0.84375 z m 0 0" fill="#2e3436"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
etc/images/reveal.pbm Normal file

Binary file not shown.

4
etc/images/reveal.svg Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
<path d="m 8 2 c -3.648438 0.003906 -6.832031 2.476562 -7.738281 6.007812 c 0.914062 3.527344 4.097656 5.988282 7.738281 5.992188 c 3.648438 -0.003906 6.832031 -2.476562 7.738281 -6.011719 c -0.914062 -3.523437 -4.097656 -5.984375 -7.738281 -5.988281 z m 0 2 c 2.210938 0 4 1.789062 4 4 s -1.789062 4 -4 4 s -4 -1.789062 -4 -4 s 1.789062 -4 4 -4 z m 0 2 c -1.105469 0 -2 0.894531 -2 2 s 0.894531 2 2 2 s 2 -0.894531 2 -2 s -0.894531 -2 -2 -2 z m 0 0" fill="#2e3436"/>
</svg>

After

Width:  |  Height:  |  Size: 606 B

View file

@ -104,13 +104,14 @@ if [ -z "$devices" ]; then
exit 1
fi
if [ -z $device ]; then
device=$devices
if [ `wc -w <<< "$devices"` -gt 1 ] && [ -z $device ]; then
echo "Multiple devices are available. Please specify one with"
echo "the option --device and try again."
exit 1
fi
if [ `wc -w <<< "$devices"` -gt 1 ] && [ -z device ]; then
echo "Multiple devices are available. Please pick one using"
echo "--device and try again."
if [ -z $device ]; then
device=$devices
fi
echo "Looking for $package on device $device"
@ -189,6 +190,8 @@ if [ "$attach_existing" != "yes" ]; then
package_pids=`awk -f tmp.awk <<< $package_pids`
fi
rm tmp.awk
pid=$package_pids
num_pids=`wc -w <<< "$package_pids"`

View file

@ -97,7 +97,7 @@ public class EmacsActivity extends Activity
}
public static void
invalidateFocus ()
invalidateFocus (int whence)
{
EmacsWindow oldFocus;
@ -144,7 +144,7 @@ public class EmacsActivity extends Activity
layout.removeView (window.view);
window = null;
invalidateFocus ();
invalidateFocus (0);
}
}
@ -172,8 +172,17 @@ public class EmacsActivity extends Activity
if (isPaused)
window.noticeIconified ();
/* Invalidate the focus. */
invalidateFocus ();
/* Invalidate the focus. Since attachWindow may be called from
either the main or the UI thread, post this to the UI thread. */
runOnUiThread (new Runnable () {
@Override
public void
run ()
{
invalidateFocus (1);
}
});
}
@Override
@ -238,6 +247,10 @@ public class EmacsActivity extends Activity
}
super.onCreate (savedInstanceState);
/* Call `onWindowFocusChanged' to read the focus state, which fails
to be called after an activity is recreated. */
onWindowFocusChanged (false);
}
@Override
@ -261,7 +274,7 @@ public class EmacsActivity extends Activity
isMultitask = this instanceof EmacsMultitaskActivity;
manager.removeWindowConsumer (this, isMultitask || isFinishing ());
focusedActivities.remove (this);
invalidateFocus ();
invalidateFocus (2);
/* Remove this activity from the static field, lest it leak. */
if (lastFocusedActivity == this)
@ -274,9 +287,16 @@ public class EmacsActivity extends Activity
public final void
onWindowFocusChanged (boolean isFocused)
{
if (isFocused && !focusedActivities.contains (this))
/* At times and on certain versions of Android ISFOCUSED does not
reflect whether the window actually holds focus, so replace it
with the value of `hasWindowFocus'. */
isFocused = hasWindowFocus ();
if (isFocused)
{
focusedActivities.add (this);
if (!focusedActivities.contains (this))
focusedActivities.add (this);
lastFocusedActivity = this;
/* Update the window insets as the focus change may have
@ -291,7 +311,7 @@ public class EmacsActivity extends Activity
else
focusedActivities.remove (this);
invalidateFocus ();
invalidateFocus (3);
}
@Override

View file

@ -361,8 +361,23 @@ private static final class Item implements MenuItem.OnMenuItemClickListener
public Boolean
call ()
{
boolean rc;
lastMenuEventSerial = serial;
return display1 (window, xPosition, yPosition);
rc = display1 (window, xPosition, yPosition);
/* Android 3.0 to Android 7.0 perform duplicate calls to
onContextMenuClosed the second time a context menu is
dismissed. Since the second call after such a dismissal is
otherwise liable to prematurely cancel any context menu
displayed immediately afterwards, ignore calls received
within 150 milliseconds of this menu's being displayed. */
if (rc && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB
&& Build.VERSION.SDK_INT < Build.VERSION_CODES.N)
wasSubmenuSelected = System.currentTimeMillis () - 150;
return rc;
}
});

View file

@ -60,6 +60,7 @@
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.hardware.input.InputManager;
@ -135,6 +136,10 @@ public final class EmacsService extends Service
been created yet. */
private EmacsSafThread storageThread;
/* The Thread object representing the Android user interface
thread. */
private Thread mainThread;
static
{
servicingQuery = new AtomicInteger ();
@ -235,6 +240,7 @@ public final class EmacsService extends Service
/ metrics.density)
* pixelDensityX);
resolver = getContentResolver ();
mainThread = Thread.currentThread ();
/* If the density used to compute the text size is lesser than
160, there's likely a bug with display density computation.
@ -383,7 +389,13 @@ invocation of app_process (through android-emacs) can
{
if (DEBUG_THREADS)
{
if (Thread.currentThread () instanceof EmacsThread)
/* When SERVICE is NULL, Emacs is being executed non-interactively. */
if (SERVICE == null
/* It was previously assumed that only instances of
`EmacsThread' were valid for graphics calls, but this is
no longer true now that Lisp threads can be attached to
the JVM. */
|| (Thread.currentThread () != SERVICE.mainThread))
return;
throw new RuntimeException ("Emacs thread function"
@ -437,21 +449,6 @@ invocation of app_process (through android-emacs) can
EmacsDrawPoint.perform (drawable, gc, x, y);
}
public void
clearWindow (EmacsWindow window)
{
checkEmacsThread ();
window.clearWindow ();
}
public void
clearArea (EmacsWindow window, int x, int y, int width,
int height)
{
checkEmacsThread ();
window.clearArea (x, y, width, height);
}
@SuppressWarnings ("deprecation")
public void
ringBell (int duration)
@ -581,6 +578,15 @@ invocation of app_process (through android-emacs) can
return false;
}
public boolean
detectKeyboard ()
{
Configuration configuration;
configuration = getResources ().getConfiguration ();
return configuration.keyboard != Configuration.KEYBOARD_NOKEYS;
}
public String
nameKeysym (int keysym)
{
@ -905,48 +911,6 @@ invocation of app_process (through android-emacs) can
/* Content provider functions. */
/* Return a ContentResolver capable of accessing as many files as
possible, namely the content resolver of the last selected
activity if available: only they posses the rights to access drag
and drop files. */
public ContentResolver
getUsefulContentResolver ()
{
EmacsActivity activity;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N)
/* Since the system predates drag and drop, return this resolver
to avoid any unforeseen difficulties. */
return resolver;
activity = EmacsActivity.lastFocusedActivity;
if (activity == null)
return resolver;
return activity.getContentResolver ();
}
/* Return a context whose ContentResolver is granted access to most
files, as in `getUsefulContentResolver'. */
public Context
getContentResolverContext ()
{
EmacsActivity activity;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N)
/* Since the system predates drag and drop, return this resolver
to avoid any unforeseen difficulties. */
return this;
activity = EmacsActivity.lastFocusedActivity;
if (activity == null)
return this;
return activity;
}
/* Open a content URI described by the bytes BYTES, a non-terminated
string; make it writable if WRITABLE, and readable if READABLE.
Truncate the file if TRUNCATE.
@ -960,9 +924,6 @@ invocation of app_process (through android-emacs) can
String name, mode;
ParcelFileDescriptor fd;
int i;
ContentResolver resolver;
resolver = getUsefulContentResolver ();
/* Figure out the file access mode. */
@ -1024,12 +985,8 @@ invocation of app_process (through android-emacs) can
ParcelFileDescriptor fd;
Uri uri;
int rc, flags;
Context context;
ContentResolver resolver;
ParcelFileDescriptor descriptor;
context = getContentResolverContext ();
uri = Uri.parse (name);
flags = 0;
@ -1039,7 +996,7 @@ invocation of app_process (through android-emacs) can
if (writable)
flags |= Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
rc = context.checkCallingUriPermission (uri, flags);
rc = checkCallingUriPermission (uri, flags);
if (rc == PackageManager.PERMISSION_GRANTED)
return true;
@ -1053,7 +1010,6 @@ invocation of app_process (through android-emacs) can
try
{
resolver = context.getContentResolver ();
descriptor = resolver.openFileDescriptor (uri, "r");
return true;
}

View file

@ -27,6 +27,8 @@
import java.util.LinkedHashMap;
import java.util.Map;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipDescription;
import android.content.Context;
@ -240,7 +242,7 @@ private static class Coordinate
}
}
EmacsActivity.invalidateFocus ();
EmacsActivity.invalidateFocus (4);
if (!children.isEmpty ())
throw new IllegalStateException ("Trying to destroy window with "
@ -362,6 +364,9 @@ private static class Coordinate
requestViewLayout ();
}
/* Return WM layout parameters for an override redirect window with
the geometry provided here. */
private WindowManager.LayoutParams
getWindowLayoutParams ()
{
@ -384,15 +389,15 @@ private static class Coordinate
return params;
}
private Context
private Activity
findSuitableActivityContext ()
{
/* Find a recently focused activity. */
if (!EmacsActivity.focusedActivities.isEmpty ())
return EmacsActivity.focusedActivities.get (0);
/* Return the service context, which probably won't work. */
return EmacsService.SERVICE;
/* Resort to the last activity to be focused. */
return EmacsActivity.lastFocusedActivity;
}
public synchronized void
@ -416,7 +421,7 @@ private static class Coordinate
{
EmacsWindowAttachmentManager manager;
WindowManager windowManager;
Context ctx;
Activity ctx;
Object tem;
WindowManager.LayoutParams params;
@ -447,11 +452,23 @@ private static class Coordinate
activity using the system window manager. */
ctx = findSuitableActivityContext ();
if (ctx == null)
{
Log.w (TAG, "failed to attach override-redirect window"
+ " for want of activity");
return;
}
tem = ctx.getSystemService (Context.WINDOW_SERVICE);
windowManager = (WindowManager) tem;
/* Calculate layout parameters. */
/* Calculate layout parameters and propagate the
activity's token into it. */
params = getWindowLayoutParams ();
params.token = (ctx.findViewById (android.R.id.content)
.getWindowToken ());
view.setLayoutParams (params);
/* Attach the view. */
@ -644,7 +661,7 @@ private static class Coordinate
public void
onKeyDown (int keyCode, KeyEvent event)
{
int state, state_1, num_lock_flag;
int state, state_1, extra_ignored;
long serial;
String characters;
@ -665,23 +682,37 @@ private static class Coordinate
state = eventModifiers (event);
/* Num Lock and Scroll Lock aren't supported by systems older than
Android 3.0. */
/* Num Lock, Scroll Lock and Meta aren't supported by systems older
than Android 3.0. */
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
num_lock_flag = (KeyEvent.META_NUM_LOCK_ON
| KeyEvent.META_SCROLL_LOCK_ON);
extra_ignored = (KeyEvent.META_NUM_LOCK_ON
| KeyEvent.META_SCROLL_LOCK_ON
| KeyEvent.META_META_MASK);
else
num_lock_flag = 0;
extra_ignored = 0;
/* Ignore meta-state understood by Emacs for now, or key presses
such as Ctrl+C and Meta+C will not be recognized as an ASCII
key press event. */
such as Ctrl+C and Meta+C will not be recognized as ASCII key
press events. */
state_1
= state & ~(KeyEvent.META_ALT_MASK | KeyEvent.META_CTRL_MASK
| KeyEvent.META_SYM_ON | KeyEvent.META_META_MASK
| num_lock_flag);
| KeyEvent.META_SYM_ON | extra_ignored);
/* There's no distinction between Right Alt and Alt Gr on Android,
so restore META_ALT_RIGHT_ON if set in state to enable composing
characters. (bug#69321) */
if ((state & KeyEvent.META_ALT_RIGHT_ON) != 0)
{
state_1 |= KeyEvent.META_ALT_ON | KeyEvent.META_ALT_RIGHT_ON;
/* If Alt is also not depressed, remove its bit from the mask
reported to Emacs. */
if ((state & KeyEvent.META_ALT_LEFT_ON) == 0)
state &= ~KeyEvent.META_ALT_MASK;
}
synchronized (eventStrings)
{
@ -702,29 +733,43 @@ private static class Coordinate
public void
onKeyUp (int keyCode, KeyEvent event)
{
int state, state_1, unicode_char, num_lock_flag;
int state, state_1, unicode_char, extra_ignored;
long time;
/* Compute the event's modifier mask. */
state = eventModifiers (event);
/* Num Lock and Scroll Lock aren't supported by systems older than
Android 3.0. */
/* Num Lock, Scroll Lock and Meta aren't supported by systems older
than Android 3.0. */
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
num_lock_flag = (KeyEvent.META_NUM_LOCK_ON
| KeyEvent.META_SCROLL_LOCK_ON);
extra_ignored = (KeyEvent.META_NUM_LOCK_ON
| KeyEvent.META_SCROLL_LOCK_ON
| KeyEvent.META_META_MASK);
else
num_lock_flag = 0;
extra_ignored = 0;
/* Ignore meta-state understood by Emacs for now, or key presses
such as Ctrl+C and Meta+C will not be recognized as an ASCII
key press event. */
such as Ctrl+C and Meta+C will not be recognized as ASCII key
press events. */
state_1
= state & ~(KeyEvent.META_ALT_MASK | KeyEvent.META_CTRL_MASK
| KeyEvent.META_SYM_ON | KeyEvent.META_META_MASK
| num_lock_flag);
| KeyEvent.META_SYM_ON | extra_ignored);
/* There's no distinction between Right Alt and Alt Gr on Android,
so restore META_ALT_RIGHT_ON if set in state to enable composing
characters. */
if ((state & KeyEvent.META_ALT_RIGHT_ON) != 0)
{
state_1 |= KeyEvent.META_ALT_ON | KeyEvent.META_ALT_RIGHT_ON;
/* If Alt is also not depressed, remove its bit from the mask
reported to Emacs. */
if ((state & KeyEvent.META_ALT_LEFT_ON) == 0)
state &= ~KeyEvent.META_ALT_MASK;
}
unicode_char = getEventUnicodeChar (event, state_1);
@ -760,7 +805,7 @@ private static class Coordinate
public void
onFocusChanged (boolean gainFocus)
{
EmacsActivity.invalidateFocus ();
EmacsActivity.invalidateFocus (gainFocus ? 6 : 5);
}
/* Notice that the activity has been detached or destroyed.
@ -1746,7 +1791,7 @@ else if (type.equals (ClipDescription.MIMETYPE_TEXT_URILIST))
/* Attempt to acquire permissions for this URI;
failing which, insert it as text instead. */
if (uri != null
&& uri.getScheme () != null
&& uri.getScheme ().equals ("content")

View file

@ -101,11 +101,11 @@ ${leimdir}/quail ${leimdir}/ja-dic:
## All of TIT_GB and TIT_BIG5.
${leimdir}/quail/%.el: ${srcdir}/CXTERM-DIC/%.tit
$(AM_V_GEN)${RUN_EMACS} -l titdic-cnv \
-f batch-titdic-convert -dir ${leimdir}/quail $<
-f batch-tit-dic-convert -dir ${leimdir}/quail $<
misc_convert = $(AM_V_GEN)${RUN_EMACS} \
-l titdic-cnv -f batch-miscdic-convert -dir ${leimdir}/quail
-l titdic-cnv -f batch-tit-miscdic-convert -dir ${leimdir}/quail
## CTLau.el, CTLau-b5.el.
${leimdir}/quail/CT%.el: ${srcdir}/MISC-DIC/CT%.html
@ -148,7 +148,7 @@ ${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L small-ja-dic-option
-f batch-skkdic-convert -dir "$(leimdir)/ja-dic" $(JA_DIC_NO_REDUCTION_OPTION) "$<"
${srcdir}/../lisp/language/pinyin.el: ${srcdir}/MISC-DIC/pinyin.map
$(AM_V_GEN)${RUN_EMACS} -l titdic-cnv -f pinyin-convert $< $@
$(AM_V_GEN)${RUN_EMACS} -l titdic-cnv -f tit-pinyin-convert $< $@
.PHONY: bootstrap-clean distclean maintainer-clean gen-clean

View file

@ -319,7 +319,7 @@ maybe-blessmail: $(BLESSMAIL_TARGET)
## up if chown or chgrp fails, as the package responsible for
## installing Emacs can fix this problem later.
$(DESTDIR)${archlibdir}: all
$(info $ )
$(info $.)
$(info Installing utilities run internally by Emacs.)
umask 022 && ${MKDIR_P} "$(DESTDIR)${archlibdir}"
exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && pwd -P` && \
@ -361,7 +361,7 @@ $(DESTDIR)${archlibdir}: all
.PHONY: bootstrap-clean check tags
install: $(DESTDIR)${archlibdir}
$(info $ )
$(info $.)
$(info Installing utilities for users to run.)
umask 022 && ${MKDIR_P} "$(DESTDIR)${bindir}"
for file in ${INSTALLABLES} ; do \

View file

@ -42,8 +42,8 @@
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
? 6000000 <= __apple_build_version__ \
: 3 < __clang_major__ + (5 <= __clang_minor__))))
? 7000000 <= __apple_build_version__ \
: 5 <= __clang_major__)))
# define __glibc_has_attribute(attr) __has_attribute (attr)
#else
# define __glibc_has_attribute(attr) 0

View file

@ -47,6 +47,7 @@
# --avoid=iswdigit \
# --avoid=iswxdigit \
# --avoid=langinfo \
# --avoid=localename-unsafe-limited \
# --avoid=lock \
# --avoid=mbrtowc \
# --avoid=mbsinit \
@ -1185,6 +1186,7 @@ REPLACE_MB_CUR_MAX = @REPLACE_MB_CUR_MAX@
REPLACE_MEMCHR = @REPLACE_MEMCHR@
REPLACE_MEMMEM = @REPLACE_MEMMEM@
REPLACE_MEMPCPY = @REPLACE_MEMPCPY@
REPLACE_MEMSET_EXPLICIT = @REPLACE_MEMSET_EXPLICIT@
REPLACE_MKDIR = @REPLACE_MKDIR@
REPLACE_MKFIFO = @REPLACE_MKFIFO@
REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
@ -1271,6 +1273,7 @@ REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
REPLACE_TIME = @REPLACE_TIME@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TIMESPEC_GET = @REPLACE_TIMESPEC_GET@
REPLACE_TIMESPEC_GETRES = @REPLACE_TIMESPEC_GETRES@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
@ -2743,7 +2746,9 @@ ifeq (,$(OMIT_GNULIB_MODULE_nstrftime))
libgnu_a_SOURCES += nstrftime.c
EXTRA_DIST += strftime.h
EXTRA_DIST += strftime.c strftime.h
EXTRA_libgnu_a_SOURCES += strftime.c
endif
## end gnulib module nstrftime
@ -3560,6 +3565,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-e 's|@''REPLACE_MEMPCPY''@|$(REPLACE_MEMPCPY)|g' \
-e 's|@''REPLACE_MEMSET_EXPLICIT''@|$(REPLACE_MEMSET_EXPLICIT)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
-e 's|@''REPLACE_STPCPY''@|$(REPLACE_STPCPY)|g' \
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
@ -3892,6 +3898,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's|@''REPLACE_TIME''@|$(REPLACE_TIME)|g' \
-e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-e 's|@''REPLACE_TIMESPEC_GET''@|$(REPLACE_TIMESPEC_GET)|g' \
-e 's|@''REPLACE_TIMESPEC_GETRES''@|$(REPLACE_TIMESPEC_GETRES)|g' \
-e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
-e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \

View file

@ -130,7 +130,7 @@
# define BOOL_WIDTH 1
# define BOOL_MAX 1
# elif ! defined BOOL_MAX
# define BOOL_MAX ((((1U << (BOOL_WIDTH - 1)) - 1) << 1) + 1)
# define BOOL_MAX 1
# endif
#endif

File diff suppressed because it is too large Load diff

2051
lib/strftime.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -21,17 +21,68 @@
extern "C" {
#endif
/* Just like strftime, but with two more arguments:
POSIX requires that strftime use the local timezone information.
Use the timezone __TZ instead. Use __NS as the number of
nanoseconds in the %N directive.
/* Formats the broken-down time *__TP, with additional __NS nanoseconds,
into the buffer __S of size __MAXSIZE, according to the rules of the
LC_TIME category of the current locale.
On error, set errno and return 0. Otherwise, return the number of
bytes generated (not counting the trailing NUL), preserving errno
if the number is 0. This errno behavior is in draft POSIX 202x
plus some requested changes to POSIX. */
size_t nstrftime (char *restrict, size_t, char const *, struct tm const *,
timezone_t __tz, int __ns);
Uses the time zone __TZ.
If *__TP represents local time, __TZ should be set to
tzalloc (getenv ("TZ")).
If *__TP represents universal time (a.k.a. GMT), __TZ should be set to
(timezone_t) 0.
The format string __FORMAT, including GNU extensions, is described in
the GNU libc's strftime() documentation:
<https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html>
Additionally, the following conversion is supported:
%N The number of nanoseconds, passed as __NS argument.
Here's a summary of the available conversions (= format directives):
literal characters %n %t %%
date:
century %C
year %Y %y
week-based year %G %g
month (in year) %m %B %b %h
week in year %U %W %V
day in year %j
day (in month) %d %e
day in week %u %w %A %a
year, month, day %x %F %D
time:
half-day %p %P
hour %H %k %I %l
minute (in hour) %M
hour, minute %R
second (in minute) %S
hour, minute, second %r %T %X
second (since epoch) %s
date and time: %c
time zone: %z %Z
nanosecond %N
Stores the result, as a string with a trailing NUL character, at the
beginning of the array __S[0..__MAXSIZE-1], if it fits, and returns
the length of that string, not counting the trailing NUL. In this case,
errno is preserved if the return value is 0.
If it does not fit, this function sets errno to ERANGE and returns 0.
Upon other errors, this function sets errno and returns 0 as well.
Note: The errno behavior is in draft POSIX 202x plus some requested
changes to POSIX.
This function is like strftime, but with two more arguments:
* __TZ instead of the local timezone information,
* __NS as the number of nanoseconds in the %N directive.
*/
size_t nstrftime (char *restrict __s, size_t __maxsize,
char const *__format,
struct tm const *__tp, timezone_t __tz, int __ns);
/* Like nstrftime, except that it uses the "C" locale instead of the
current locale. */
size_t c_nstrftime (char *restrict __s, size_t __maxsize,
char const *__format,
struct tm const *__tp, timezone_t __tz, int __ns);
#ifdef __cplusplus
}

View file

@ -414,11 +414,21 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
/* Overwrite a block of memory. The compiler will not optimize
effects away, even if the block is dead after the call. */
#if @GNULIB_MEMSET_EXPLICIT@
# if ! @HAVE_MEMSET_EXPLICIT@
# if @REPLACE_MEMSET_EXPLICIT@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef memset_explicit
# define memset_explicit rpl_memset_explicit
# endif
_GL_FUNCDECL_RPL (memset_explicit, void *,
(void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t __n));
# else
# if !@HAVE_MEMSET_EXPLICIT@
_GL_FUNCDECL_SYS (memset_explicit, void *,
(void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1)));
# endif
# endif
_GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n));
# endif
_GL_CXXALIASWARN (memset_explicit);
#elif defined GNULIB_POSIXCHECK
# undef memset_explicit

View file

@ -154,11 +154,21 @@ _GL_WARN_ON_USE (timespec_get, "timespec_get is unportable - "
/* Set *TS to the current time resolution, and return BASE.
Upon failure, return 0. */
# if @GNULIB_TIMESPEC_GETRES@
# if ! @HAVE_TIMESPEC_GETRES@
# if @REPLACE_TIMESPEC_GETRES@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef timespec_getres
# define timespec_getres rpl_timespec_getres
# endif
_GL_FUNCDECL_RPL (timespec_getres, int, (struct timespec *ts, int base)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (timespec_getres, int, (struct timespec *ts, int base));
# else
# if !@HAVE_TIMESPEC_GETRES@
_GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base)
_GL_ARG_NONNULL ((1)));
# endif
# endif
_GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
# endif
_GL_CXXALIASWARN (timespec_getres);
# elif defined GNULIB_POSIXCHECK
# undef timespec_getres
@ -428,11 +438,7 @@ _GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
_GL_CXXALIASWARN (ctime);
# endif
# elif defined GNULIB_POSIXCHECK
# undef ctime
# if HAVE_RAW_DECL_CTIME
_GL_WARN_ON_USE (ctime, "ctime has portability problems - "
"use gnulib module ctime for portability");
# endif
/* No need to warn about portability, as a more serious warning is below. */
# endif
/* Convert *TP to a date and time string. See

View file

@ -21,6 +21,11 @@
#include <time.h>
/* The replacement functions in this file are only used on native Windows.
They are multithread-safe, because the gmtime() and localtime() functions
on native Windows both in the ucrt and in the older MSVCRT return a
pointer to a 'struct tm' in thread-local memory. */
static struct tm *
copy_tm_result (struct tm *dest, struct tm const *src)
{

View file

@ -32,6 +32,10 @@
_GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
linkage.
_GL_WARN_ON_USE should not be used more than once for a given function
in a given compilation unit (because this may generate a warning even
if the function is never called).
However, one of the reasons that a function is a portability trap is
if it has the wrong signature. Declaring FUNCTION with a different
signature in C is a compilation error, so this macro must use the

View file

@ -29,8 +29,7 @@
is SIZE_MAX - 1. */
#define __xalloc_oversized(n, s) \
((s) != 0 \
&& ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) \
< (n)))
&& (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) < (n))
/* Return 1 if and only if an array of N objects, each of size S,
cannot exist reliably because its total size in bytes would exceed

View file

@ -602,8 +602,7 @@ It is nil if the abbrev has already been unexpanded.")
"Undefine all abbrevs in abbrev table TABLE, leaving TABLE empty."
(setq abbrevs-changed t)
(let* ((sym (obarray-get table "")))
(dotimes (i (length table))
(aset table i 0))
(obarray-clear table)
;; Preserve the table's properties.
(cl-assert sym)
(let ((newsym (obarray-put table "")))
@ -721,7 +720,7 @@ either a single abbrev table or a list of abbrev tables."
;; to treat the distinction between a single table and a list of tables.
(cond
((consp tables) tables)
((vectorp tables) (list tables))
((obarrayp tables) (list tables))
(t
(let ((tables (if (listp local-abbrev-table)
(append local-abbrev-table

View file

@ -161,9 +161,9 @@ respective `allout-mode' keybinding variables, `allout-command-prefix',
(defcustom allout-command-prefix "\C-c "
"Key sequence to be used as prefix for outline mode command key bindings.
Default is `\C-c<space>'; just `\C-c' is more short-and-sweet, if you're
willing to let allout use a bunch of \C-c keybindings."
:type 'string
Default is \\`C-c SPC'; just \\`C-c' is more short-and-sweet, if you're
willing to let allout use a bunch of \\`C-c' keybindings."
:type 'key-sequence
:group 'allout-keybindings
:set #'allout-compose-and-institute-keymap)
;;;_ = allout-keybindings-binding

View file

@ -1985,7 +1985,7 @@ entries for git.gnus.org:
(defun auth-source--decode-octal-string (string)
"Convert octal STRING to utf-8 string. E.g: \"a\134b\" to \"a\b\"."
"Convert octal STRING to utf-8 string. E.g.: \"a\\134b\" to \"a\\b\"."
(let ((list (string-to-list string))
(size (length string)))
(decode-coding-string

View file

@ -155,6 +155,7 @@ add keys to that keymap."
(add-to-list 'emulation-mode-map-alists
`((override-global-mode . ,override-global-map)))
;;;###autoload
(defvar personal-keybindings nil
"List of bindings performed by `bind-key'.

View file

@ -100,6 +100,10 @@ as it is by default."
This is set by the prefix argument to `buffer-menu' and related
commands.")
(defvar-local Buffer-menu-show-internal nil
"Non-nil if the current Buffer Menu lists internal buffers.
Internal buffers are those whose names start with a space.")
(defvar-local Buffer-menu-filter-predicate nil
"Function to filter out buffers in the buffer list.
Buffers that don't satisfy the predicate will be skipped.
@ -140,6 +144,7 @@ then the buffer will be displayed in the buffer list.")
"V" #'Buffer-menu-view
"O" #'Buffer-menu-view-other-window
"T" #'Buffer-menu-toggle-files-only
"I" #'Buffer-menu-toggle-internal
"M-s a C-s" #'Buffer-menu-isearch-buffers
"M-s a C-M-s" #'Buffer-menu-isearch-buffers-regexp
"M-s a C-o" #'Buffer-menu-multi-occur
@ -197,6 +202,10 @@ then the buffer will be displayed in the buffer list.")
:help "Toggle whether the current buffer-menu displays only file buffers"
:style toggle
:selected Buffer-menu-files-only]
["Show Internal Buffers" Buffer-menu-toggle-internal
:help "Toggle whether the current buffer-menu displays internal buffers"
:style toggle
:selected Buffer-menu-show-internal]
"---"
["Refresh" revert-buffer
:help "Refresh the *Buffer List* buffer contents"]
@ -317,6 +326,11 @@ ARG, show only buffers that are visiting files."
(interactive "P")
(display-buffer (list-buffers-noselect arg)))
(defun Buffer-menu--selection-message ()
(message (cond (Buffer-menu-files-only "Showing only file-visiting buffers.")
(Buffer-menu-show-internal "Showing all buffers.")
(t "Showing all buffers except internal ones."))))
(defun Buffer-menu-toggle-files-only (arg)
"Toggle whether the current `buffer-menu' displays only file buffers.
With a positive ARG, display only file buffers. With zero or
@ -325,9 +339,18 @@ negative ARG, display other buffers as well."
(setq Buffer-menu-files-only
(cond ((not arg) (not Buffer-menu-files-only))
((> (prefix-numeric-value arg) 0) t)))
(message (if Buffer-menu-files-only
"Showing only file-visiting buffers."
"Showing all non-internal buffers."))
(Buffer-menu--selection-message)
(revert-buffer))
(defun Buffer-menu-toggle-internal (arg)
"Toggle whether the current `buffer-menu' displays internal buffers.
With a positive ARG, don't show internal buffers. With zero or
negative ARG, display internal buffers as well."
(interactive "P" Buffer-menu-mode)
(setq Buffer-menu-show-internal
(cond ((not arg) (not Buffer-menu-show-internal))
((> (prefix-numeric-value arg) 0) t)))
(Buffer-menu--selection-message)
(revert-buffer))
(define-obsolete-function-alias 'Buffer-menu-sort 'tabulated-list-sort
@ -569,13 +592,17 @@ If UNMARK is non-nil, unmark them."
(defun Buffer-menu-other-window ()
"Select this line's buffer in other window, leaving buffer menu visible."
(interactive nil Buffer-menu-mode)
(switch-to-buffer-other-window (Buffer-menu-buffer t)))
(let ((display-buffer-overriding-action
'(nil (inhibit-same-window . t))))
(switch-to-buffer-other-window (Buffer-menu-buffer t))))
(defun Buffer-menu-switch-other-window ()
"Make the other window select this line's buffer.
The current window remains selected."
(interactive nil Buffer-menu-mode)
(display-buffer (Buffer-menu-buffer t) t))
(let ((display-buffer-overriding-action
'(nil (inhibit-same-window . t))))
(display-buffer (Buffer-menu-buffer t) t)))
(defun Buffer-menu-2-window ()
"Select this line's buffer, with previous buffer in second window."
@ -667,6 +694,7 @@ See more at `Buffer-menu-filter-predicate'."
(marked-buffers (Buffer-menu-marked-buffers))
(buffer-menu-buffer (current-buffer))
(show-non-file (not Buffer-menu-files-only))
(show-internal Buffer-menu-show-internal)
(filter-predicate (and (functionp Buffer-menu-filter-predicate)
Buffer-menu-filter-predicate))
entries name-width)
@ -686,7 +714,8 @@ See more at `Buffer-menu-filter-predicate'."
(file buffer-file-name))
(when (and (buffer-live-p buffer)
(or buffer-list
(and (or (not (string= (substring name 0 1) " "))
(and (or show-internal
(not (string= (substring name 0 1) " "))
file)
(not (eq buffer buffer-menu-buffer))
(or file show-non-file)

View file

@ -1,6 +1,6 @@
;;; mode-local.el --- Support for mode local facilities -*- lexical-binding:t -*-
;;
;; Copyright (C) 2004-2005, 2007-2024 Free Software Foundation, Inc.
;; Copyright (C) 2004-2024 Free Software Foundation, Inc.
;;
;; Author: David Ponce <david@dponce.com>
;; Created: 27 Apr 2004
@ -84,7 +84,7 @@ MODES can be a symbol or a list of symbols.
FUNCTION does not have arguments."
(setq modes (ensure-list modes))
(mode-local-map-file-buffers
function (lambda () (apply #'derived-mode-p modes))))
function (lambda () (derived-mode-p modes))))
;;; Hook machinery
;;

View file

@ -153,13 +153,13 @@ The search priority is:
"Return the dynamic macro map for the current buffer."
(or semantic-lex-spp-dynamic-macro-symbol-obarray
(setq semantic-lex-spp-dynamic-macro-symbol-obarray
(make-vector 13 0))))
(obarray-make 13))))
(defsubst semantic-lex-spp-dynamic-map-stack ()
"Return the dynamic macro map for the current buffer."
(or semantic-lex-spp-dynamic-macro-symbol-obarray-stack
(setq semantic-lex-spp-dynamic-macro-symbol-obarray-stack
(make-vector 13 0))))
(obarray-make 13))))
(defun semantic-lex-spp-value-valid-p (value)
"Return non-nil if VALUE is valid."
@ -260,7 +260,7 @@ NAME is the name of the spp macro symbol to define.
REPLACEMENT a string that would be substituted in for NAME."
;; Create the symbol hash table
(let ((semantic-lex-spp-macro-symbol-obarray (make-vector 13 0))
(let ((semantic-lex-spp-macro-symbol-obarray (obarray-make 13))
spec)
;; fill it with stuff
(while specs

View file

@ -259,7 +259,7 @@ If optional argument PROPSPECS is non-nil, then interpret it, and
apply those properties.
PROPSPECS must be a list of (NAME PROPERTY VALUE) elements."
;; Create the symbol hash table
(let ((semantic-flex-keywords-obarray (make-vector 13 0))
(let ((semantic-flex-keywords-obarray (obarray-make 13))
spec)
;; fill it with stuff
(while specs
@ -416,7 +416,7 @@ If optional argument PROPSPECS is non-nil, then interpret it, and
apply those properties.
PROPSPECS must be a list of (TYPE PROPERTY VALUE)."
;; Create the symbol hash table
(let* ((semantic-lex-types-obarray (make-vector 13 0))
(let* ((semantic-lex-types-obarray (obarray-make 13))
spec type tokens token alist default)
;; fill it with stuff
(while specs

View file

@ -254,7 +254,7 @@ This variable is buffer-local."
See also `comint-read-input-ring' and `comint-write-input-ring'.
`comint-mode' makes this a buffer-local variable. You probably want
to set this in a mode hook, rather than customize the default value."
:type '(choice (const :tag "nil" nil)
:type '(choice (const :tag "Disable input history" nil)
file)
:group 'comint)

View file

@ -302,21 +302,21 @@ point, otherwise hide it."
;; never display a stale preview and that the preview doesn't
;; flicker, even with slow completion backends.
(let* ((beg (completion-preview--get 'completion-preview-beg))
(end (max (point) (overlay-start completion-preview--overlay)))
(cands (completion-preview--get 'completion-preview-cands))
(index (completion-preview--get 'completion-preview-index))
(cand (nth index cands))
(len (length cand))
(end (+ beg len))
(cur (point))
(face (get-text-property 0 'face (completion-preview--get 'after-string))))
(if (and (< beg cur end) (string-prefix-p (buffer-substring beg cur) cand))
(after (completion-preview--get 'after-string))
(face (get-text-property 0 'face after)))
(if (and (<= beg (point) end (1- (+ beg (length cand))))
(string-prefix-p (buffer-substring beg end) cand))
;; The previous preview is still applicable, update it.
(overlay-put (completion-preview--make-overlay
cur (propertize (substring cand (- cur beg))
end (propertize (substring cand (- end beg))
'face face
'mouse-face 'completion-preview-highlight
'keymap completion-preview--mouse-map))
'completion-preview-end cur)
'completion-preview-end end)
;; The previous preview is no longer applicable, hide it.
(completion-preview-active-mode -1))))
;; Run `completion-at-point-functions' to get a new candidate.
@ -366,16 +366,16 @@ prefix argument and defaults to 1."
(interactive "p")
(when completion-preview-active-mode
(let* ((beg (completion-preview--get 'completion-preview-beg))
(end (completion-preview--get 'completion-preview-end))
(all (completion-preview--get 'completion-preview-cands))
(cur (completion-preview--get 'completion-preview-index))
(len (length all))
(new (mod (+ cur direction) len))
(str (nth new all))
(pos (point)))
(while (or (<= (+ beg (length str)) pos)
(not (string-prefix-p (buffer-substring beg pos) str)))
(str (nth new all)))
(while (or (<= (+ beg (length str)) end)
(not (string-prefix-p (buffer-substring beg end) str)))
(setq new (mod (+ new direction) len) str (nth new all)))
(let ((aft (propertize (substring str (- pos beg))
(let ((aft (propertize (substring str (- end beg))
'face (if (< 1 len)
'completion-preview
'completion-preview-exact)

View file

@ -875,11 +875,11 @@ This is sensitive to `case-fold-search'."
;; GNU implements obarrays
(defconst cmpl-obarray-length 511)
(defvar cmpl-prefix-obarray (make-vector cmpl-obarray-length 0)
(defvar cmpl-prefix-obarray (obarray-make cmpl-obarray-length)
"An obarray used to store the downcased completion prefixes.
Each symbol is bound to a list of completion entries.")
(defvar cmpl-obarray (make-vector cmpl-obarray-length 0)
(defvar cmpl-obarray (obarray-make cmpl-obarray-length)
"An obarray used to store the downcased completions.
Each symbol is bound to a single completion entry.")
@ -962,8 +962,8 @@ Each symbol is bound to a single completion entry.")
(defun clear-all-completions ()
"Initialize the completion storage. All existing completions are lost."
(interactive)
(setq cmpl-prefix-obarray (make-vector cmpl-obarray-length 0))
(setq cmpl-obarray (make-vector cmpl-obarray-length 0)))
(setq cmpl-prefix-obarray (obarray-make cmpl-obarray-length))
(setq cmpl-obarray (obarray-make cmpl-obarray-length)))
(defun list-all-completions ()
"Return a list of all the known completion entries."

View file

@ -1227,6 +1227,41 @@ If OTHER-WINDOW is non-nil, display in another window."
(unless (eq symbol basevar)
(message "`%s' is an alias for `%s'" symbol basevar))))
;;;###autoload
(defun customize-toggle-option (symbol)
"Toggle the value of boolean option SYMBOL for this session."
(interactive (let ((prompt "Toggle boolean option: ") opts)
(mapatoms
(lambda (sym)
(when (eq (get sym 'custom-type) 'boolean)
(push sym opts))))
(list (intern (completing-read prompt opts nil nil nil nil
(symbol-at-point))))))
(let* ((setter (or (get symbol 'custom-set) #'set-default))
(getter (or (get symbol 'custom-get) #'symbol-value))
(value (condition-case nil
(funcall getter symbol)
(void-variable (error "`%s' is not bound" symbol))))
(type (get symbol 'custom-type)))
(cond
((eq type 'boolean))
((and (null type)
(yes-or-no-p
(format "`%s' doesn't have a type, and has the value %S. \
Proceed to toggle?" symbol value))))
((yes-or-no-p
(format "`%s' is of type %s, and has the value %S. \
Proceed to toggle?"
symbol type value)))
((error "Abort toggling of option `%s'" symbol)))
(message "%s user options `%s'."
(if (funcall setter symbol (not value))
"Enabled" "Disabled")
symbol)))
;;;###autoload
(defalias 'toggle-option #'customize-toggle-option)
;;;###autoload
(defalias 'customize-variable-other-window 'customize-option-other-window)

View file

@ -32,7 +32,7 @@
(defun custom-declare-face (face spec doc &rest args)
"Like `defface', but with FACE evaluated as a normal argument."
(when (and doc
(not (stringp doc)))
(not (documentation-stringp doc)))
(error "Invalid (or missing) doc string %S" doc))
(unless (get face 'face-defface-spec)
(face-spec-set face (purecopy spec) 'face-defface-spec)

View file

@ -371,6 +371,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
(auto-save-timeout auto-save (choice (const :tag "off" nil)
(integer :format "%v")))
(echo-keystrokes minibuffer number)
(echo-keystrokes-help minibuffer boolean "30.1")
(polling-period keyboard float)
(double-click-time mouse (restricted-sexp
:match-alternatives (integerp 'nil 't)))

View file

@ -163,10 +163,19 @@ Used at desktop read to provide backward compatibility.")
(define-minor-mode desktop-save-mode
"Toggle desktop saving (Desktop Save mode).
When Desktop Save mode is enabled, the state of Emacs is saved from
one session to another. In particular, Emacs will save the desktop when
it exits (this may prompt you; see the option `desktop-save'). The next
time Emacs starts, if this mode is active it will restore the desktop.
When Desktop Save mode is enabled, the state of Emacs is saved from one
session to another. The saved Emacs \"desktop configuration\" includes the
buffers, their file names, major modes, buffer positions, window and frame
configuration, and some important global variables.
To enable this feature for future sessions, customize `desktop-save-mode'
to t, or add this line in your init file:
(desktop-save-mode 1)
When this mode is enabled, Emacs will save the desktop when it exits
(this may prompt you, see the option `desktop-save'). The next time
Emacs starts, if this mode is active it will restore the desktop.
To manually save the desktop at any time, use the command \\[desktop-save].
To load it, use \\[desktop-read].

View file

@ -4321,6 +4321,11 @@ this subdir."
(prefix-numeric-value arg)
(lambda ()
(when (or (not (looking-at-p dired-re-dot))
;; Don't skip symlinks to ".", "..", etc.
(save-excursion
(re-search-forward
dired-permission-flags-regexp nil t)
(eq (char-after (match-beginning 1)) ?l))
(not (equal dired-marker-char dired-del-marker)))
(delete-char 1)
(insert dired-marker-char))))))))

View file

@ -231,17 +231,8 @@ This includes variable references and calls to functions such as `car'."
:type 'boolean)
(defvar byte-compile-dynamic nil
"If non-nil, compile function bodies so they load lazily.
They are hidden in comments in the compiled file,
and each one is brought into core when the
function is called.
To enable this option, make it a file-local variable
in the source file you want it to apply to.
For example, add -*-byte-compile-dynamic: t;-*- on the first line.
When this option is true, if you load the compiled file and then move it,
the functions you loaded will not be able to run.")
"Formerly used to compile function bodies so they load lazily.
This variable no longer has any effect.")
(make-obsolete-variable 'byte-compile-dynamic "not worthwhile any more." "27.1")
;;;###autoload(put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
@ -294,6 +285,7 @@ The information is logged to `byte-compile-log-buffer'."
(defconst byte-compile-warning-types
'( callargs constants
docstrings docstrings-non-ascii-quotes docstrings-wide
docstrings-control-chars
empty-body free-vars ignored-return-value interactive-only
lexical lexical-dynamic make-local
mapcar ; obsolete
@ -316,6 +308,8 @@ Elements of the list may be:
docstrings that are too wide, containing lines longer than both
`byte-compile-docstring-max-column' and `fill-column' characters.
Only enabled when `docstrings' also is.
docstrings-control-chars
docstrings that contain control characters other than NL and TAB
empty-body body argument to a special form or macro is empty.
free-vars references to variables not in the current lexical scope.
ignored-return-value
@ -354,7 +348,7 @@ A value of `all' really means all."
'(docstrings-non-ascii-quotes)
"List of warning types that are only enabled during Emacs builds.
This is typically either warning types that are being phased in
(but shouldn't be enabled for packages yet), or that are only relevant
\(but shouldn't be enabled for packages yet), or that are only relevant
for the Emacs build itself.")
(defvar byte-compile--suppressed-warnings nil
@ -1749,68 +1743,100 @@ Also ignore URLs."
The byte-compiler will emit a warning for documentation strings
containing lines wider than this. If `fill-column' has a larger
value, it will override this variable."
:group 'bytecomp
:type 'natnum
:safe #'natnump
:version "28.1")
(define-obsolete-function-alias 'byte-compile-docstring-length-warn
'byte-compile-docstring-style-warn "29.1")
(defun byte-compile--list-with-n (list n elem)
"Return LIST with its Nth element replaced by ELEM."
(if (eq elem (nth n list))
list
(nconc (take n list)
(list elem)
(nthcdr (1+ n) list))))
(defun byte-compile-docstring-style-warn (form)
"Warn if there are stylistic problems with the docstring in FORM.
Warn if documentation string of FORM is too wide.
(defun byte-compile--docstring-style-warn (docs kind name)
"Warn if there are stylistic problems in the docstring DOCS.
Warn if documentation string is too wide.
It is too wide if it has any lines longer than the largest of
`fill-column' and `byte-compile-docstring-max-column'."
(when (byte-compile-warning-enabled-p 'docstrings)
(let* ((kind nil) (name nil) (docs nil)
(let* ((name (if (eq (car-safe name) 'quote) (cadr name) name))
(prefix (lambda ()
(format "%s%s"
kind
(if name (format-message " `%s' " name) "")))))
(pcase (car form)
((or 'autoload 'custom-declare-variable 'defalias
'defconst 'define-abbrev-table
'defvar 'defvaralias
'custom-declare-face)
(setq kind (nth 0 form))
(setq name (nth 1 form))
(when (and (consp name) (eq (car name) 'quote))
(setq name (cadr name)))
(setq docs (nth 3 form)))
('lambda
(setq kind "") ; can't be "function", unfortunately
(setq docs (nth 2 form))))
(when (and kind docs (stringp docs))
(let ((col (max byte-compile-docstring-max-column fill-column)))
(when (and (byte-compile-warning-enabled-p 'docstrings-wide)
(byte-compile--wide-docstring-p docs col))
(byte-compile-warn-x
name
"%sdocstring wider than %s characters" (funcall prefix) col)))
;; There's a "naked" ' character before a symbol/list, so it
;; should probably be quoted with \=.
(when (string-match-p (rx (| (in " \t") bol)
(? (in "\"#"))
"'"
(in "A-Za-z" "("))
(if name (format-message " `%S' " name) "")))))
(let ((col (max byte-compile-docstring-max-column fill-column)))
(when (and (byte-compile-warning-enabled-p 'docstrings-wide)
(byte-compile--wide-docstring-p docs col))
(byte-compile-warn-x
name
"%sdocstring wider than %s characters" (funcall prefix) col)))
(when (byte-compile-warning-enabled-p 'docstrings-control-chars)
(let ((start 0)
(len (length docs)))
(while (and (< start len)
(string-match (rx (intersection (in (0 . 31) 127)
(not (in "\n\t"))))
docs start))
(let* ((ofs (match-beginning 0))
(c (aref docs ofs)))
;; FIXME: it should be possible to use the exact source position
;; of the control char in most cases, and it would be helpful
(byte-compile-warn-x
name
"%sdocstring contains control char #x%02x (position %d)"
(funcall prefix) c ofs)
(setq start (1+ ofs))))))
;; There's a "naked" ' character before a symbol/list, so it
;; should probably be quoted with \=.
(when (string-match-p (rx (| (in " \t") bol)
(? (in "\"#"))
"'"
(in "A-Za-z" "("))
docs)
(byte-compile-warn-x
name
(concat "%sdocstring has wrong usage of unescaped single quotes"
" (use \\=%c or different quoting such as %c...%c)")
(funcall prefix) ?' ?` ?'))
;; There's a "Unicode quote" in the string -- it should probably
;; be an ASCII one instead.
(when (byte-compile-warning-enabled-p 'docstrings-non-ascii-quotes)
(when (string-match-p (rx (| " \"" (in " \t") bol)
(in ""))
docs)
(byte-compile-warn-x
name
(concat "%sdocstring has wrong usage of unescaped single quotes"
" (use \\=%c or different quoting such as %c...%c)")
(funcall prefix) ?' ?` ?'))
;; There's a "Unicode quote" in the string -- it should probably
;; be an ASCII one instead.
(when (byte-compile-warning-enabled-p 'docstrings-non-ascii-quotes)
(when (string-match-p (rx (| " \"" (in " \t") bol)
(in ""))
docs)
(byte-compile-warn-x
name
"%sdocstring uses curved single quotes; use %s instead of ..."
(funcall prefix) "`...'"))))))
form)
"%sdocstring uses curved single quotes; use %s instead of ..."
(funcall prefix) "`...'"))))))
(defvar byte-compile--\#$) ; Special value that will print as `#$'.
(defvar byte-compile--docstrings nil "Table of already compiled docstrings.")
(defun byte-compile--docstring (doc kind name &optional is-a-value)
(byte-compile--docstring-style-warn doc kind name)
;; Make docstrings dynamic, when applicable.
(cond
((and byte-compile-dynamic-docstrings
;; The native compiler doesn't use those dynamic docstrings.
(not byte-native-compiling)
;; Docstrings can only be dynamic when compiling a file.
byte-compile--\#$)
(let* ((byte-pos (with-memoization
;; Reuse a previously written identical docstring.
;; This is not done out of thriftiness but to try and
;; make sure that "equal" functions remain `equal'.
;; (Often those identical docstrings come from
;; `help-add-fundoc-usage').
;; Needed e.g. for `advice-tests-nadvice'.
(gethash doc byte-compile--docstrings)
(byte-compile-output-as-comment doc nil)))
(newdoc (cons byte-compile--\#$ byte-pos)))
(if is-a-value newdoc (macroexp-quote newdoc))))
(t doc)))
;; If we have compiled any calls to functions which are not known to be
;; defined, issue a warning enumerating them.
@ -1845,6 +1871,8 @@ It is too wide if it has any lines longer than the largest of
;; macroenvironment.
(copy-alist byte-compile-initial-macro-environment))
(byte-compile--outbuffer nil)
(byte-compile--\#$ nil)
(byte-compile--docstrings (make-hash-table :test 'equal))
(overriding-plist-environment nil)
(byte-compile-function-environment nil)
(byte-compile-bound-variables nil)
@ -1858,7 +1886,6 @@ It is too wide if it has any lines longer than the largest of
;;
(byte-compile-verbose byte-compile-verbose)
(byte-optimize byte-optimize)
(byte-compile-dynamic byte-compile-dynamic)
(byte-compile-dynamic-docstrings
byte-compile-dynamic-docstrings)
(byte-compile-warnings byte-compile-warnings)
@ -2373,7 +2400,12 @@ With argument ARG, insert value in current buffer after the form."
(setq case-fold-search nil))
(displaying-byte-compile-warnings
(with-current-buffer inbuffer
(when byte-compile-current-file
(when byte-compile-dest-file
(setq byte-compile--\#$
(copy-sequence ;It needs to be a fresh new object.
;; Also it stands for the `load-file-name' when the `.elc' will
;; be loaded, so make it look like it.
byte-compile-dest-file))
(byte-compile-insert-header byte-compile-current-file
byte-compile--outbuffer)
;; Instruct native-comp to ignore this file.
@ -2428,8 +2460,7 @@ With argument ARG, insert value in current buffer after the form."
(defun byte-compile-insert-header (_filename outbuffer)
"Insert a header at the start of OUTBUFFER.
Call from the source buffer."
(let ((dynamic byte-compile-dynamic)
(optimize byte-optimize))
(let ((optimize byte-optimize))
(with-current-buffer outbuffer
(goto-char (point-min))
;; The magic number of .elc files is ";ELC", or 0x3B454C43. After
@ -2463,18 +2494,11 @@ Call from the source buffer."
((eq optimize 'byte) " byte-level optimization only")
(optimize " all optimizations")
(t "out optimization"))
".\n"
(if dynamic ";;; Function definitions are lazy-loaded.\n"
"")
"\n\n"))))
".\n\n\n"))))
(defun byte-compile-output-file-form (form)
;; Write the given form to the output buffer, being careful of docstrings
;; (for `byte-compile-dynamic-docstrings') in defvar, defvaralias,
;; defconst, autoload, and custom-declare-variable.
;; defalias calls are output directly by byte-compile-file-form-defmumble;
;; it does not pay to first build the defalias in defmumble and then parse
;; it here.
;; (for `byte-compile-dynamic-docstrings').
(when byte-native-compiling
;; Spill output for the native compiler here
(push (make-byte-to-native-top-level :form form :lexical lexical-binding)
@ -2484,153 +2508,17 @@ Call from the source buffer."
(print-level nil)
(print-quoted t)
(print-gensym t)
(print-circle t)) ; Handle circular data structures.
(if (memq (car-safe form) '(defvar defvaralias defconst
autoload custom-declare-variable))
(byte-compile-output-docform nil nil nil '("\n(" ")") form nil 3 nil
(memq (car form)
'(defvaralias autoload
custom-declare-variable)))
(princ "\n" byte-compile--outbuffer)
(prin1 form byte-compile--outbuffer)
nil)))
(print-circle t)
(print-continuous-numbering t)
(print-number-table (make-hash-table :test #'eq)))
(when byte-compile--\#$
(puthash byte-compile--\#$ "#$" print-number-table))
(princ "\n" byte-compile--outbuffer)
(prin1 form byte-compile--outbuffer)
nil))
(defvar byte-compile--for-effect)
(defun byte-compile--output-docform-recurse
(info position form cvecindex docindex specindex quoted)
"Print a form with a doc string. INFO is (prefix postfix).
POSITION is where the next doc string is to be inserted.
CVECINDEX is the index in the FORM of the constant vector, or nil.
DOCINDEX is the index of the doc string (or nil) in the FORM.
If SPECINDEX is non-nil, it is the index in FORM
of the function bytecode string. In that case,
we output that argument and the following argument
\(the constants vector) together, for lazy loading.
QUOTED says that we have to put a quote before the
list that represents a doc string reference.
`defvaralias', `autoload' and `custom-declare-variable' need that.
Return the position after any inserted docstrings as comments."
(let ((index 0)
doc-string-position)
;; Insert the doc string, and make it a comment with #@LENGTH.
(when (and byte-compile-dynamic-docstrings
(stringp (nth docindex form)))
(goto-char position)
(setq doc-string-position
(byte-compile-output-as-comment
(nth docindex form) nil)
position (point))
(goto-char (point-max)))
(insert (car info))
(prin1 (car form) byte-compile--outbuffer)
(while (setq form (cdr form))
(setq index (1+ index))
(insert " ")
(cond ((and (numberp specindex) (= index specindex)
;; Don't handle the definition dynamically
;; if it refers (or might refer)
;; to objects already output
;; (for instance, gensyms in the arg list).
(let (non-nil)
(when (hash-table-p print-number-table)
(maphash (lambda (_k v) (if v (setq non-nil t)))
print-number-table))
(not non-nil)))
;; Output the byte code and constants specially
;; for lazy dynamic loading.
(goto-char position)
(let ((lazy-position (byte-compile-output-as-comment
(cons (car form) (nth 1 form))
t)))
(setq position (point))
(goto-char (point-max))
(princ (format "(#$ . %d) nil" lazy-position)
byte-compile--outbuffer)
(setq form (cdr form))
(setq index (1+ index))))
((eq index cvecindex)
(let* ((cvec (car form))
(len (length cvec))
(index2 0)
elt)
(insert "[")
(while (< index2 len)
(setq elt (aref cvec index2))
(if (byte-code-function-p elt)
(setq position
(byte-compile--output-docform-recurse
'("#[" "]") position
(append elt nil) ; Convert the vector to a list.
2 4 specindex nil))
(prin1 elt byte-compile--outbuffer))
(setq index2 (1+ index2))
(unless (eq index2 len)
(insert " ")))
(insert "]")))
((= index docindex)
(cond
(doc-string-position
(princ (format (if quoted "'(#$ . %d)" "(#$ . %d)")
doc-string-position)
byte-compile--outbuffer))
((stringp (car form))
(let ((print-escape-newlines nil))
(goto-char (prog1 (1+ (point))
(prin1 (car form)
byte-compile--outbuffer)))
(insert "\\\n")
(goto-char (point-max))))
(t (prin1 (car form) byte-compile--outbuffer))))
(t (prin1 (car form) byte-compile--outbuffer))))
(insert (cadr info))
position))
(defun byte-compile-output-docform (preface tailpiece name info form
cvecindex docindex
specindex quoted)
"Print a form with a doc string. INFO is (prefix postfix).
If PREFACE, NAME, and TAILPIECE are non-nil, print them too,
before/after INFO and the FORM but after the doc string itself.
CVECINDEX is the index in the FORM of the constant vector, or nil.
DOCINDEX is the index of the doc string (or nil) in the FORM.
If SPECINDEX is non-nil, it is the index in FORM
of the function bytecode string. In that case,
we output that argument and the following argument
\(the constants vector) together, for lazy loading.
QUOTED says that we have to put a quote before the
list that represents a doc string reference.
`defvaralias', `autoload' and `custom-declare-variable' need that."
;; We need to examine byte-compile-dynamic-docstrings
;; in the input buffer (now current), not in the output buffer.
(let ((dynamic-docstrings byte-compile-dynamic-docstrings))
(with-current-buffer byte-compile--outbuffer
(let ((byte-compile-dynamic-docstrings dynamic-docstrings)
(position (point))
(print-continuous-numbering t)
print-number-table
;; FIXME: The bindings below are only needed for when we're
;; called from ...-defmumble.
(print-escape-newlines t)
(print-length nil)
(print-level nil)
(print-quoted t)
(print-gensym t)
(print-circle t)) ; Handle circular data structures.
(when preface
;; FIXME: We don't handle uninterned names correctly.
;; E.g. if cl-define-compiler-macro uses uninterned name we get:
;; (defalias '#1=#:foo--cmacro #[514 ...])
;; (put 'foo 'compiler-macro '#:foo--cmacro)
(insert preface)
(prin1 name byte-compile--outbuffer))
(byte-compile--output-docform-recurse
info position form cvecindex docindex specindex quoted)
(when tailpiece
(insert tailpiece))))))
(defun byte-compile-keep-pending (form &optional handler)
(if (memq byte-optimize '(t source))
(setq form (byte-optimize-one-form form t)))
@ -2650,7 +2538,7 @@ list that represents a doc string reference.
(if byte-compile-output
(let ((form (byte-compile-out-toplevel t 'file)))
(cond ((eq (car-safe form) 'progn)
(mapc 'byte-compile-output-file-form (cdr form)))
(mapc #'byte-compile-output-file-form (cdr form)))
(form
(byte-compile-output-file-form form)))
(setq byte-compile-constants nil
@ -2725,12 +2613,12 @@ list that represents a doc string reference.
(setq byte-compile-unresolved-functions
(delq (assq funsym byte-compile-unresolved-functions)
byte-compile-unresolved-functions)))))
(if (stringp (nth 3 form))
(prog1
form
(byte-compile-docstring-style-warn form))
;; No doc string, so we can compile this as a normal form.
(byte-compile-keep-pending form 'byte-compile-normal-call)))
(let* ((doc (nth 3 form))
(newdoc (if (not (stringp doc)) doc
(byte-compile--docstring
doc 'autoload (nth 1 form)))))
(byte-compile-keep-pending (byte-compile--list-with-n form 3 newdoc)
#'byte-compile-normal-call)))
(put 'defvar 'byte-hunk-handler 'byte-compile-file-form-defvar)
(put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar)
@ -2742,9 +2630,10 @@ list that represents a doc string reference.
(byte-compile-warn-x
sym "global/dynamic var `%s' lacks a prefix" sym)))
(defun byte-compile--declare-var (sym)
(defun byte-compile--declare-var (sym &optional not-toplevel)
(byte-compile--check-prefixed-var sym)
(when (memq sym byte-compile-lexical-variables)
(when (and (not not-toplevel)
(memq sym byte-compile-lexical-variables))
(setq byte-compile-lexical-variables
(delq sym byte-compile-lexical-variables))
(when (byte-compile-warning-enabled-p 'lexical sym)
@ -2753,19 +2642,7 @@ list that represents a doc string reference.
(push sym byte-compile--seen-defvars))
(defun byte-compile-file-form-defvar (form)
(let ((sym (nth 1 form)))
(byte-compile--declare-var sym)
(if (eq (car form) 'defconst)
(push sym byte-compile-const-variables)))
(if (and (null (cddr form)) ;No `value' provided.
(eq (car form) 'defvar)) ;Just a declaration.
nil
(byte-compile-docstring-style-warn form)
(setq form (copy-sequence form))
(when (consp (nth 2 form))
(setcar (cdr (cdr form))
(byte-compile-top-level (nth 2 form) nil 'file)))
form))
(byte-compile-defvar form 'toplevel))
(put 'define-abbrev-table 'byte-hunk-handler
'byte-compile-file-form-defvar-function)
@ -2773,26 +2650,37 @@ list that represents a doc string reference.
(defun byte-compile-file-form-defvar-function (form)
(pcase-let (((or `',name (let name nil)) (nth 1 form)))
(if name (byte-compile--declare-var name)))
;; Variable aliases are better declared before the corresponding variable,
;; since it makes it more likely that only one of the two vars has a value
;; before the `defvaralias' gets executed, which avoids the need to
;; merge values.
(pcase form
(`(defvaralias ,_ ',newname . ,_)
(when (memq newname byte-compile-bound-variables)
(if (byte-compile-warning-enabled-p 'suspicious)
(byte-compile-warn-x
newname
"Alias for `%S' should be declared before its referent" newname)))))
(byte-compile-docstring-style-warn form)
(byte-compile-keep-pending form))
(if name (byte-compile--declare-var name))
;; Variable aliases are better declared before the corresponding variable,
;; since it makes it more likely that only one of the two vars has a value
;; before the `defvaralias' gets executed, which avoids the need to
;; merge values.
(pcase form
(`(defvaralias ,_ ',newname . ,_)
(when (memq newname byte-compile-bound-variables)
(if (byte-compile-warning-enabled-p 'suspicious)
(byte-compile-warn-x
newname
"Alias for `%S' should be declared before its referent"
newname)))))
(let ((doc (nth 3 form)))
(when (stringp doc)
(setcar (nthcdr 3 form)
(byte-compile--docstring doc (nth 0 form) name))))
(byte-compile-keep-pending form)))
(put 'custom-declare-variable 'byte-hunk-handler
'byte-compile-file-form-defvar-function)
(put 'custom-declare-face 'byte-hunk-handler
'byte-compile-docstring-style-warn)
#'byte-compile--custom-declare-face)
(defun byte-compile--custom-declare-face (form)
(let ((kind (nth 0 form)) (name (nth 1 form)) (docs (nth 3 form)))
(when (stringp docs)
(let ((newdocs (byte-compile--docstring docs kind name)))
(unless (eq docs newdocs)
(setq form (byte-compile--list-with-n form 3 newdocs)))))
form))
(put 'require 'byte-hunk-handler 'byte-compile-file-form-require)
(defun byte-compile-file-form-require (form)
@ -2946,34 +2834,24 @@ not to take responsibility for the actual compilation of the code."
(cons (cons bare-name code)
(symbol-value this-kind))))
(if rest
;; There are additional args to `defalias' (like maybe a docstring)
;; that the code below can't handle: punt!
nil
;; Otherwise, we have a bona-fide defun/defmacro definition, and use
;; special code to allow dynamic docstrings and byte-code.
(byte-compile-flush-pending)
(byte-compile-flush-pending)
(let ((newform `(defalias ',bare-name
,(if macro `'(macro . ,code) code) ,@rest)))
(when byte-native-compiling
;; Spill output for the native compiler here.
;; Don't let `byte-compile-output-file-form' push the form to
;; `byte-to-native-top-level-forms' because we want to use
;; `make-byte-to-native-func-def' when possible.
(push
(if macro
(if (or macro rest)
(make-byte-to-native-top-level
:form `(defalias ',name '(macro . ,code) nil)
:form newform
:lexical lexical-binding)
(make-byte-to-native-func-def :name name
:byte-func code))
byte-to-native-top-level-forms))
;; Output the form by hand, that's much simpler than having
;; b-c-output-file-form analyze the defalias.
(byte-compile-output-docform
"\n(defalias '" ")"
bare-name
(if macro '(" '(macro . #[" "])") '(" #[" "]"))
(append code nil) ; Turn byte-code-function-p into list.
2 4
(and (atom code) byte-compile-dynamic 1)
nil)
t)))))
(let ((byte-native-compiling nil))
(byte-compile-output-file-form newform)))
t))))
(defun byte-compile-output-as-comment (exp quoted)
"Print Lisp object EXP in the output file at point, inside a comment.
@ -3018,18 +2896,10 @@ otherwise, print without quoting."
(defun byte-compile--reify-function (fun)
"Return an expression which will evaluate to a function value FUN.
FUN should be either a `lambda' value or a `closure' value."
(pcase-let* (((or (and `(lambda ,args . ,body) (let env nil))
`(closure ,env ,args . ,body))
fun)
(preamble nil)
FUN should be an interpreted closure."
(pcase-let* ((`(closure ,env ,args . ,body) fun)
(`(,preamble . ,body) (macroexp-parse-body body))
(renv ()))
;; Split docstring and `interactive' form from body.
(when (stringp (car body))
(push (pop body) preamble))
(when (eq (car-safe (car body)) 'interactive)
(push (pop body) preamble))
(setq preamble (nreverse preamble))
;; Turn the function's closed vars (if any) into local let bindings.
(dolist (binding env)
(cond
@ -3051,41 +2921,39 @@ If FORM is a lambda or a macro, byte-compile it as a function."
(fun (if (symbolp form)
(symbol-function form)
form))
(macro (eq (car-safe fun) 'macro)))
(if macro
(setq fun (cdr fun)))
(prog1
(cond
;; Up until Emacs-24.1, byte-compile silently did nothing
;; when asked to compile something invalid. So let's tone
;; down the complaint from an error to a simple message for
;; the known case where signaling an error causes problems.
((compiled-function-p fun)
(message "Function %s is already compiled"
(if (symbolp form) form "provided"))
fun)
(t
(let (final-eval)
(when (or (symbolp form) (eq (car-safe fun) 'closure))
;; `fun' is a function *value*, so try to recover its corresponding
;; source code.
(setq lexical-binding (eq (car fun) 'closure))
(setq fun (byte-compile--reify-function fun))
(setq final-eval t))
;; Expand macros.
(setq fun (byte-compile-preprocess fun))
(setq fun (byte-compile-top-level fun nil 'eval))
(if (symbolp form)
;; byte-compile-top-level returns an *expression* equivalent to the
;; `fun' expression, so we need to evaluate it, tho normally
;; this is not needed because the expression is just a constant
;; byte-code object, which is self-evaluating.
(setq fun (eval fun t)))
(if final-eval
(setq fun (eval fun t)))
(if macro (push 'macro fun))
(if (symbolp form) (fset form fun))
fun))))))))
(macro (eq (car-safe fun) 'macro))
(need-a-value nil))
(when macro
(setq need-a-value t)
(setq fun (cdr fun)))
(cond
;; Up until Emacs-24.1, byte-compile silently did nothing
;; when asked to compile something invalid. So let's tone
;; down the complaint from an error to a simple message for
;; the known case where signaling an error causes problems.
((compiled-function-p fun)
(message "Function %s is already compiled"
(if (symbolp form) form "provided"))
fun)
(t
(when (or (symbolp form) (eq (car-safe fun) 'closure))
;; `fun' is a function *value*, so try to recover its
;; corresponding source code.
(when (setq lexical-binding (eq (car-safe fun) 'closure))
(setq fun (byte-compile--reify-function fun)))
(setq need-a-value t))
;; Expand macros.
(setq fun (byte-compile-preprocess fun))
(setq fun (byte-compile-top-level fun nil 'eval))
(when need-a-value
;; `byte-compile-top-level' returns an *expression* equivalent to
;; the `fun' expression, so we need to evaluate it, tho normally
;; this is not needed because the expression is just a constant
;; byte-code object, which is self-evaluating.
(setq fun (eval fun lexical-binding)))
(if macro (push 'macro fun))
(if (symbolp form) (fset form fun))
fun))))))
(defun byte-compile-sexp (sexp)
"Compile and return SEXP."
@ -3184,9 +3052,9 @@ lambda-expression."
(setq fun (cons 'lambda fun))
(unless (eq 'lambda (car-safe fun))
(error "Not a lambda list: %S" fun)))
(byte-compile-docstring-style-warn fun)
(byte-compile-check-lambda-list (nth 1 fun))
(let* ((arglist (nth 1 fun))
(bare-arglist (byte-run-strip-symbol-positions arglist)) ; for compile-defun.
(arglistvars (byte-run-strip-symbol-positions
(byte-compile-arglist-vars arglist)))
(byte-compile-bound-variables
@ -3195,16 +3063,22 @@ lambda-expression."
(body (cdr (cdr fun)))
(doc (if (stringp (car body))
(prog1 (car body)
;; Discard the doc string
;; Discard the doc string from the body
;; unless it is the last element of the body.
(if (cdr body)
(setq body (cdr body))))))
(int (assq 'interactive body))
command-modes)
(when lexical-binding
(when arglist
;; byte-compile-make-args-desc lost the args's names,
;; so preserve them in the docstring.
(setq doc (help-add-fundoc-usage doc bare-arglist)))
(dolist (var arglistvars)
(when (assq var byte-compile--known-dynamic-vars)
(byte-compile--warn-lexical-dynamic var 'lambda))))
(when (stringp doc)
(setq doc (byte-compile--docstring doc "" nil 'is-a-value)))
;; Process the interactive spec.
(when int
;; Skip (interactive) if it is in front (the most usual location).
@ -3248,8 +3122,7 @@ lambda-expression."
(and lexical-binding
(byte-compile-make-lambda-lexenv
arglistvars))
reserved-csts))
(bare-arglist (byte-run-strip-symbol-positions arglist))) ; for compile-defun.
reserved-csts)))
;; Build the actual byte-coded function.
(cl-assert (eq 'byte-code (car-safe compiled)))
(let ((out
@ -3261,12 +3134,7 @@ lambda-expression."
;; byte-string, constants-vector, stack depth
(cdr compiled)
;; optionally, the doc string.
(cond ((and lexical-binding arglist)
;; byte-compile-make-args-desc lost the args's names,
;; so preserve them in the docstring.
(list (help-add-fundoc-usage doc bare-arglist)))
((or doc int)
(list doc)))
(when (or doc int) (list doc))
;; optionally, the interactive spec (and the modes the
;; command applies to).
(cond
@ -3820,7 +3688,6 @@ lambda-expression."
(alen (length (cdr form)))
(dynbinds ())
lap)
(fetch-bytecode fun)
(setq lap (byte-decompile-bytecode-1 (aref fun 1) (aref fun 2) t))
;; optimized switch bytecode makes it impossible to guess the correct
;; `byte-compile-depth', which can result in incorrect inlined code.
@ -5147,49 +5014,49 @@ binding slots have been popped."
(push (nth 1 (nth 1 form)) byte-compile-global-not-obsolete-vars))
(byte-compile-normal-call form))
(defun byte-compile-defvar (form)
;; This is not used for file-level defvar/consts.
(when (and (symbolp (nth 1 form))
(not (string-match "[-*/:$]" (symbol-name (nth 1 form))))
(byte-compile-warning-enabled-p 'lexical (nth 1 form)))
(byte-compile-warn-x
(nth 1 form)
"global/dynamic var `%s' lacks a prefix"
(nth 1 form)))
(byte-compile-docstring-style-warn form)
(let ((fun (nth 0 form))
(var (nth 1 form))
(value (nth 2 form))
(string (nth 3 form)))
(when (or (> (length form) 4)
(and (eq fun 'defconst) (null (cddr form))))
(let ((ncall (length (cdr form))))
(byte-compile-warn-x
fun
"`%s' called with %d argument%s, but %s %s"
fun ncall
(if (= 1 ncall) "" "s")
(if (< ncall 2) "requires" "accepts only")
"2-3")))
(push var byte-compile-bound-variables)
(defun byte-compile-defvar (form &optional toplevel)
(let* ((fun (nth 0 form))
(var (nth 1 form))
(value (nth 2 form))
(string (nth 3 form)))
(byte-compile--declare-var var (not toplevel))
(if (eq fun 'defconst)
(push var byte-compile-const-variables))
(when (and string (not (stringp string)))
(cond
((stringp string)
(setq string (byte-compile--docstring string fun var 'is-a-value)))
(string
(byte-compile-warn-x
string
"third arg to `%s %s' is not a string: %s"
fun var string))
;; Delegate the actual work to the function version of the
;; special form, named with a "-1" suffix.
(byte-compile-form-do-effect
(cond
((eq fun 'defconst) `(defconst-1 ',var ,@(nthcdr 2 form)))
((not (cddr form)) `',var) ; A simple (defvar foo) just returns foo.
(t `(defvar-1 ',var
;; Don't eval `value' if `defvar' wouldn't eval it either.
,(if (macroexp-const-p value) value
`(if (boundp ',var) nil ,value))
,@(nthcdr 3 form)))))))
fun var string)))
(if toplevel
;; At top-level we emit calls to defvar/defconst.
(if (and (null (cddr form)) ;No `value' provided.
(eq (car form) 'defvar)) ;Just a declaration.
nil
(let ((tail (nthcdr 4 form)))
(when (or tail string) (push string tail))
(when (cddr form)
(push (if (not (consp value)) value
(byte-compile-top-level value nil 'file))
tail))
`(,fun ,var ,@tail)))
;; At non-top-level, since there is no byte code for
;; defvar/defconst, we delegate the actual work to the function
;; version of the special form, named with a "-1" suffix.
(byte-compile-form-do-effect
(cond
((eq fun 'defconst)
`(defconst-1 ',var ,@(byte-compile--list-with-n
(nthcdr 2 form) 1 (macroexp-quote string))))
((not (cddr form)) `',var) ; A simple (defvar foo) just returns foo.
(t `(defvar-1 ',var
;; Don't eval `value' if `defvar' wouldn't eval it either.
,(if (macroexp-const-p value) value
`(if (boundp ',var) nil ,value))
,@(byte-compile--list-with-n
(nthcdr 3 form) 0 (macroexp-quote string)))))))))
(defun byte-compile-autoload (form)
(and (macroexp-const-p (nth 1 form))
@ -5215,14 +5082,6 @@ binding slots have been popped."
;; For the compilation itself, we could largely get rid of this hunk-handler,
;; if it weren't for the fact that we need to figure out when a defalias
;; defines a macro, so as to add it to byte-compile-macro-environment.
;;
;; FIXME: we also use this hunk-handler to implement the function's
;; dynamic docstring feature (via byte-compile-file-form-defmumble).
;; We should probably actually implement it (more elegantly) in
;; byte-compile-lambda so it applies to all lambdas. We did it here
;; so the resulting .elc format was recognizable by make-docfile,
;; but since then we stopped using DOC for the docstrings of
;; preloaded elc files so that obstacle is gone.
(let ((byte-compile-free-references nil)
(byte-compile-free-assignments nil))
(pcase form
@ -5231,7 +5090,11 @@ binding slots have been popped."
;; - `arg' is the expression to which it is defined.
;; - `rest' is the rest of the arguments.
(`(,_ ',name ,arg . ,rest)
(byte-compile-docstring-style-warn form)
(let ((doc (car rest)))
(when (stringp doc)
(setq rest (byte-compile--list-with-n
rest 0
(byte-compile--docstring doc (nth 0 form) name)))))
(pcase-let*
;; `macro' is non-nil if it defines a macro.
;; `fun' is the function part of `arg' (defaults to `arg').
@ -5900,6 +5763,16 @@ and corresponding effects."
(eval form)
form)))
;; Report comma operator used outside of backquote.
;; Inside backquote, backquote will transform it before it gets here.
(put '\, 'compiler-macro #'bytecomp--report-comma)
(defun bytecomp--report-comma (form &rest _ignore)
(macroexp-warn-and-return
(format-message "`%s' called -- perhaps used not within backquote"
(car form))
form (list 'suspicious (car form)) t))
;; Check for (in)comparable constant values in calls to `eq', `memq' etc.
(defun bytecomp--dodgy-eq-arg-p (x number-ok)

View file

@ -621,12 +621,16 @@ places where they originally did not directly appear."
(cconv-convert exp env extend))
(`(,func . ,forms)
(if (symbolp func)
(if (or (symbolp func) (functionp func))
;; First element is function or whatever function-like forms are:
;; or, and, if, catch, progn, prog1, while, until
`(,func . ,(mapcar (lambda (form)
(cconv-convert form env extend))
forms))
(let ((args (mapcar (lambda (form) (cconv-convert form env extend))
forms)))
(unless (symbolp func)
(byte-compile-warn-x
form
"Use `funcall' instead of `%s' in the function position" func))
`(,func . ,args))
(byte-compile-warn-x form "Malformed function `%S'" func)
nil))

View file

@ -85,6 +85,9 @@ don't know how to recognize (e.g. some macros)."
(let (alist)
(with-temp-buffer
(insert-file-contents file)
;; Ensure shorthands available, as we will be `read'ing Elisp
;; (bug#67523)
(let (enable-local-variables) (hack-local-variables))
;; FIXME we could theoretically be inside a string.
(while (re-search-forward "^[ \t]*\\((declare-function\\)[ \t\n]" nil t)
(let ((pos (match-beginning 1)))
@ -145,64 +148,70 @@ is a string giving details of the error."
(if (file-regular-p fnfile)
(with-temp-buffer
(insert-file-contents fnfile)
(unless cflag
;; If in Elisp, ensure syntax and shorthands available
;; (bug#67523)
(set-syntax-table emacs-lisp-mode-syntax-table)
(let (enable-local-variables) (hack-local-variables)))
;; defsubst's don't _have_ to be known at compile time.
(setq re (format (if cflag
"^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
"^[ \t]*(\\(fset[ \t]+'\\|\
(setq re (if cflag
(format "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
(regexp-opt (mapcar 'cadr fnlist) t))
"^[ \t]*(\\(fset[ \t]+'\\|\
cl-def\\(?:generic\\|method\\|un\\)\\|\
def\\(?:un\\|subst\\|foo\\|method\\|class\\|\
ine-\\(?:derived\\|generic\\|\\(?:global\\(?:ized\\)?-\\)?minor\\)-mode\\|\
\\(?:ine-obsolete-function-\\)?alias[ \t]+'\\|\
ine-overloadable-function\\)\\)\
[ \t]*%s\\([ \t;]+\\|$\\)")
(regexp-opt (mapcar 'cadr fnlist) t)))
[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)\\([ \t;]+\\|$\\)"))
(while (re-search-forward re nil t)
(skip-chars-forward " \t\n")
(setq fn (match-string 2)
type (match-string 1)
;; (min . max) for a fixed number of arguments, or
;; arglists with optional elements.
;; (min) for arglists with &rest.
;; sig = 'err means we could not find an arglist.
sig (cond (cflag
(or
(when (search-forward "," nil t 3)
(skip-chars-forward " \t\n")
;; Assuming minargs and maxargs on same line.
(when (looking-at "\\([0-9]+\\)[ \t]*,[ \t]*\
(setq fn (symbol-name (car (read-from-string (match-string 2)))))
(when (member fn (mapcar 'cadr fnlist))
(setq type (match-string 1)
;; (min . max) for a fixed number of arguments, or
;; arglists with optional elements.
;; (min) for arglists with &rest.
;; sig = 'err means we could not find an arglist.
sig (cond (cflag
(or
(when (search-forward "," nil t 3)
(skip-chars-forward " \t\n")
;; Assuming minargs and maxargs on same line.
(when (looking-at "\\([0-9]+\\)[ \t]*,[ \t]*\
\\([0-9]+\\|MANY\\|UNEVALLED\\)")
(setq minargs (string-to-number
(match-string 1))
maxargs (match-string 2))
(cons minargs (unless (string-match "[^0-9]"
maxargs)
(string-to-number
maxargs)))))
'err))
((string-match
"\\`define-\\(derived\\|generic\\)-mode\\'"
type)
'(0 . 0))
((string-match
"\\`define\\(-global\\(ized\\)?\\)?-minor-mode\\'"
type)
'(0 . 1))
;; Prompt to update.
((string-match
"\\`define-obsolete-function-alias\\>"
type)
'obsolete)
;; Can't easily check arguments in these cases.
((string-match "\\`\\(def\\(alias\\|class\\)\\|\
(setq minargs (string-to-number
(match-string 1))
maxargs (match-string 2))
(cons minargs (unless (string-match "[^0-9]"
maxargs)
(string-to-number
maxargs)))))
'err))
((string-match
"\\`define-\\(derived\\|generic\\)-mode\\'"
type)
'(0 . 0))
((string-match
"\\`define\\(-global\\(ized\\)?\\)?-minor-mode\\'"
type)
'(0 . 1))
;; Prompt to update.
((string-match
"\\`define-obsolete-function-alias\\>"
type)
'obsolete)
;; Can't easily check arguments in these cases.
((string-match "\\`\\(def\\(alias\\|class\\)\\|\
fset\\|\\(?:cl-\\)?defmethod\\)\\>" type)
t)
((looking-at "\\((\\|nil\\)")
(byte-compile-arglist-signature
(read (current-buffer))))
(t
'err))
;; alist of functions and arglist signatures.
siglist (cons (cons fn sig) siglist)))))
t)
((looking-at "\\((\\|nil\\)")
(byte-compile-arglist-signature
(read (current-buffer))))
(t
'err))
;; alist of functions and arglist signatures.
siglist (cons (cons fn sig) siglist))))))
(dolist (e fnlist)
(setq arglist (nth 2 e)
type
@ -319,9 +328,14 @@ Returns non-nil if any false statements are found."
(setq root (directory-file-name (file-relative-name root)))
(or (file-directory-p root)
(error "Directory `%s' not found" root))
(let ((files (directory-files-recursively root "\\.el\\'")))
(when files
(apply #'check-declare-files files))))
(when-let* ((files (directory-files-recursively root "\\.el\\'"))
(files (mapcan (lambda (file)
;; Filter out lock files.
(and (not (string-prefix-p
".#" (file-name-nondirectory file)))
(list file)))
files)))
(apply #'check-declare-files files)))
(provide 'check-declare)

View file

@ -1994,7 +1994,7 @@ from the comment."
(defun-depth (ppss-depth (syntax-ppss)))
(lst nil)
(ret nil)
(oo (make-vector 3 0))) ;substitute obarray for `read'
(oo (obarray-make 3))) ;substitute obarray for `read'
(forward-char 1)
(forward-sexp 1)
(skip-chars-forward " \n\t")

View file

@ -1140,12 +1140,8 @@ MET-NAME is as returned by `cl--generic-load-hist-format'."
(add-hook 'help-fns-describe-function-functions #'cl--generic-describe)
(defun cl--generic-describe (function)
;; Supposedly this is called from help-fns, so help-fns should be loaded at
;; this point.
(declare-function help-fns-short-filename "help-fns" (filename))
(let ((generic (if (symbolp function) (cl--generic function))))
(when generic
(require 'help-mode) ;Needed for `help-function-def' button!
(save-excursion
;; Ensure that we have two blank lines (but not more).
(unless (looking-back "\n\n" (- (point) 2))
@ -1153,33 +1149,49 @@ MET-NAME is as returned by `cl--generic-load-hist-format'."
(insert "This is a generic function.\n\n")
(insert (propertize "Implementations:\n\n" 'face 'bold))
;; Loop over fanciful generics
(dolist (method (cl--generic-method-table generic))
(pcase-let*
((`(,qualifiers ,args ,doc) (cl--generic-method-info method)))
;; FIXME: Add hyperlinks for the types as well.
(let ((print-quoted nil)
(quals (if (length> qualifiers 0)
(concat (substring qualifiers
0 (string-match " *\\'"
qualifiers))
"\n")
"")))
(insert (format "%s%S"
quals
(cons function
(cl--generic-upcase-formal-args args)))))
(let* ((met-name (cl--generic-load-hist-format
function
(cl--generic-method-qualifiers method)
(cl--generic-method-specializers method)))
(file (find-lisp-object-file-name met-name 'cl-defmethod)))
(when file
(insert (substitute-command-keys " in `"))
(help-insert-xref-button (help-fns-short-filename file)
'help-function-def met-name file
'cl-defmethod)
(insert (substitute-command-keys "'.\n"))))
(insert "\n" (or doc "Undocumented") "\n\n")))))))
(cl--map-methods-documentation
function
(lambda (quals signature file doc)
(insert (format "%s%S%s\n\n%s\n\n"
quals signature
(if file (format-message " in `%s'." file) "")
(or doc "Undocumented")))))))))
(defun cl--map-methods-documentation (funname metname-printer)
"Iterate on FUNNAME's methods documentation at point."
;; Supposedly this is called from help-fns, so help-fns should be loaded at
;; this point.
(require 'help-fns)
(declare-function help-fns-short-filename "help-fns" (filename))
(let ((generic (if (symbolp funname) (cl--generic funname))))
(when generic
(require 'help-mode) ;Needed for `help-function-def' button!
;; Loop over fanciful generics
(dolist (method (cl--generic-method-table generic))
(pcase-let*
((`(,qualifiers ,args ,doc) (cl--generic-method-info method))
;; FIXME: Add hyperlinks for the types as well.
(quals (if (length> qualifiers 0)
(concat (substring qualifiers
0 (string-match " *\\'"
qualifiers))
"\n")
""))
(met-name (cl--generic-load-hist-format
funname
(cl--generic-method-qualifiers method)
(cl--generic-method-specializers method)))
(file (find-lisp-object-file-name met-name 'cl-defmethod)))
(funcall metname-printer
quals
(cons funname
(cl--generic-upcase-formal-args args))
(when file
(make-text-button (help-fns-short-filename file) nil
'type 'help-function-def
'help-args
(list met-name file 'cl-defmethod)))
doc))))))
(defun cl--generic-specializers-apply-to-type-p (specializers type)
"Return non-nil if a method with SPECIALIZERS applies to TYPE."

View file

@ -3344,14 +3344,14 @@ Elements of FIELDS can be of the form (NAME PAT) in which case the
contents of field NAME is matched against PAT, or they can be of
the form NAME which is a shorthand for (NAME NAME)."
(declare (debug (sexp &rest [&or (sexp pcase-PAT) sexp])))
`(and (pred (pcase--flip cl-typep ',type))
`(and (pred (cl-typep _ ',type))
,@(mapcar
(lambda (field)
(let* ((name (if (consp field) (car field) field))
(pat (if (consp field) (cadr field) field)))
`(app ,(if (eq (cl-struct-sequence-type type) 'list)
`(nth ,(cl-struct-slot-offset type name))
`(pcase--flip aref ,(cl-struct-slot-offset type name)))
`(aref _ ,(cl-struct-slot-offset type name)))
,pat)))
fields)))
@ -3368,13 +3368,13 @@ the form NAME which is a shorthand for (NAME NAME)."
"Extra special cases for `cl-typep' predicates."
(let* ((x1 pred1) (x2 pred2)
(t1
(and (eq 'pcase--flip (car-safe x1)) (setq x1 (cdr x1))
(eq 'cl-typep (car-safe x1)) (setq x1 (cdr x1))
(and (eq 'cl-typep (car-safe x1)) (setq x1 (cdr x1))
(eq '_ (car-safe x1)) (setq x1 (cdr x1))
(null (cdr-safe x1)) (setq x1 (car x1))
(eq 'quote (car-safe x1)) (cadr x1)))
(t2
(and (eq 'pcase--flip (car-safe x2)) (setq x2 (cdr x2))
(eq 'cl-typep (car-safe x2)) (setq x2 (cdr x2))
(and (eq 'cl-typep (car-safe x2)) (setq x2 (cdr x2))
(eq '_ (car-safe x2)) (setq x2 (cdr x2))
(null (cdr-safe x2)) (setq x2 (car x2))
(eq 'quote (car-safe x2)) (cadr x2))))
(or
@ -3460,6 +3460,7 @@ Of course, we really can't know that for sure, so it's just a heuristic."
(or (cdr (assq sym byte-compile-function-environment))
(cdr (assq sym macroexpand-all-environment))))))
;; Please keep it in sync with `comp-known-predicates'.
(pcase-dolist (`(,type . ,pred)
;; Mostly kept in alphabetical order.
'((array . arrayp)
@ -3487,6 +3488,7 @@ Of course, we really can't know that for sure, so it's just a heuristic."
(natnum . natnump)
(number . numberp)
(null . null)
(obarray . obarrayp)
(overlay . overlayp)
(process . processp)
(real . numberp)
@ -3494,6 +3496,7 @@ Of course, we really can't know that for sure, so it's just a heuristic."
(subr . subrp)
(string . stringp)
(symbol . symbolp)
(symbol-with-pos . symbol-with-pos-p)
(vector . vectorp)
(window . windowp)
;; FIXME: Do we really want to consider these types?
@ -3818,7 +3821,8 @@ STRUCT-TYPE and SLOT-NAME are symbols. INST is a structure instance."
(pcase-defmacro cl-type (type)
"Pcase pattern that matches objects of TYPE.
TYPE is a type descriptor as accepted by `cl-typep', which see."
`(pred (pcase--flip cl-typep ',type)))
`(pred (cl-typep _ ',type)))
;; Local variables:
;; generated-autoload-file: "cl-loaddefs.el"

View file

@ -62,7 +62,7 @@
tree-sitter-parser user-ptr font-object font-entity font-spec
condvar mutex thread terminal hash-table frame buffer function
window process window-configuration overlay integer-or-marker
number-or-marker symbol array)
number-or-marker symbol array obarray)
(number float integer)
(number-or-marker marker number)
(integer bignum fixnum)

View file

@ -240,7 +240,8 @@ Used to modify the compiler environment."
(integer-or-marker-p (function (t) boolean))
(integerp (function (t) boolean))
(interactive-p (function () boolean))
(intern-soft (function ((or string symbol) &optional vector) symbol))
(intern-soft (function ((or string symbol) &optional (or obarray vector))
symbol))
(invocation-directory (function () string))
(invocation-name (function () string))
(isnan (function (float) boolean))
@ -309,7 +310,7 @@ Used to modify the compiler environment."
(numberp (function (t) boolean))
(one-window-p (function (&optional t t) boolean))
(overlayp (function (t) boolean))
(parse-colon-path (function (string) cons))
(parse-colon-path (function (string) list))
(plist-get (function (list t &optional t) t))
(plist-member (function (list t &optional t) list))
(point (function () integer))

View file

@ -44,7 +44,7 @@
;; TODO can we just add t in `cl--typeof-types'?
"Like `cl--typeof-types' but with t as common supertype.")
(cl-defstruct (comp-cstr (:constructor comp-type-to-cstr
(cl-defstruct (comp-cstr (:constructor comp--type-to-cstr
(type &aux
(null (eq type 'null))
(integer (eq type 'integer))
@ -55,7 +55,7 @@
'(nil)))
(range (when integer
'((- . +))))))
(:constructor comp-value-to-cstr
(:constructor comp--value-to-cstr
(value &aux
(integer (integerp value))
(valset (unless integer
@ -63,7 +63,7 @@
(range (when integer
`((,value . ,value))))
(typeset ())))
(:constructor comp-irange-to-cstr
(:constructor comp--irange-to-cstr
(irange &aux
(range (list irange))
(typeset ())))
@ -229,10 +229,10 @@ Return them as multiple value."
;; builds.
(defvar comp-ctxt nil)
(defvar comp-cstr-one (comp-value-to-cstr 1)
(defvar comp-cstr-one (comp--value-to-cstr 1)
"Represent the integer immediate one.")
(defvar comp-cstr-t (comp-type-to-cstr t)
(defvar comp-cstr-t (comp--type-to-cstr t)
"Represent the superclass t.")
@ -249,6 +249,8 @@ Return them as multiple value."
t)
((and (not (symbolp x)) (symbolp y))
nil)
((or (consp x) (consp y)
nil))
(t
(< (sxhash-equal x)
(sxhash-equal y)))))))
@ -1211,14 +1213,14 @@ FN non-nil indicates we are parsing a function lambda list."
('nil
(make-comp-cstr :typeset ()))
('fixnum
(comp-irange-to-cstr `(,most-negative-fixnum . ,most-positive-fixnum)))
(comp--irange-to-cstr `(,most-negative-fixnum . ,most-positive-fixnum)))
('boolean
(comp-type-spec-to-cstr '(member t nil)))
('integer
(comp-irange-to-cstr '(- . +)))
('null (comp-value-to-cstr nil))
(comp--irange-to-cstr '(- . +)))
('null (comp--value-to-cstr nil))
((pred atom)
(comp-type-to-cstr type-spec))
(comp--type-to-cstr type-spec))
(`(or . ,rest)
(apply #'comp-cstr-union-make
(mapcar #'comp-type-spec-to-cstr rest)))
@ -1228,16 +1230,16 @@ FN non-nil indicates we are parsing a function lambda list."
(`(not ,cstr)
(comp-cstr-negation-make (comp-type-spec-to-cstr cstr)))
(`(integer ,(and (pred integerp) l) ,(and (pred integerp) h))
(comp-irange-to-cstr `(,l . ,h)))
(comp--irange-to-cstr `(,l . ,h)))
(`(integer * ,(and (pred integerp) h))
(comp-irange-to-cstr `(- . ,h)))
(comp--irange-to-cstr `(- . ,h)))
(`(integer ,(and (pred integerp) l) *)
(comp-irange-to-cstr `(,l . +)))
(comp--irange-to-cstr `(,l . +)))
(`(float ,(pred comp-star-or-num-p) ,(pred comp-star-or-num-p))
;; No float range support :/
(comp-type-to-cstr 'float))
(comp--type-to-cstr 'float))
(`(member . ,rest)
(apply #'comp-cstr-union-make (mapcar #'comp-value-to-cstr rest)))
(apply #'comp-cstr-union-make (mapcar #'comp--value-to-cstr rest)))
(`(function ,args ,ret)
(make-comp-cstr-f
:args (mapcar (lambda (x)

View file

@ -25,7 +25,7 @@
;; While the main native compiler is implemented in comp.el, when
;; commonly used as a jit compiler it is only loaded by Emacs sub
;; processes performing async compilation. This files contains all
;; processes performing async compilation. This file contains all
;; the code needed to drive async compilations and any Lisp code
;; needed at runtime to run native code.

File diff suppressed because it is too large Load diff

92
lisp/emacs-lisp/compat.el Normal file
View file

@ -0,0 +1,92 @@
;;; compat.el --- Stub of the Compatibility Library -*- lexical-binding: t; -*-
;; Copyright (C) 2021-2024 Free Software Foundation, Inc.
;; Author: \
;; Philip Kaludercic <philipk@posteo.net>, \
;; Daniel Mendler <mail@daniel-mendler.de>
;; Maintainer: \
;; Daniel Mendler <mail@daniel-mendler.de>, \
;; Compat Development <~pkal/compat-devel@lists.sr.ht>,
;; emacs-devel@gnu.org
;; URL: https://github.com/emacs-compat/compat
;; Keywords: lisp, maint
;; This program 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.
;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; The Compat package on ELPA provides forward-compatibility
;; definitions for other packages. While mostly transparent, a
;; minimal API is necessary whenever core definitions change calling
;; conventions (e.g. `plist-get' can be invoked with a predicate from
;; Emacs 29.1 onward). For core packages on ELPA to be able to take
;; advantage of this functionality, the macros `compat-function' and
;; `compat-call' have to be available in the core, usable even if
;; users do not have the Compat package installed, which this file
;; ensures.
;; A basic introduction to Compat is given in the Info node `(elisp)
;; Forwards Compatibility'. Further details on Compat are documented
;; in the Info node `(compat) Top' (installed along with the Compat
;; package) or read the same manual online:
;; https://elpa.gnu.org/packages/doc/compat.html.
;;; Code:
(defmacro compat-function (fun)
"Return compatibility function symbol for FUN.
This is a pseudo-compatibility stub for core packages on ELPA,
that depend on the Compat package, whenever the user doesn't have
the package installed on their current system."
`#',fun)
(defmacro compat-call (fun &rest args)
"Call compatibility function or macro FUN with ARGS.
This is a pseudo-compatibility stub for core packages on ELPA,
that depend on the Compat package, whenever the user doesn't have
the package installed on their current system."
(cons fun args))
;;;; Clever trick to avoid installing Compat if not necessary
;; The versioning scheme of the Compat package follows that of Emacs,
;; to indicate the version of Emacs, that functionality is being
;; provided for. For example, the Compat version number 29.2.3.9
;; would attempt to provide compatibility definitions up to Emacs
;; 29.2, while also designating that this is the third major release
;; and ninth minor release of Compat, for the specific Emacs release.
;; The package version of this file is specified programmatically,
;; instead of giving a fixed version in the header of this file. This
;; is done to ensure that the version of compat.el provided by Emacs
;; always corresponds to the current version of Emacs. In addition to
;; the major-minor version, a large "major release" makes sure that
;; the built-in version of Compat is always preferred over an external
;; installation. This means that if a package specifies a dependency
;; on Compat which matches the current or an older version of Emacs
;; that is being used, no additional dependencies have to be
;; downloaded.
;;
;; Further details and background on this file can be found in the
;; bug#66554 discussion.
;;;###autoload (push (list 'compat
;;;###autoload emacs-major-version
;;;###autoload emacs-minor-version
;;;###autoload 9999)
;;;###autoload package--builtin-versions)
(provide 'compat)
;;; compat.el ends here

View file

@ -365,137 +365,6 @@ which more-or-less shadow%s %s's corresponding table%s."
docstring))
;;; OBSOLETE
;; The functions below are only provided for backward compatibility with
;; code byte-compiled with versions of derived.el prior to Emacs-21.
(defsubst derived-mode-setup-function-name (mode)
"Construct a setup-function name based on a MODE name."
(declare (obsolete nil "28.1"))
(intern (concat (symbol-name mode) "-setup")))
;; Utility functions for defining a derived mode.
;;;###autoload
(defun derived-mode-init-mode-variables (mode)
"Initialize variables for a new MODE.
Right now, if they don't already exist, set up a blank keymap, an
empty syntax table, and an empty abbrev table -- these will be merged
the first time the mode is used."
(if (boundp (derived-mode-map-name mode))
t
(eval `(defvar ,(derived-mode-map-name mode)
(make-sparse-keymap)
,(format "Keymap for %s." mode)))
(put (derived-mode-map-name mode) 'derived-mode-unmerged t))
(if (boundp (derived-mode-syntax-table-name mode))
t
(eval `(defvar ,(derived-mode-syntax-table-name mode)
;; Make a syntax table which doesn't specify anything
;; for any char. Valid data will be merged in by
;; derived-mode-merge-syntax-tables.
(make-char-table 'syntax-table nil)
,(format "Syntax table for %s." mode)))
(put (derived-mode-syntax-table-name mode) 'derived-mode-unmerged t))
(if (boundp (derived-mode-abbrev-table-name mode))
t
(eval `(defvar ,(derived-mode-abbrev-table-name mode)
(progn
(define-abbrev-table (derived-mode-abbrev-table-name ',mode) nil)
(make-abbrev-table))
,(format "Abbrev table for %s." mode)))))
;; Utility functions for running a derived mode.
(defun derived-mode-set-keymap (mode)
"Set the keymap of the new MODE, maybe merging with the parent."
(let* ((map-name (derived-mode-map-name mode))
(new-map (eval map-name))
(old-map (current-local-map)))
(and old-map
(get map-name 'derived-mode-unmerged)
(derived-mode-merge-keymaps old-map new-map))
(put map-name 'derived-mode-unmerged nil)
(use-local-map new-map)))
(defun derived-mode-set-syntax-table (mode)
"Set the syntax table of the new MODE, maybe merging with the parent."
(let* ((table-name (derived-mode-syntax-table-name mode))
(old-table (syntax-table))
(new-table (eval table-name)))
(if (get table-name 'derived-mode-unmerged)
(derived-mode-merge-syntax-tables old-table new-table))
(put table-name 'derived-mode-unmerged nil)
(set-syntax-table new-table)))
(defun derived-mode-set-abbrev-table (mode)
"Set the abbrev table for MODE if it exists.
Always merge its parent into it, since the merge is non-destructive."
(let* ((table-name (derived-mode-abbrev-table-name mode))
(old-table local-abbrev-table)
(new-table (eval table-name)))
(derived-mode-merge-abbrev-tables old-table new-table)
(setq local-abbrev-table new-table)))
(defun derived-mode-run-hooks (mode)
"Run the mode hook for MODE."
(let ((hooks-name (derived-mode-hook-name mode)))
(if (boundp hooks-name)
(run-hooks hooks-name))))
;; Functions to merge maps and tables.
(defun derived-mode-merge-keymaps (old new)
"Merge an OLD keymap into a NEW one.
The old keymap is set to be the last cdr of the new one, so that there will
be automatic inheritance."
;; ?? Can this just use `set-keymap-parent'?
(let ((tail new))
;; Scan the NEW map for prefix keys.
(while (consp tail)
(and (consp (car tail))
(let* ((key (vector (car (car tail))))
(subnew (lookup-key new key))
(subold (lookup-key old key)))
;; If KEY is a prefix key in both OLD and NEW, merge them.
(and (keymapp subnew) (keymapp subold)
(derived-mode-merge-keymaps subold subnew))))
(and (vectorp (car tail))
;; Search a vector of ASCII char bindings for prefix keys.
(let ((i (1- (length (car tail)))))
(while (>= i 0)
(let* ((key (vector i))
(subnew (lookup-key new key))
(subold (lookup-key old key)))
;; If KEY is a prefix key in both OLD and NEW, merge them.
(and (keymapp subnew) (keymapp subold)
(derived-mode-merge-keymaps subold subnew)))
(setq i (1- i)))))
(setq tail (cdr tail))))
(setcdr (nthcdr (1- (length new)) new) old))
(defun derived-mode-merge-syntax-tables (old new)
"Merge an OLD syntax table into a NEW one.
Where the new table already has an entry, nothing is copied from the old one."
(set-char-table-parent new old))
;; Merge an old abbrev table into a new one.
;; This function requires internal knowledge of how abbrev tables work,
;; presuming that they are obarrays with the abbrev as the symbol, the expansion
;; as the value of the symbol, and the hook as the function definition.
(defun derived-mode-merge-abbrev-tables (old new)
(if old
(mapatoms
(lambda (symbol)
(or (intern-soft (symbol-name symbol) new)
(define-abbrev new (symbol-name symbol)
(symbol-value symbol) (symbol-function symbol))))
old)))
(provide 'derived)
;;; derived.el ends here

View file

@ -191,8 +191,6 @@ OBJ should be a call to BYTE-CODE generated by the byte compiler."
(if (consp obj)
(setq bytes (car (cdr obj)) ;the byte code
constvec (car (cdr (cdr obj)))) ;constant vector
;; If it is lazy-loaded, load it now
(fetch-bytecode obj)
(setq bytes (aref obj 1)
constvec (aref obj 2)))
(cl-assert (not (multibyte-string-p bytes)))

View file

@ -132,7 +132,7 @@ it is disabled.")
(string-replace "'" "\\='" (format "%S" getter)))))
(let ((start (point)))
(insert argdoc)
(when (fboundp 'fill-region)
(when (fboundp 'fill-region) ;Don't break bootstrap!
(fill-region start (point) 'left t))))
;; Finally, insert the keymap.
(when (and (boundp keymap-sym)

View file

@ -481,7 +481,7 @@ just FUNCTION is printed."
(edebug--eval-defun #'eval-defun edebug-it)))
;;;###autoload
(defalias 'edebug-defun 'edebug-eval-top-level-form)
(defalias 'edebug-defun #'edebug-eval-top-level-form)
;;;###autoload
(defun edebug-eval-top-level-form ()
@ -1729,7 +1729,7 @@ contains a circular object."
(defun edebug-match-form (cursor)
(list (edebug-form cursor)))
(defalias 'edebug-match-place 'edebug-match-form)
(defalias 'edebug-match-place #'edebug-match-form)
;; Currently identical to edebug-match-form.
;; This is for common lisp setf-style place arguments.
@ -2277,12 +2277,7 @@ only be active while Edebug is. It checks `debug-on-error' to see
whether it should call the debugger. When execution is resumed, the
error is signaled again."
(if (and (listp debug-on-error) (memq signal-name debug-on-error))
(edebug 'error (cons signal-name signal-data)))
;; If we reach here without another non-local exit, then send signal again.
;; i.e. the signal is not continuable, yet.
;; Avoid infinite recursion.
(let ((signal-hook-function nil))
(signal signal-name signal-data)))
(edebug 'error (cons signal-name signal-data))))
;;; Entering Edebug
@ -2326,6 +2321,12 @@ and run its entry function, and set up `edebug-before' and
(debug-on-error (or debug-on-error edebug-on-error))
(debug-on-quit edebug-on-quit))
(unwind-protect
;; FIXME: We could replace this `signal-hook-function' with
;; a cleaner `handler-bind' but then we wouldn't be able to
;; install it here (i.e. once and for all when entering
;; an Edebugged function), but instead it would have to
;; be installed into a modified `edebug-after' which wraps
;; the `handler-bind' around its argument(s). :-(
(let ((signal-hook-function #'edebug-signal))
(setq edebug-execution-mode (or edebug-next-execution-mode
edebug-initial-mode
@ -3348,7 +3349,7 @@ With prefix argument, make it a temporary breakpoint."
(message "%s" msg)))
(defalias 'edebug-step-through-mode 'edebug-step-mode)
(defalias 'edebug-step-through-mode #'edebug-step-mode)
(defun edebug-step-mode ()
"Proceed to next stop point."
@ -3836,12 +3837,12 @@ be installed in `emacs-lisp-mode-map'.")
;; Global GUD bindings for all emacs-lisp-mode buffers.
(unless edebug-inhibit-emacs-lisp-mode-bindings
(define-key emacs-lisp-mode-map "\C-x\C-a\C-s" 'edebug-step-mode)
(define-key emacs-lisp-mode-map "\C-x\C-a\C-n" 'edebug-next-mode)
(define-key emacs-lisp-mode-map "\C-x\C-a\C-c" 'edebug-go-mode)
(define-key emacs-lisp-mode-map "\C-x\C-a\C-l" 'edebug-where)
(define-key emacs-lisp-mode-map "\C-x\C-a\C-s" #'edebug-step-mode)
(define-key emacs-lisp-mode-map "\C-x\C-a\C-n" #'edebug-next-mode)
(define-key emacs-lisp-mode-map "\C-x\C-a\C-c" #'edebug-go-mode)
(define-key emacs-lisp-mode-map "\C-x\C-a\C-l" #'edebug-where)
;; The following isn't a GUD binding.
(define-key emacs-lisp-mode-map "\C-x\C-a\C-m" 'edebug-set-initial-mode))
(define-key emacs-lisp-mode-map "\C-x\C-a\C-m" #'edebug-set-initial-mode))
(defvar-keymap edebug-mode-map
:parent emacs-lisp-mode-map

Some files were not shown because too many files have changed in this diff Show more