Merge branch 'master' into feature/positioned-lambdas

This commit is contained in:
Alan Mackenzie 2024-03-10 18:21:20 +00:00
commit ec0da34469
377 changed files with 13654 additions and 7123 deletions

View file

@ -23,16 +23,20 @@
(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)
(mode . bug-reference-prog)))
(c-ts-mode . ((c-ts-mode-indent-style . gnu)
(indent-tabs-mode . t)
(mode . bug-reference-prog)))
(c-ts-mode . ((c-ts-mode-indent-style . gnu))) ;Inherits `c-mode' settings.
(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

@ -812,6 +812,7 @@ install-info: info
done; \
(cd "$${thisdir}"; \
${INSTALL_INFO} --info-dir="$(DESTDIR)${infodir}" "$(DESTDIR)${infodir}/$$elt"); \
cp elisp_type_hierarchy* $(DESTDIR)${infodir}/; \
done; \
fi
@ -954,6 +955,7 @@ uninstall: uninstall-$(NTDIR) uninstall-doc uninstall-gsettings-schemas
ext=.gz; else ext=; fi; \
rm -f $$elt$$ext $$elt-[1-9]$$ext $$elt-[1-9][0-9]$$ext; \
done; \
rm -f elisp_type_hierarchy.jpg elisp_type_hierarchy.txt; \
fi)
(if [ -n "${GZIP_PROG}" ]; then \
ext=.gz; else ext=; fi; \

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

@ -0,0 +1,125 @@
;;; syncdoc-type-hierarchy.el--- -*- lexical-binding: t -*-
;; Copyright (C) 2023-2024 Free Software Foundation, Inc.
;; Author: Andrea Corallo <acorallo@gnu.org>
;; Keywords: documentation
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; This file is used to keep the type hierarchy representation present
;; in the elisp manual in sync with the current type hierarchy. This
;; is specified in `cl--direct-supertypes-of-type' in cl-preloaded.el, so each
;; time `cl--direct-supertypes-of-type' is modified
;; `syncdoc-update-type-hierarchy' must be run before the
;; documentation is regenerated.
;; We do not call this directly from make docs in order not to add a
;; dependency on the tool "dot".
;;; Code:
(require 'cl-lib)
(require 'org-table)
(defconst syncdoc-file (or (macroexp-file-name) buffer-file-name))
(defconst syncdoc-emacs-repo-dir
(expand-file-name "../" (file-name-directory syncdoc-file)))
(defconst syncdoc-lispref-dir
(expand-file-name "doc/lispref/" syncdoc-emacs-repo-dir))
(defconst syncdoc-all-types
(let (res)
(mapatoms (lambda (type)
(when (cl-find-class type)
(push type res)))
obarray)
res)
"List of all types.")
(declare-function 'comp--direct-supertypes "comp-cstr.el")
(defconst syncdoc-hierarchy
(progn
;; Require it here so we don't load it before `syncdoc-all-types' is
;; computed.
(require 'comp-cstr)
(cl-loop
with comp-ctxt = (make-comp-cstr-ctxt)
with h = (make-hash-table :test #'eq)
for type in syncdoc-all-types
do (puthash type (comp--direct-supertypes type) h)
finally return h)))
(defun syncdoc-insert-dot-content (rankdir)
(maphash (lambda (child parents)
(cl-loop for parent in parents
do (insert " \"" (symbol-name child) "\" -> \""
(symbol-name parent) "\";\n")))
syncdoc-hierarchy)
(sort-lines nil (point-min) (point-max))
(goto-char (point-min))
(insert "digraph {\n rankdir=\"" rankdir "\";\n")
(goto-char (point-max))
(insert "}\n"))
(defun syncdoc-make-type-table (file)
(with-temp-file file
(insert "|Type| Derived Types|\n|-\n")
(let ((subtypes ()))
;; First collect info from the "builtin" types.
(maphash (lambda (type parents)
(dolist (parent parents)
(push type (alist-get parent subtypes))))
syncdoc-hierarchy)
(cl-loop for (type . children) in (reverse subtypes)
do (insert "|" (symbol-name type) " |")
do (cl-loop with x = 0
for child in (reverse children)
for child-len = (length (symbol-name child))
when (> (+ x child-len 2) 60)
do (progn
(insert "|\n||")
(setq x 0))
do (insert (symbol-name child) " ")
do (cl-incf x (1+ child-len)) )
do (insert "\n")))
(org-table-align)))
(defun syncdoc-update-type-hierarchy0 ()
"Update the type hierarchy representation used by the elisp manual."
(with-temp-buffer
(syncdoc-insert-dot-content "LR")
(with-demoted-errors "%S" ;In case "dot" is not found!
(call-process-region nil nil "dot" t (current-buffer) nil "-Tjpg" "-o"
(expand-file-name "elisp_type_hierarchy.jpg"
syncdoc-lispref-dir))))
(syncdoc-make-type-table (expand-file-name "elisp_type_hierarchy.txt"
syncdoc-lispref-dir)))
(defun syncdoc-update-type-hierarchy ()
"Update the type hierarchy representation used by the elisp manual."
(interactive)
(call-process (expand-file-name "src/emacs" syncdoc-emacs-repo-dir)
nil t t "-Q" "--batch" "-l" syncdoc-file
"-f" "syncdoc-update-type-hierarchy0"))
;;; syncdoc-type-hierarchy.el ends here

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

@ -474,33 +474,200 @@ version of Android being used:
@itemize @bullet
@item
Under more or less recent releases of Android, such as Android 6.0 and
later, Emacs only receives the following permissions upon
installation:
later, Emacs only receives the following permissions upon installation,
subject to the presence or absence of individual permissions in the
version of Android installed:
@itemize @minus
@item
@code{android.permission.VIBRATE}
@code{android.permission.ACCESS_ADSERVICES_AD_ID}
@item
@code{android.permission.ACCESS_ADSERVICES_ATTRIBUTION}
@item
@code{android.permission.ACCESS_ADSERVICES_CUSTOM_AUDIENCE}
@item
@code{android.permission.ACCESS_ADSERVICES_TOPICS}
@item
@code{android.permission.ACCESS_LOCATION_EXTRA_COMMANDS}
@item
@code{android.permission.ACCESS_NETWORK_STATE}
@item
@code{android.permission.INTERNET}
@code{android.permission.ACCESS_NOTIFICATION_POLICY}
@item
@code{android.permission.SET_WALLPAPER}
@code{android.permission.ACCESS_WIFI_STATE}
@item
@code{android.permission.NFC}
@code{android.permission.AUTHENTICATE_ACCOUNTS}
@item
@code{android.permission.TRANSMIT_IR}
@code{android.permission.BLUETOOTH}
@item
@code{android.permission.WAKE_LOCK}
@code{android.permission.BLUETOOTH_ADMIN}
@item
@code{android.permission.BROADCAST_STICKY}
@item
@code{android.permission.CALL_COMPANION_APP}
@item
@code{android.permission.CHANGE_NETWORK_STATE}
@item
@code{android.permission.CHANGE_WIFI_MULTICAST_STATE}
@item
@code{android.permission.CHANGE_WIFI_STATE}
@item
@code{android.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS}
@item
@code{android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS}
@item
@code{android.permission.CREDENTIAL_MANAGER_SET_ORIGIN}
@item
@code{android.permission.DELIVER_COMPANION_MESSAGES}
@item
@code{android.permission.DETECT_SCREEN_CAPTURE}
@item
@code{android.permission.DISABLE_KEYGUARD}
@item
@code{android.permission.ENFORCE_UPDATE_OWNERSHIP}
@item
@code{android.permission.EXPAND_STATUS_BAR}
@item
@code{android.permission.FLASHLIGHT}
@item
@code{android.permission.FOREGROUND_SERVICE}
@item
@code{android.permission.FOREGROUND_SERVICE_CAMERA}
@item
@code{android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE}
@item
@code{android.permission.FOREGROUND_SERVICE_DATA_SYNC}
@item
@code{android.permission.FOREGROUND_SERVICE_FILE_MANAGEMENT}
@item
@code{android.permission.FOREGROUND_SERVICE_HEALTH}
@item
@code{android.permission.FOREGROUND_SERVICE_LOCATION}
@item
@code{android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK}
@item
@code{android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION}
@item
@code{android.permission.FOREGROUND_SERVICE_MICROPHONE}
@item
@code{android.permission.FOREGROUND_SERVICE_PHONE_CALL}
@item
@code{android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING}
@item
@code{android.permission.FOREGROUND_SERVICE_SPECIAL_USE}
@item
@code{android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED}
@item
@code{android.permission.GET_PACKAGE_SIZE}
@item
@code{android.permission.GET_TASKS}
@item
@code{android.permission.HIDE_OVERLAY_WINDOWS}
@item
@code{android.permission.HIGH_SAMPLING_RATE_SENSORS}
@item
@code{android.permission.INTERNET}
@item
@code{android.permission.KILL_BACKGROUND_PROCESSES}
@item
@code{android.permission.MANAGE_ACCOUNTS}
@item
@code{android.permission.MANAGE_OWN_CALLS}
@item
@code{android.permission.MODIFY_AUDIO_SETTINGS}
@item
@code{android.permission.NFC}
@item
@code{android.permission.NFC_PREFERRED_PAYMENT_INFO}
@item
@code{android.permission.NFC_TRANSACTION_EVENT}
@item
@code{android.permission.PERSISTENT_ACTIVITY}
@item
@code{android.permission.QUERY_ALL_PACKAGES}
@item
@code{android.permission.READ_BASIC_PHONE_STATE}
@item
@code{android.permission.READ_INSTALL_SESSIONS}
@item
@code{android.permission.READ_NEARBY_STREAMING_POLICY}
@item
@code{android.permission.READ_PROFILE}
@item
@code{android.permission.READ_SOCIAL_STREAM}
@item
@code{android.permission.READ_SYNC_SETTINGS}
@item
@code{android.permission.READ_SYNC_STATS}
@item
@code{android.permission.READ_USER_DICTIONARY}
@item
@code{android.permission.RECEIVE_BOOT_COMPLETED}
@item
@code{android.permission.REORDER_TASKS}
@item
@code{android.permission.REQUEST_COMPANION_PROFILE_GLASSES}
@item
@code{android.permission.REQUEST_COMPANION_PROFILE_WATCH}
@item
@code{android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND}
@item
@code{android.permission.REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND}
@item
@code{android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND}
@item
@code{android.permission.REQUEST_DELETE_PACKAGES}
@item
@code{android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
@item
@code{android.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE}
@item
@code{android.permission.REQUEST_PASSWORD_COMPLEXITY}
@item
@code{android.permission.RESTART_PACKAGES}
@item
@code{android.permission.RUN_USER_INITIATED_JOBS}
@item
@code{android.permission.SET_WALLPAPER}
@item
@code{android.permission.SET_WALLPAPER_HINTS}
@item
@code{android.permission.SUBSCRIBED_FEEDS_READ}
@item
@code{android.permission.SUBSCRIBED_FEEDS_WRITE}
@item
@code{android.permission.TRANSMIT_IR}
@item
@code{android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION}
@item
@code{android.permission.USE_BIOMETRIC}
@item
@code{android.permission.USE_CREDENTIALS}
@item
@code{android.permission.USE_EXACT_ALARM}
@item
@code{android.permission.USE_FINGERPRINT}
@item
@code{android.permission.USE_FULL_SCREEN_INTENT}
@item
@code{android.permission.VIBRATE}
@item
@code{android.permission.WAKE_LOCK}
@item
@code{android.permission.WRITE_PROFILE}
@item
@code{android.permission.WRITE_SMS}
@item
@code{android.permission.WRITE_SOCIAL_STREAM}
@item
@code{android.permission.WRITE_SYNC_SETTINGS}
@item
@code{android.permission.WRITE_USER_DICTIONARY}
@end itemize
Other permissions must be granted by the user through the system
settings application. Consult the manufacturer of your device for
more details, as how to do this varies by device.
Other permissions must be granted by the user from the system settings
application. Consult the manufacturer of your device for more details,
as how to do this varies by device.
@item
On Android 5.1 and earlier, Emacs automatically receives the following
@ -508,59 +675,139 @@ permissions it has requested upon being installed:
@itemize @minus
@item
@code{android.permission.READ_CONTACTS}
@item
@code{android.permission.WRITE_CONTACTS}
@item
@code{android.permission.VIBRATE}
@item
@code{android.permission.ACCESS_COARSE_LOCATION}
@item
@code{android.permission.ACCESS_NETWORK_STATE}
@code{android.permission.ACCESS_FINE_LOCATION}
@item
@code{android.permission.INTERNET}
@code{android.permission.BODY_SENSORS}
@item
@code{android.permission.SET_WALLPAPER}
@item
@code{android.permission.READ_CALENDAR}
@item
@code{android.permission.WRITE_CALENDAR}
@item
@code{android.permission.READ_EXTERNAL_STORAGE}
@item
@code{android.permission.WRITE_EXTERNAL_STORAGE}
@item
@code{android.permission.SEND_SMS}
@item
@code{android.permission.RECEIVE_SMS}
@item
@code{android.permission.RECEIVE_MMS}
@item
@code{android.permission.WRITE_SMS}
@item
@code{android.permission.READ_SMS}
@item
@code{android.permission.NFC}
@item
@code{android.permission.TRANSMIT_IR}
@item
@code{android.permission.READ_PHONE_STATE}
@item
@code{android.permission.WAKE_LOCK}
@item
@code{android.permission.FOREGROUND_SEVICE}
@item
@code{android.permission.REQUEST_INSTALL_PACKAGES}
@item
@code{android.permission.REQUEST_DELETE_PACKAGES}
@item
@code{android.permission.SYSTEM_ALERT_WINDOW}
@item
@code{android.permission.RECORD_AUDIO}
@code{android.permission.CALL_PHONE}
@item
@code{android.permission.CAMERA}
@item
@code{android.permission.CAPTURE_CONSENTLESS_BUGREPORT_ON_USERDEBUG_BUILD}
@item
@code{android.permission.GET_ACCOUNTS}
@item
@code{android.permission.POST_NOTIFICATIONS}
@item
@code{android.permission.PROCESS_OUTGOING_CALLS}
@item
@code{android.permission.READ_CALENDAR}
@item
@code{android.permission.READ_CALL_LOG}
@item
@code{android.permission.READ_CELL_BROADCASTS}
@item
@code{android.permission.READ_CONTACTS}
@item
@code{android.permission.READ_EXTERNAL_STORAGE}
@item
@code{android.permission.READ_PHONE_NUMBERS}
@item
@code{android.permission.READ_PHONE_STATE}
@item
@code{android.permission.READ_SMS}
@item
@code{android.permission.RECEIVE_MMS}
@item
@code{android.permission.RECEIVE_SMS}
@item
@code{android.permission.RECEIVE_WAP_PUSH}
@item
@code{android.permission.RECORD_AUDIO}
@item
@code{android.permission.REQUEST_INSTALL_PACKAGES}
@item
@code{android.permission.SEND_SMS}
@item
@code{android.permission.SMS_FINANCIAL_TRANSACTIONS}
@item
@code{android.permission.SYSTEM_ALERT_WINDOW}
@item
@code{android.permission.WRITE_CALENDAR}
@item
@code{android.permission.WRITE_CALL_LOG}
@item
@code{android.permission.WRITE_CONTACTS}
@item
@code{android.permission.WRITE_EXTERNAL_STORAGE}
@item
@code{android.permission.WRITE_SETTINGS}
@item
@code{android.permission.ACCESS_LOCATION_EXTRA_COMMANDS}
@item
@code{android.permission.ACCESS_NETWORK_STATE}
@item
@code{android.permission.ACCESS_WIFI_STATE}
@item
@code{android.permission.BLUETOOTH}
@item
@code{android.permission.BLUETOOTH_ADMIN}
@item
@code{android.permission.BROADCAST_STICKY}
@item
@code{android.permission.CHANGE_NETWORK_STATE}
@item
@code{android.permission.CHANGE_WIFI_MULTICAST_STATE}
@item
@code{android.permission.CHANGE_WIFI_STATE}
@item
@code{android.permission.DISABLE_KEYGUARD}
@item
@code{android.permission.EXPAND_STATUS_BAR}
@item
@code{android.permission.FLASHLIGHT}
@item
@code{android.permission.GET_PACKAGE_SIZE}
@item
@code{android.permission.GET_TASKS}
@item
@code{android.permission.INTERNET}
@item
@code{android.permission.KILL_BACKGROUND_PROCESSES}
@item
@code{android.permission.MODIFY_AUDIO_SETTINGS}
@item
@code{android.permission.NFC}
@item
@code{android.permission.PERSISTENT_ACTIVITY}
@item
@code{android.permission.QUERY_ALL_PACKAGES}
@item
@code{android.permission.READ_BASIC_PHONE_STATE}
@item
@code{android.permission.READ_SYNC_SETTINGS}
@item
@code{android.permission.READ_SYNC_STATS}
@item
@code{android.permission.READ_USER_DICTIONARY}
@item
@code{android.permission.RECEIVE_BOOT_COMPLETED}
@item
@code{android.permission.REORDER_TASKS}
@item
@code{android.permission.REQUEST_DELETE_PACKAGES}
@item
@code{android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
@item
@code{android.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE}
@item
@code{android.permission.RESTART_PACKAGES}
@item
@code{android.permission.SET_WALLPAPER}
@item
@code{android.permission.SET_WALLPAPER_HINTS}
@item
@code{android.permission.TRANSMIT_IR}
@item
@code{android.permission.VIBRATE}
@item
@code{android.permission.WAKE_LOCK}
@item
@code{android.permission.WRITE_SYNC_SETTINGS}
@item
@code{android.permission.WRITE_USER_DICTIONARY}
@end itemize
While most of these permissions are left unused by Emacs itself, they

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

@ -144,7 +144,15 @@ ps: $(PS_TARGETS)
${buildinfodir}:
${MKDIR_P} $@
$(buildinfodir)/elisp.info: $(srcs) | ${buildinfodir}
auxfiles: $(buildinfodir)/elisp_type_hierarchy.txt $(buildinfodir)/elisp_type_hierarchy.jpg
$(buildinfodir)/elisp_type_hierarchy.txt: $(srcdir)/elisp_type_hierarchy.txt | ${buildinfodir}
cp $< $@
$(buildinfodir)/elisp_type_hierarchy.jpg: $(srcdir)/elisp_type_hierarchy.jpg | ${buildinfodir}
cp $< $@
$(buildinfodir)/elisp.info: $(srcs) auxfiles | ${buildinfodir}
$(AM_V_GEN)$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
elisp.dvi: $(srcs)

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

@ -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

@ -6048,6 +6048,7 @@ event is composed by combining the @var{id} of the hot-spot with the
mouse event; for instance, @code{[area4 mouse-1]} if the hot-spot's
@var{id} is @code{area4}.
@findex image-compute-scaling-factor
Note that the map's coordinates should reflect the displayed image
after all transforms have been done (rotation, scaling and so on), and
also note that Emacs (by default) performs auto-scaling of images, so
@ -6766,11 +6767,15 @@ from the file's name.
The remaining arguments, @var{props}, specify additional image
properties---for example,
@c ':heuristic-mask' is not documented?
@example
(create-image "foo.xpm" 'xpm nil :heuristic-mask t)
(create-image "foo.xpm" 'xpm nil :mask 'heuristic)
@end example
@noindent
@xref{Image Descriptors}, for the list of supported properties. Some
properties are specific to certain image types, and are described in
subsections specific to those types.
The function returns @code{nil} if images of this type are not
supported. Otherwise it returns an image descriptor.
@end defun

View file

@ -300,6 +300,7 @@ Lisp Data Types
* Type Predicates:: Tests related to types.
* Equality Predicates:: Tests of equality between any two objects.
* Mutability:: Some objects should not be modified.
* Type Hierarchy:: Type Hierarchy of Emacs Lisp objects.
Programming Types
@ -883,6 +884,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

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

View file

@ -0,0 +1,33 @@
| Type | Derived Types |
|---------------------+------------------------------------------------------------|
| atom | mutex record font-spec frame number-or-marker |
| | tree-sitter-compiled-query tree-sitter-node font-entity |
| | tree-sitter-parser hash-table window-configuration |
| | function user-ptr overlay array process font-object symbol |
| | obarray condvar buffer terminal thread window |
| | native-comp-unit |
| cl-structure-object | xref-elisp-location org-cite-processor cl--generic-method |
| | cl--random-state register-preview-info cl--generic |
| | cl--class cl-slot-descriptor uniquify-item registerv |
| | isearch--state cl--generic-generalizer lisp-indent-state |
| t | sequence atom |
| compiled-function | subr byte-code-function |
| integer | fixnum bignum |
| symbol | symbol-with-pos keyword boolean |
| accessor | oclosure-accessor |
| oclosure | advice cconv--interactive-helper advice--forward accessor |
| | save-some-buffers-function cl--generic-nnm |
| cons | ppss decoded-time |
| cl--class | cl-structure-class oclosure--class built-in-class |
| subr | subr-primitive subr-native-elisp |
| array | string vector bool-vector char-table |
| number | float integer |
| number-or-marker | integer-or-marker number |
| function | oclosure compiled-function interpreted-function |
| | module-function |
| sequence | list array |
| integer-or-marker | integer marker |
| boolean | null |
| list | null cons |
| record | cl-structure-object |
| vector | timer |

View file

@ -498,13 +498,12 @@ indentation of the following lines is inside the string; what looks
nice in the source code will look ugly when displayed by the help
commands.
You may wonder how the documentation string could be optional, since
there are required components of the function that follow it (the body).
Since evaluation of a string returns that string, without any side effects,
it has no effect if it is not the last form in the body. Thus, in
practice, there is no confusion between the first form of the body and the
documentation string; if the only body form is a string then it serves both
as the return value and as the documentation.
A documentation string must always be followed by at least one Lisp
expression; otherwise, it is not a documentation string at all but the
single expression of the body and used as the return value.
When there is no meaningful value to return from a function, it is
standard practice to return @code{nil} by adding it after the
documentation string.
The last line of the documentation string can specify calling
conventions different from the actual function arguments. Write

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

@ -187,7 +187,8 @@ History}.
If the variable @code{minibuffer-allow-text-properties} is
non-@code{nil}, then the string that is returned includes whatever text
properties were present in the minibuffer. Otherwise all the text
properties are stripped when the value is returned.
properties are stripped when the value is returned. (By default this
variable is @code{nil}.)
@vindex minibuffer-prompt-properties
The text properties in @code{minibuffer-prompt-properties} are applied
@ -350,14 +351,15 @@ See @code{read-regexp} above for details of how these values are used.
@end defopt
@defvar minibuffer-allow-text-properties
If this variable is @code{nil}, then @code{read-from-minibuffer}
and @code{read-string} strip all text properties from the minibuffer
input before returning it. However,
If this variable is @code{nil}, the default, then
@code{read-from-minibuffer} and @code{read-string} strip all text
properties from the minibuffer input before returning it. However,
@code{read-no-blanks-input} (see below), as well as
@code{read-minibuffer} and related functions (@pxref{Object from
Minibuffer,, Reading Lisp Objects With the Minibuffer}), and all
functions that do minibuffer input with completion, remove the @code{face}
property unconditionally, regardless of the value of this variable.
functions that do minibuffer input with completion, remove the
@code{face} property unconditionally, regardless of the value of this
variable.
If this variable is non-@code{nil}, most text properties on strings
from the completion table are preserved---but only on the part of the
@ -2562,6 +2564,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
@ -784,6 +791,39 @@ init file.)
@end smallexample
@end defvar
@defvar major-mode-remap-defaults
This variable contains an association list indicating which function
to call to activate a given major mode. This is used for file formats
that can be supported by various major modes, where this variable can be
used to indicate which alternative should be used by default.
For example, a third-party package providing a much improved Pascal
major mode, can use the following to tell @code{normal-mode} to use
@code{spiffy-pascal-mode} for all the files that would normally use @code{pascal-mode}:
@smallexample
@group
(add-to-list 'major-mode-remap-defaults '(pascal-mode . spiffy-pascal-mode))
@end group
@end smallexample
This variable has the same format as @code{major-mode-remap-alist}.
If both lists match a major mode, the entry in
@code{major-mode-remap-alist} takes precedence.
@end defvar
@defun major-mode-remap mode
This function returns the major mode to use instead of @var{mode}
according to @code{major-mode-remap-alist} and
@code{major-mode-remap-defaults}. It returns @var{mode} if the mode
is not remapped by those variables.
When a package wants to activate a major mode for a particular file
format, it should use this function, passing as @code{mode} argument the
canonical major mode for that file format, to find which specific major
mode to activate, so as to take into account the user's preferences.
@end defun
@node Mode Help
@subsection Getting Help about a Major Mode
@cindex mode help
@ -1182,7 +1222,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 +1239,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
@ -1232,6 +1279,42 @@ Otherwise, the value should be a function which returns a list of the
above form when called with no arguments.
@end defvar
@defvar tabulated-list-groups
This buffer-local variable specifies the groups of entries displayed in
the Tabulated List buffer. Its value should be either a list or a
function.
If the value is a list, each list element corresponds to one group, and
should have the form @w{@code{(@var{group-name} @var{entries})}}, where
@var{group-name} is a string inserted before all group entries, and
@var{entries} have the same format as @code{tabulated-list-entries}
(see above).
Otherwise, the value should be a function which returns a list of the
above form when called with no arguments.
You can use @code{seq-group-by} to create @code{tabulated-list-groups}
from @code{tabulated-list-entries}. For example:
@smallexample
@group
(setq tabulated-list-groups
(seq-group-by 'Buffer-menu-group-by-mode
tabulated-list-entries))
@end group
@end smallexample
@noindent
where you can define @code{Buffer-menu-group-by-mode} like this:
@smallexample
@group
(defun Buffer-menu-group-by-mode (entry)
(concat "* " (aref (cadr entry) 5)))
@end group
@end smallexample
@end defvar
@defvar tabulated-list-revert-hook
This normal hook is run prior to reverting a Tabulated List buffer. A
derived mode can add a function to this hook to recompute
@ -2994,6 +3077,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

@ -60,6 +60,7 @@ to use these types can be found in later chapters.
* Type Predicates:: Tests related to types.
* Equality Predicates:: Tests of equality between any two objects.
* Mutability:: Some objects should not be modified.
* Type Hierarchy:: Type Hierarchy of Emacs Lisp objects.
@end menu
@node Printed Representation
@ -2121,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}.
@ -2181,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
@ -2493,3 +2497,26 @@ their components. For example, @code{(eq "abc" "abc")} returns
literal @code{"abc"}, and returns @code{nil} if it creates two
instances. Lisp programs should be written so that they work
regardless of whether this optimization is in use.
@node Type Hierarchy
@section Type Hierarchy of Emacs Lisp Objects
Lisp object types are organized in a hierarchy, which means that types
can derive from other types. Objects of type B (which derives from type
A) inherit all the characteristics of type A@. This also means that
every object of type B is at the same time an object of type A from
which it derives.
Every type derives from type @code{t}.
New types can be defined by the user through @code{defclass} or
@code{cl-defstruct}.
The Lisp Type Hierarchy for primitive types can be represented as
follows:
@noindent
@image{elisp_type_hierarchy,,,,.jpg}
For example type @code{list} derives from (is a special kind of) type
@code{sequence} which itself derives from @code{t}.

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

@ -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 provides 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

@ -6266,9 +6266,13 @@ this function does is to restore the value of the variable
If the buffer of a window of @var{configuration} has been killed since
@var{configuration} was made, that window is, as a rule, removed from
the restored configuration. However, if that window is the last
window remaining in the restored configuration, another live buffer is
shown in it.
the restored configuration. However, if that window is the last window
remaining in the restored configuration, another live buffer is shown in
it. Also, if the variable @var{window-kept-windows-functions} is
non-@code{nil}, any window whose buffer is now dead is not deleted.
Rather, this function will show another live buffer in that window and
include an entry for that window when calling any function in
@var{window-kept-windows-functions} (@pxref{Window Hooks}).
Here is a way of using this function to get the same effect as
@code{save-window-excursion}:
@ -6357,6 +6361,15 @@ a live window, it is replaced by a new live window created on the same
frame before putting @var{state} into it. If @var{window} is @code{nil},
it puts the window state into a new window.
If the buffer of any window recorded in @var{state} has been killed
since @var{state} was made, that window is, as a rule, not restored.
However, if that window is the only window in @var{state}, another live
buffer will be shown in it. Also, if the variable
@var{window-kept-windows-functions} is non-@code{nil}, any window whose
buffer is now dead is restored. This function will show another live
buffer in it and include an entry for that window when calling a
function in @var{window-kept-windows-functions} (@pxref{Window Hooks}).
If the optional argument @var{ignore} is non-@code{nil}, it means to ignore
minimum window sizes and fixed-size restrictions. If @var{ignore}
is @code{safe}, this means windows can get as small as one line
@ -6623,6 +6636,27 @@ Lock fontification function, which will be called whenever parts of a
buffer are (re)fontified because a window was scrolled or its size
changed. @xref{Other Font Lock Variables}.
@cindex window kept windows functions
@defvar window-kept-windows-functions
This variable holds a list of functions that Emacs will call after
restoring a window configuration via @code{set-window-configuration} or
state via @code{window-state-put} (@pxref{Window Configurations}). When
the value of this variable is non-@code{nil}, these functions will not
delete any window whose buffer has been killed since the corresponding
configuration or state was saved, but show some live buffer in it.
The value should be a list of functions that take two arguments. The
first argument specifies the frame whose windows have been restored.
The second argument specifies a list of entries for each window whose
buffer has been found dead at the time @code{set-window-configuration}
or @code{window-state-put} tried to restore it. Each entry is a list of
four values - the window whose buffer was found dead, the dead buffer,
and the last known positions of start and point of the buffer in that
window. Any function run by this hook should check that the window is
live since another function run by this hook may have deleted it in the
meantime.
@end defvar
@cindex window change functions
The remainder of this section covers six hooks that are called
during redisplay provided a significant, non-scrolling change of a

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

@ -192,6 +192,15 @@ history press @kbd{H} (@code{eww-list-histories}) to open the history
buffer @file{*eww history*}. The history is lost when EWW is quit.
If you want to remember websites you can use bookmarks.
@vindex eww-before-browse-history-function
By default, when browsing to a new page from a ``historical'' one
(i.e.@: a page loaded by navigating back via @code{eww-back-url}), EWW
will first delete any history entries newer than the current page. This
is the same behavior as most other web browsers. You can change this by
customizing @code{eww-before-browse-history-function} to another value.
For example, setting it to @code{ignore} will preserve the existing
history entries and simply prepend the new page to the history list.
@vindex eww-history-limit
Along with the URLs visited, EWW also remembers both the rendered
page (as it appears in the buffer) and its source. This can take a

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

@ -488,24 +488,28 @@ an @command{ssh} server:
@file{@trampfn{plink,user@@host,/path/to/file}}.
@anchor{Quick Start Guide su, sudo, doas and sg methods}
@section Using @option{su}, @option{sudo}, @option{doas} and @option{sg}
@anchor{Quick Start Guide su, sudo, doas, androidsu and sg methods}
@section Using @option{su}, @option{sudo}, @option{doas}, @option{androidsu} and @option{sg}
@cindex method @option{su}
@cindex @option{su} method
@cindex method @option{sudo}
@cindex @option{sudo} method
@cindex method @option{doas}
@cindex @option{doas} method
@cindex method @option{androidsu}
@cindex @option{androidsu} method
@cindex method @option{sg}
@cindex @option{sg} method
Sometimes, it is necessary to work on your local host under different
permissions. For this, you can use the @option{su} or @option{sudo}
connection method. On OpenBSD systems, the @option{doas} connection
method offers the same functionality. These methods use @samp{root}
as default user name and the return value of @code{(system-name)} as
default host name. Therefore, it is convenient to open a file as
@file{@trampfn{sudo,,/path/to/file}}.
method offers the same functionality. If your local system is
Android, use the method @option{androidsu} instead of @option{su}.
These methods use @samp{root} as default user name and the return
value of @code{(system-name)} as default host name. Therefore, it is
convenient to open a file as @file{@trampfn{sudo,,/path/to/file}}.
The method @option{sg} stands for ``switch group''; here the user name
is used as the group to change to. The default host name is the same.
@ -525,7 +529,7 @@ is used as the group to change to. The default host name is the same.
@cindex @option{doas} 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
@ -819,6 +823,17 @@ editing as another user. The host can be either @samp{localhost} or
the host returned by the function @command{(system-name)}. See
@ref{Multi-hops} for an exception to this behavior.
@item @option{androidsu}
@cindex method @option{androidsu}
@cindex @option{androidsu} method
Because the default implementation of 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, a largely
equivalent @option{androidsu} method is provided for that system with
workarounds for its many idiosyncrasies, with the exception that
multi-hops are unsupported.
@item @option{sudo}
@cindex method @option{sudo}
@cindex @option{sudo} method
@ -1059,6 +1074,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
@ -2036,7 +2065,7 @@ machine @var{host} port sudo login @var{user} password secret
@var{user} and @var{host} are the strings returned by
@code{(user-login-name)} and @code{(system-name)}. If one of these
methods is connected via a multi hop (@pxref{Multi-hops}), the
methods is connected via a multi-hop (@pxref{Multi-hops}), the
credentials of the previous hop are used.
@vindex auth-source-save-behavior
@ -5238,9 +5267,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
@ -502,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,
@ -684,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
@ -1367,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'.
@ -2328,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.

285
etc/NEWS
View file

@ -62,6 +62,16 @@ more details.
* Incompatible Changes in Emacs 30.1
** Tree-Sitter modes are now declared as submodes of the non-TS modes.
In order to help the use of those Tree-Sitter modes, they are now
declared to have the corresponding non-Tree-Sitter mode as an
additional parent.
This way, things like `.dir-locals.el` settings, and YASnippet
collections of snippets automatically apply to the new Tree-Sitter modes.
Note that those modes still do not inherit from the non-TS mode, so
configuration settings installed via mode hooks are not affected.
+++
** URL now never sends user email addresses in HTTP requests.
Emacs never sent email addresses by default, but it used to be
@ -76,7 +86,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 +95,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 +140,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,16 +279,20 @@ 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.
** Tab Bars and Tab Lines
---
*** New user option 'tab-bar-tab-name-format-functions'.
It can be used to add, remove and reorder functions that change
the appearance of every tab on the tab bar.
---
*** New hook 'tab-bar-tab-post-select-functions'.
+++
** New optional argument for modifying directory-local variables.
The commands 'add-dir-local-variable', 'delete-dir-local-variable' and
@ -305,8 +330,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
@ -412,6 +446,10 @@ functions in CJK locales.
*** New input methods for the Urdu, Pashto, and Sindhi languages.
These languages are spoken in Pakistan and Afghanistan.
---
*** New input method "english-colemak".
This input method supports the Colemak keyboard layout.
*** Additional 'C-x 8' key translations for "æ" and "Æ".
These characters can now be input with 'C-x 8 a e' and 'C-x 8 A E',
respectively, in addition to the existing translations 'C-x 8 / e' and
@ -420,6 +458,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.
@ -433,7 +476,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).
@ -442,11 +485,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.
@ -574,6 +620,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,
@ -691,7 +745,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.
+++
@ -810,14 +864,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
@ -866,6 +920,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
@ -964,6 +1028,19 @@ When invoked with the prefix argument ('C-u'),
This is useful for continuing reading the URL in the current buffer
when the new URL is fetched.
---
*** History navigation in EWW now works like other browsers.
Previously, when navigating back and forward through page history, EWW
would add a duplicate entry to the end of the history list each time.
This made it impossible to navigate to the "end" of the history list.
Now, navigating through history in EWW simply changes your position in
the history list, allowing you to reach the end as expected. In
addition, when browsing to a new page from a "historical" one (i.e. a
page loaded by navigating back through history), EWW deletes the history
entries newer than the current page. To change the behavior when
browsing from "historical" pages, you can customize
'eww-before-browse-history-function'.
** go-ts-mode
+++
@ -1059,8 +1136,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.
@ -1099,6 +1176,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
---
@ -1195,8 +1278,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
@ -1304,21 +1387,56 @@ 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 user option 'Buffer-menu-group-by'.
It controls how buffers are divided into groups that are displayed with
headings using Outline minor mode.
---
*** 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
@ -1374,23 +1492,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.
** Old derived.el functions removed.
The following functions have been deleted because they were only used
by code compiled with Emacs<21:
'derived-mode-setup-function-name', 'derived-mode-init-mode-variables',
'derived-mode-set-keymap', 'derived-mode-set-syntax-table',
'derived-mode-set-abbrev-table', 'derived-mode-run-hooks',
'derived-mode-init-mode-variables', 'derived-mode-merge-abbrev-tables',
'derived-mode-merge-keymaps', 'derived-mode-merge-syntax-tables',
'derived-mode-merge-abbrev-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
@ -1497,9 +1622,22 @@ values.
* Lisp Changes in Emacs 30.1
** Built-in types have now corresponding classes.
At the Lisp level, this means that things like (cl-find-class 'integer)
will now return a class object, and at the UI level it means that
things like 'C-h o integer RET' will show some information about that type.
** New var 'major-mode-remap-defaults' and function 'major-mode-remap'.
The first is like Emacs-29's 'major-mode-remap-alist' but to be set by
packages (instead of users). The second looks up those two variables.
+++
** '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)'.
@ -1516,10 +1654,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'.
@ -1695,6 +1833,22 @@ Tree-sitter conditionally sets 'forward-sexp-function' for major modes
that have defined 'sexp' in 'treesit-thing-settings' to enable
sexp-related motion commands.
+++
** Returned strings are never docstrings.
Functions and macros whose bodies consist of a single string literal now
only return that string; it is not used as a docstring. Example:
(defun sing-a-song ()
"Sing a song.")
The above function returns the string '"Sing a song."' but has no
docstring. Previously, that string was used as both a docstring and
return value, which was never what the programmer wanted. If you want
the string to be a docstring, add an explicit return value.
This change applies to 'defun', 'defsubst', 'defmacro' and 'lambda'
forms; other defining forms such as 'cl-defun' already worked this way.
** New or changed byte-compilation warnings
---
@ -1848,10 +2002,34 @@ 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 the 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'.
---
** New user option 'native-comp-async-warnings-errors-kind'.
It allows control of what kinds of warnings and errors from asynchronous
native compilation are reported to the parent Emacs process. The
default is to report all errors and only important warnings. If you
were used to customizing 'native-comp-async-report-warnings-errors' to
nil or 'silent', we suggest that you now leave it at its default value,
and see if you get only warnings that matter.
+++
** New function declaration and property 'important-return-value'.
The declaration '(important-return-value t)' sets the
@ -1920,6 +2098,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
@ -1928,6 +2131,16 @@ inside 'treesit-language-source-alist', so that calling
It may be useful, for example, for the purposes of bisecting a
treesitter grammar.
+++
** New buffer-local variable 'tabulated-list-groups'.
It controls display and separate sorting of groups of entries.
---
** New text property 'context-menu-functions'.
Like the variable with the same name, it adds menus from the list that
is the value of the property to context menus shown when clicking on the
text which as this property.
* Changes in Emacs 30.1 on Non-Free Operating Systems

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

@ -910,22 +910,6 @@ restore the redirection through funcall.
*** Features to be improved or missing
**** Diagnostic
***** Filtering async warnings
Add a new 'native-comp-async-report-warnings-errors' value such that
we filter out all the uninteresting warnings (that the programmer
already got during byte compilation) but we still report the important
ones ('the function xxx is not known to be defined.').
This way even if the package developer doesn't use native compilation
it can get the bug report for the issue and
'*Async-native-compile-log*' is not too crowded.
This new value for 'native-comp-async-report-warnings-errors' should
be default.
**** Fix portable dumping so that you can redump without using -batch
***** Redumps and native compiler "preloaded" sub-folder.

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

@ -64,6 +64,132 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCEPT_HANDOVER" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATIONS" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.ANSWER_PHONE_CALLS" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BODY_SENSORS" />
<uses-permission android:name="android.permission.BODY_SENSORS_BACKGROUND" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAPTURE_CONSENTLESS_BUGREPORT_ON_USERDEBUG_BUILD" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INSTANT_APP_FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_PROFILES" />
<uses-permission android:name="android.permission.LOADER_USAGE_STATS" />
<uses-permission android:name="android.permission.MANAGE_IPSEC_TUNNELS" />
<uses-permission android:name="android.permission.MANAGE_MEDIA" />
<uses-permission android:name="android.permission.MANAGE_ONGOING_CALLS" />
<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.READ_CELL_BROADCASTS" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_MMS" />
<uses-permission android:name="android.permission.RECEIVE_WAP_PUSH" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.SMS_FINANCIAL_TRANSACTIONS" />
<uses-permission android:name="android.permission.TURN_SCREEN_ON" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER" />
<uses-permission android:name="android.permission.USE_SIP" />
<uses-permission android:name="android.permission.UWB_RANGING" />
<uses-permission android:name="android.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS" />
<uses-permission android:name="android.permission.WRITE_CALL_LOG" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_ADSERVICES_AD_ID" />
<uses-permission android:name="android.permission.ACCESS_ADSERVICES_ATTRIBUTION" />
<uses-permission android:name="android.permission.ACCESS_ADSERVICES_CUSTOM_AUDIENCE" />
<uses-permission android:name="android.permission.ACCESS_ADSERVICES_TOPICS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS" />
<uses-permission android:name="android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS" />
<uses-permission android:name="android.permission.CREDENTIAL_MANAGER_SET_ORIGIN" />
<uses-permission android:name="android.permission.DELIVER_COMPANION_MESSAGES" />
<uses-permission android:name="android.permission.DETECT_SCREEN_CAPTURE" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.ENFORCE_UPDATE_OWNERSHIP" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_FILE_MANAGEMENT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" />
<uses-permission android:name="android.permission.GET_PACKAGE_SIZE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.HIDE_OVERLAY_WINDOWS" />
<uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.NFC_PREFERRED_PAYMENT_INFO" />
<uses-permission android:name="android.permission.NFC_TRANSACTION_EVENT" />
<uses-permission android:name="android.permission.PERSISTENT_ACTIVITY" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.READ_BASIC_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_INSTALL_SESSIONS" />
<uses-permission android:name="android.permission.READ_NEARBY_STREAMING_POLICY" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_SOCIAL_STREAM" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.READ_SYNC_STATS" />
<uses-permission android:name="android.permission.READ_USER_DICTIONARY" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.REQUEST_COMPANION_PROFILE_GLASSES" />
<uses-permission android:name="android.permission.REQUEST_COMPANION_PROFILE_WATCH" />
<uses-permission android:name="android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND" />
<uses-permission android:name="android.permission.REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND" />
<uses-permission android:name="android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE" />
<uses-permission android:name="android.permission.REQUEST_PASSWORD_COMPLEXITY" />
<uses-permission android:name="android.permission.RESTART_PACKAGES" />
<uses-permission android:name="android.permission.RUN_USER_INITIATED_JOBS" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
<uses-permission android:name="android.permission.SUBSCRIBED_FEEDS_READ" />
<uses-permission android:name="android.permission.SUBSCRIBED_FEEDS_WRITE" />
<uses-permission android:name="android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.WRITE_PROFILE" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.WRITE_SOCIAL_STREAM" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" />
<!-- This is required on Android 11 or later to access /sdcard. -->
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

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

@ -47,6 +47,7 @@
# --avoid=iswdigit \
# --avoid=iswxdigit \
# --avoid=langinfo \
# --avoid=localename-unsafe-limited \
# --avoid=lock \
# --avoid=mbrtowc \
# --avoid=mbsinit \
@ -2745,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

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

@ -438,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

@ -181,13 +181,12 @@ If nil, then no messages will ever be printed to the minibuffer."
:type '(choice (const :tag "Align a large region silently" nil) integer)
:group 'align)
(defcustom align-c++-modes '( c++-mode c-mode java-mode
c-ts-mode c++-ts-mode)
(defcustom align-c++-modes '( c++-mode c-mode java-mode)
"A list of modes whose syntax resembles C/C++."
:type '(repeat symbol)
:group 'align)
(defcustom align-perl-modes '(perl-mode cperl-mode)
(defcustom align-perl-modes '(perl-mode)
"A list of modes where Perl syntax is to be seen."
:type '(repeat symbol)
:group 'align)
@ -576,13 +575,13 @@ The possible settings for `align-region-separate' are:
"="
(group (zero-or-more (syntax whitespace)))))
(group . (1 2))
(modes . '(conf-toml-mode toml-ts-mode lua-mode lua-ts-mode)))
(modes . '(conf-toml-mode lua-mode)))
(double-dash-comment
(regexp . ,(rx (group (zero-or-more (syntax whitespace)))
"--"
(zero-or-more nonl)))
(modes . '(lua-mode lua-ts-mode))
(modes . '(lua-mode))
(column . comment-column)
(valid . ,(lambda ()
(save-excursion

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

@ -95,11 +95,35 @@ as it is by default."
:group 'Buffer-menu
:version "22.1")
(defcustom Buffer-menu-group-by nil
"If non-nil, a function to call to divide buffer-menu buffers into groups.
This function is called with one argument: a list of entries in the same
format as in `tabulated-list-entries', and should return a list in the
format suitable for `tabulated-list-groups'. Also, when this variable
is non-nil, `outline-minor-mode' is enabled in the Buffer Menu and you
can use Outline minor mode commands to show/hide groups of buffers,
according to the value of `outline-regexp'.
The default options can group by a mode, and by a root directory of
a project or just `default-directory'.
If this is nil, buffers are not divided into groups."
:type '(choice (const :tag "No grouping" nil)
(function-item :tag "Group by mode"
Buffer-menu-group-by-mode)
(function-item :tag "Group by project root or directory"
Buffer-menu-group-by-root)
(function :tag "Custom function"))
:group 'Buffer-menu
:version "30.1")
(defvar-local Buffer-menu-files-only nil
"Non-nil if the current Buffer Menu lists only file buffers.
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 +164,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 +222,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 +346,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 +359,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
@ -385,14 +428,12 @@ When called interactively prompt for MARK; RET remove all marks."
(interactive "cRemove marks (RET means all):" Buffer-menu-mode)
(save-excursion
(goto-char (point-min))
(when (tabulated-list-header-overlay-p)
(forward-line))
(while (not (eobp))
(let ((xmarks (list (aref (tabulated-list-get-entry) 0)
(aref (tabulated-list-get-entry) 2))))
(when (or (char-equal mark ?\r)
(member (char-to-string mark) xmarks))
(Buffer-menu--unmark)))
(when-let ((entry (tabulated-list-get-entry)))
(let ((xmarks (list (aref entry 0) (aref entry 2))))
(when (or (char-equal mark ?\r)
(member (char-to-string mark) xmarks))
(Buffer-menu--unmark))))
(forward-line))))
(defun Buffer-menu-unmark-all ()
@ -515,15 +556,16 @@ in the selected frame, and will remove any marks."
(defun Buffer-menu-marked-buffers (&optional unmark)
"Return the list of buffers marked with `Buffer-menu-mark'.
If UNMARK is non-nil, unmark them."
(let (buffers)
(Buffer-menu-beginning)
(while (re-search-forward "^>" nil t)
(let ((buffer (Buffer-menu-buffer)))
(if (and buffer unmark)
(tabulated-list-set-col 0 " " t))
(if (buffer-live-p buffer)
(push buffer buffers))))
(nreverse buffers)))
(save-excursion
(let (buffers)
(Buffer-menu-beginning)
(while (re-search-forward "^>" nil t)
(let ((buffer (Buffer-menu-buffer)))
(if (and buffer unmark)
(tabulated-list-set-col 0 " " t))
(if (buffer-live-p buffer)
(push buffer buffers))))
(nreverse buffers))))
(defun Buffer-menu-isearch-buffers ()
"Search for a string through all marked buffers using Isearch."
@ -569,13 +611,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."
@ -647,7 +693,12 @@ See more at `Buffer-menu-filter-predicate'."
(setq Buffer-menu-buffer-list buffer-list)
(setq Buffer-menu-filter-predicate filter-predicate)
(list-buffers--refresh buffer-list old-buffer)
(tabulated-list-print))
(tabulated-list-print)
(when tabulated-list-groups
(setq-local outline-minor-mode-cycle t
outline-minor-mode-highlight t
outline-minor-mode-use-buttons 'in-margins)
(outline-minor-mode 1)))
buffer))
(defun Buffer-menu-mouse-select (event)
@ -667,6 +718,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 +738,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)
@ -721,7 +774,11 @@ See more at `Buffer-menu-filter-predicate'."
`("Mode" ,Buffer-menu-mode-width t)
'("File" 1 t)))
(setq tabulated-list-use-header-line Buffer-menu-use-header-line)
(setq tabulated-list-entries (nreverse entries)))
(setq tabulated-list-entries (nreverse entries))
(when Buffer-menu-group-by
(setq tabulated-list-groups
(seq-group-by Buffer-menu-group-by
tabulated-list-entries))))
(tabulated-list-init-header))
(defun tabulated-list-entry-size-> (entry1 entry2)
@ -740,4 +797,14 @@ See more at `Buffer-menu-filter-predicate'."
(abbreviate-file-name list-buffers-directory))
(t "")))
(defun Buffer-menu-group-by-mode (entry)
(concat "* " (aref (cadr entry) 5)))
(declare-function project-root "project" (project))
(defun Buffer-menu-group-by-root (entry)
(concat "* " (with-current-buffer (car entry)
(if-let ((project (project-current)))
(project-root project)
default-directory))))
;;; buff-menu.el ends here

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

@ -44,9 +44,7 @@ those hits returned.")
(defvar semantic-symref-filepattern-alist
'((c-mode "*.[ch]")
(c-ts-mode "*.[ch]")
(c++-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh")
(c++-ts-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh")
(html-mode "*.html" "*.shtml" "*.php")
(mhtml-mode "*.html" "*.shtml" "*.php") ; FIXME: remove
; duplication of
@ -55,12 +53,8 @@ those hits returned.")
; major mode definition?
(ruby-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml"
"Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile")
(ruby-ts-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml"
"Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile")
(python-mode "*.py" "*.pyi" "*.pyw")
(python-ts-mode "*.py" "*.pyi" "*.pyw")
(perl-mode "*.pl" "*.PL")
(cperl-mode "*.pl" "*.PL")
(lisp-interaction-mode "*.el" "*.ede" ".emacs" "_emacs")
)
"List of major modes and file extension pattern.

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

@ -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

@ -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

@ -1450,7 +1450,8 @@ See Info node `(elisp) Integer Basics'."
(defun byte-optimize-apply (form)
(let ((len (length form)))
(if (>= len 2)
;; Single-arg `apply' is an abomination that we don't bother optimizing.
(if (> len 2)
(let ((fn (nth 1 form))
(last (nth (1- len) form)))
(cond

View file

@ -285,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
@ -307,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
@ -1776,6 +1779,24 @@ It is too wide if it has any lines longer than the largest of
(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)
@ -3052,12 +3073,11 @@ lambda-expression."
(append (if (not lexical-binding) arglistvars)
byte-compile-bound-variables))
(body (cdr (cdr fun)))
(doc (if (stringp (car body))
;; Treat a final string literal as a value, not a doc string.
(doc (if (and (cdr body) (stringp (car body)))
(prog1 (car body)
;; Discard the doc string from the body
;; unless it is the last element of the body.
(if (cdr body)
(setq body (cdr body))))))
;; Discard the doc string from the body.
(setq body (cdr body)))))
(int (assq 'interactive body))
command-modes)
(when lexical-binding
@ -5762,6 +5782,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

@ -632,12 +632,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

@ -714,7 +714,9 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
;; FIXME: We could go crazy and add another entry so describe-symbol can be
;; used with the slot names of CL structs (and/or EIEIO objects).
(add-to-list 'describe-symbol-backends
`(nil ,#'cl-find-class ,(lambda (s _b _f) (cl-describe-type s))))
`(nil ,#'cl-find-class ,#'cl-describe-type)
;; Document the `cons` function before the `cons` type.
t)
(defconst cl--typedef-regexp
(concat "(" (regexp-opt '("defclass" "defstruct" "cl-defstruct"
@ -744,7 +746,7 @@ Call `cl--find-class' to get TYPE's propname `cl--class'"
(cl--find-class type))
;;;###autoload
(defun cl-describe-type (type)
(defun cl-describe-type (type &optional _buf _frame)
"Display the documentation for type TYPE (a symbol)."
(interactive
(let ((str (completing-read "Describe type: " obarray #'cl-find-class t)))
@ -766,6 +768,15 @@ Call `cl--find-class' to get TYPE's propname `cl--class'"
;; Return the text we displayed.
(buffer-string)))))
(defun cl--class-children (class)
(let ((children '()))
(mapatoms
(lambda (sym)
(let ((sym-class (cl--find-class sym)))
(and sym-class (memq class (cl--class-parents sym-class))
(push sym children)))))
children))
(defun cl--describe-class (type &optional class)
(unless class (setq class (cl--find-class type)))
(let ((location (find-lisp-object-file-name type 'define-type))
@ -796,10 +807,8 @@ Call `cl--find-class' to get TYPE's propname `cl--class'"
(insert (substitute-command-keys (if pl "', " "'"))))
(insert ".\n")))
;; Children, if available. ¡For EIEIO!
(let ((ch (condition-case nil
(cl-struct-slot-value metatype 'children class)
(cl-struct-unknown-slot nil)))
;; Children.
(let ((ch (cl--class-children class))
cur)
(when ch
(insert " Children ")
@ -903,22 +912,25 @@ Outputs to the current buffer."
(cslots (condition-case nil
(cl-struct-slot-value metatype 'class-slots class)
(cl-struct-unknown-slot nil))))
(insert (propertize "Instance Allocated Slots:\n\n"
'face 'bold))
(let* ((has-doc nil)
(slots-strings
(mapcar
(lambda (slot)
(list (cl-prin1-to-string (cl--slot-descriptor-name slot))
(cl-prin1-to-string (cl--slot-descriptor-type slot))
(cl-prin1-to-string (cl--slot-descriptor-initform slot))
(let ((doc (alist-get :documentation
(cl--slot-descriptor-props slot))))
(if (not doc) ""
(setq has-doc t)
(substitute-command-keys doc)))))
slots)))
(cl--print-table `("Name" "Type" "Default") slots-strings has-doc))
(if (and (null slots) (eq metatype 'built-in-class))
(insert "This is a built-in type.\n")
(insert (propertize "Instance Allocated Slots:\n\n"
'face 'bold))
(let* ((has-doc nil)
(slots-strings
(mapcar
(lambda (slot)
(list (cl-prin1-to-string (cl--slot-descriptor-name slot))
(cl-prin1-to-string (cl--slot-descriptor-type slot))
(cl-prin1-to-string (cl--slot-descriptor-initform slot))
(let ((doc (alist-get :documentation
(cl--slot-descriptor-props slot))))
(if (not doc) ""
(setq has-doc t)
(substitute-command-keys doc)))))
slots)))
(cl--print-table `("Name" "Type" "Default") slots-strings has-doc)))
(insert "\n")
(when (> (length cslots) 0)
(insert (propertize "\nClass Allocated Slots:\n\n" 'face 'bold))

View file

@ -1175,12 +1175,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))
@ -1188,33 +1184,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."
@ -1353,62 +1365,31 @@ These match if the argument is `eql' to VAL."
(cl--generic-prefill-dispatchers (terminal-parameter nil 'xterm--set-selection)
(eql nil))
;;; Support for cl-defstructs specializers.
;;; Dispatch on "normal types".
(defun cl--generic-struct-tag (name &rest _)
;; Use exactly the same code as for `typeof'.
`(if ,name (type-of ,name) 'null))
(defun cl--generic-struct-specializers (tag &rest _)
(defun cl--generic-type-specializers (tag &rest _)
(and (symbolp tag)
(let ((class (get tag 'cl--class)))
(when (cl-typep class 'cl-structure-class)
(let ((class (cl--find-class tag)))
(when class
(cl--class-allparents class)))))
(cl-generic-define-generalizer cl--generic-struct-generalizer
50 #'cl--generic-struct-tag
#'cl--generic-struct-specializers)
(cl-defmethod cl-generic-generalizers :extra "cl-struct" (type)
"Support for dispatch on types defined by `cl-defstruct'."
(or
(when (symbolp type)
;; Use the "cl--struct-class*" (inlinable) functions/macros rather than
;; the "cl-struct-*" variants which aren't inlined, so that dispatch can
;; take place without requiring cl-lib.
(let ((class (cl--find-class type)))
(and (cl-typep class 'cl-structure-class)
(or (null (cl--struct-class-type class))
(error "Can't dispatch on cl-struct %S: type is %S"
type (cl--struct-class-type class)))
(progn (cl-assert (null (cl--struct-class-named class))) t)
(list cl--generic-struct-generalizer))))
(cl-call-next-method)))
(cl--generic-prefill-dispatchers 0 cl--generic-generalizer)
;;; Dispatch on "system types".
(cl-generic-define-generalizer cl--generic-typeof-generalizer
;; FIXME: We could also change `type-of' to return `null' for nil.
10 (lambda (name &rest _) `(if ,name (type-of ,name) 'null))
(lambda (tag &rest _)
(and (symbolp tag) (assq tag cl--typeof-types))))
#'cl--generic-type-specializers)
(cl-defmethod cl-generic-generalizers :extra "typeof" (type)
"Support for dispatch on builtin types.
See the full list and their hierarchy in `cl--typeof-types'."
"Support for dispatch on types.
This currently works for built-in types and types built on top of records."
;; FIXME: Add support for other types accepted by `cl-typep' such
;; as `character', `face', `function', ...
(or
(and (memq type cl--all-builtin-types)
(progn
;; FIXME: While this wrinkle in the semantics can be occasionally
;; problematic, this warning is more often annoying than helpful.
;;(if (memq type '(vector array sequence))
;; (message "`%S' also matches CL structs and EIEIO classes"
;; type))
(list cl--generic-typeof-generalizer)))
(and (symbolp type)
(not (eq type t)) ;; Handled by the `t-generalizer'.
(let ((class (cl--find-class type)))
(memq (type-of class)
'(built-in-class cl-structure-class eieio--class)))
(list cl--generic-typeof-generalizer))
(cl-call-next-method)))
(cl--generic-prefill-dispatchers 0 integer)
@ -1416,6 +1397,8 @@ See the full list and their hierarchy in `cl--typeof-types'."
(cl--generic-prefill-dispatchers 0 cl--generic-generalizer integer)
(cl--generic-prefill-dispatchers 0 (eql 'x) integer)
(cl--generic-prefill-dispatchers 0 cl--generic-generalizer)
;;; Dispatch on major mode.
;; Two parts:
@ -1453,19 +1436,13 @@ Used internally for the (major-mode MODE) context specializers."
(defun cl--generic-oclosure-tag (name &rest _)
`(oclosure-type ,name))
(defun cl-generic--oclosure-specializers (tag &rest _)
(and (symbolp tag)
(let ((class (cl--find-class tag)))
(when (cl-typep class 'oclosure--class)
(oclosure--class-allparents class)))))
(cl-generic-define-generalizer cl--generic-oclosure-generalizer
;; Give slightly higher priority than the struct specializer, so that
;; for a generic function with methods dispatching structs and on OClosures,
;; we first try `oclosure-type' before `type-of' since `type-of' will return
;; non-nil for an OClosure as well.
51 #'cl--generic-oclosure-tag
#'cl-generic--oclosure-specializers)
#'cl--generic-type-specializers)
(cl-defmethod cl-generic-generalizers :extra "oclosure-struct" (type)
"Support for dispatch on types defined by `oclosure-define'."

View file

@ -3349,14 +3349,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)))
@ -3373,13 +3373,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
@ -3465,6 +3465,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)
@ -3492,6 +3493,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)
@ -3499,6 +3501,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?
@ -3824,7 +3827,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

@ -50,51 +50,16 @@
(apply #'error string (append sargs args))
(signal 'cl-assertion-failed `(,form ,@sargs)))))
(defconst cl--typeof-types
;; Hand made from the source code of `type-of'.
'((integer number integer-or-marker number-or-marker atom)
(symbol-with-pos symbol atom) (symbol atom) (string array sequence atom)
(cons list sequence)
;; Markers aren't `numberp', yet they are accepted wherever integers are
;; accepted, pretty much.
(marker integer-or-marker number-or-marker atom)
(overlay atom) (float number number-or-marker atom)
(window-configuration atom) (process atom) (window atom)
;; FIXME: We'd want to put `function' here, but that's only true
;; for those `subr's which aren't special forms!
(subr atom)
;; FIXME: We should probably reverse the order between
;; `compiled-function' and `byte-code-function' since arguably
;; `subr' is also "compiled functions" but not "byte code functions",
;; but it would require changing the value returned by `type-of' for
;; byte code objects, which risks breaking existing code, which doesn't
;; seem worth the trouble.
(compiled-function byte-code-function function atom)
(module-function function atom)
(buffer atom) (char-table array sequence atom)
(bool-vector array sequence atom)
(frame atom) (hash-table atom) (terminal atom)
(thread atom) (mutex atom) (condvar atom)
(font-spec atom) (font-entity atom) (font-object atom)
(vector array sequence atom)
(user-ptr atom)
(tree-sitter-parser atom)
(tree-sitter-node atom)
(tree-sitter-compiled-query atom)
;; Plus, really hand made:
(null symbol list sequence atom))
"Alist of supertypes.
Each element has the form (TYPE . SUPERTYPES) where TYPE is one of
the symbols returned by `type-of', and SUPERTYPES is the list of its
supertypes from the most specific to least specific.")
(defconst cl--all-builtin-types
(delete-dups (copy-sequence (apply #'append cl--typeof-types))))
(defun cl--builtin-type-p (name)
(if (not (fboundp 'built-in-class-p)) ;; Early bootstrap
nil
(let ((class (and (symbolp name) (get name 'cl--class))))
(and class (built-in-class-p class)))))
(defun cl--struct-name-p (name)
"Return t if NAME is a valid structure name for `cl-defstruct'."
(and name (symbolp name) (not (keywordp name))
(not (memq name cl--all-builtin-types))))
(not (cl--builtin-type-p name))))
;; When we load this (compiled) file during pre-loading, the cl--struct-class
;; code below will need to access the `cl-struct' info, since it's considered
@ -147,7 +112,7 @@ supertypes from the most specific to least specific.")
(defun cl--struct-register-child (parent tag)
;; Can't use (cl-typep parent 'cl-structure-class) at this stage
;; because `cl-structure-class' is defined later.
(while (recordp parent)
(while (cl--struct-class-p parent)
(add-to-list (cl--struct-class-children-sym parent) tag)
;; Only register ourselves as a child of the leftmost parent since structs
;; can only have one parent.
@ -162,9 +127,14 @@ supertypes from the most specific to least specific.")
(with-suppressed-warnings ((obsolete cl-old-struct-compat-mode))
(message "cl-old-struct-compat-mode is obsolete!")
(cl-old-struct-compat-mode 1)))
(if (eq type 'record)
;; Defstruct using record objects.
(setq type nil))
(when (eq type 'record)
;; Defstruct using record objects.
(setq type nil)
;; `cl-structure-class' and `cl-structure-object' are allowed to be
;; defined without specifying the parent, because their parent
;; doesn't exist yet when they're defined.
(cl-assert (or parent (memq name '(cl-structure-class
cl-structure-object)))))
(cl-assert (or type (not named)))
(if (boundp children-sym)
(add-to-list children-sym tag)
@ -172,7 +142,9 @@ supertypes from the most specific to least specific.")
(and (null type) (eq (caar slots) 'cl-tag-slot)
;; Hide the tag slot from "standard" (i.e. non-`type'd) structs.
(setq slots (cdr slots)))
(let* ((parent-class (when parent (cl--struct-get-class parent)))
(let* ((parent-class (if parent (cl--struct-get-class parent)
(cl--find-class (if (eq type 'list) 'cons
(or type 'record)))))
(n (length slots))
(index-table (make-hash-table :test 'eq :size n))
(vslots (let ((v (make-vector n nil))
@ -195,7 +167,9 @@ supertypes from the most specific to least specific.")
name docstring
(unless (symbolp parent-class) (list parent-class))
type named vslots index-table children-sym tag print)))
(unless (symbolp parent-class)
(cl-assert (or (not (symbolp parent-class))
(memq name '(cl-structure-class cl-structure-object))))
(when (cl--struct-class-p parent-class)
(let ((pslots (cl--struct-class-slots parent-class)))
(or (>= n (length pslots))
(let ((ok t))
@ -327,8 +301,137 @@ supertypes from the most specific to least specific.")
(merge-ordered-lists (mapcar #'cl--class-allparents
(cl--class-parents class)))))
(eval-and-compile
(cl-assert (null (cl--class-parents (cl--find-class 'cl-structure-object)))))
(cl-defstruct (built-in-class
(:include cl--class)
(:constructor nil)
(:constructor built-in-class--make (name docstring parents))
(:copier nil))
)
(defmacro cl--define-built-in-type (name parents &optional docstring &rest _slots)
;; `slots' is currently unused, but we could make it take
;; a list of "slot like properties" together with the corresponding
;; accessor, and then we could maybe even make `slot-value' work
;; on some built-in types :-)
(declare (indent 2) (doc-string 3))
(unless (listp parents) (setq parents (list parents)))
(unless (or parents (eq name t))
(error "Missing parents for %S: %S" name parents))
`(progn
(put ',name 'cl--class
(built-in-class--make ',name ,docstring
(mapcar (lambda (type)
(let ((class (get type 'cl--class)))
(unless class
(error "Unknown type: %S" type))
class))
',parents)))))
;; FIXME: Our type DAG has various quirks:
;; - `subr' says it's a `compiled-function' but that's not true
;; for those subrs that are special forms!
;; - Some `keyword's are also `symbol-with-pos' but that's not reflected
;; in the DAG.
;; - An OClosure can be an interpreted function or a `byte-code-function',
;; so the DAG of OClosure types is "orthogonal" to the distinction
;; between interpreted and compiled functions.
(cl--define-built-in-type t nil "The type of everything.")
(cl--define-built-in-type atom t "The type of anything but cons cells.")
(cl--define-built-in-type tree-sitter-compiled-query atom)
(cl--define-built-in-type tree-sitter-node atom)
(cl--define-built-in-type tree-sitter-parser atom)
(cl--define-built-in-type user-ptr atom)
(cl--define-built-in-type font-object atom)
(cl--define-built-in-type font-entity atom)
(cl--define-built-in-type font-spec atom)
(cl--define-built-in-type condvar atom)
(cl--define-built-in-type mutex atom)
(cl--define-built-in-type thread atom)
(cl--define-built-in-type terminal atom)
(cl--define-built-in-type hash-table atom)
(cl--define-built-in-type frame atom)
(cl--define-built-in-type buffer atom)
(cl--define-built-in-type window atom)
(cl--define-built-in-type process atom)
(cl--define-built-in-type window-configuration atom)
(cl--define-built-in-type overlay atom)
(cl--define-built-in-type number-or-marker atom
"Abstract super type of both `number's and `marker's.")
(cl--define-built-in-type symbol atom
"Type of symbols."
;; Example of slots we could document. It would be desirable to
;; have some way to extract this from the C code, or somehow keep it
;; in sync (probably not for `cons' and `symbol' but for things like
;; `font-entity').
(name symbol-name)
(value symbol-value)
(function symbol-function)
(plist symbol-plist))
(cl--define-built-in-type obarray atom)
(cl--define-built-in-type native-comp-unit atom)
(cl--define-built-in-type sequence t "Abstract super type of sequences.")
(cl--define-built-in-type list sequence)
(cl--define-built-in-type array (sequence atom) "Abstract super type of arrays.")
(cl--define-built-in-type number (number-or-marker)
"Abstract super type of numbers.")
(cl--define-built-in-type float (number))
(cl--define-built-in-type integer-or-marker (number-or-marker)
"Abstract super type of both `integer's and `marker's.")
(cl--define-built-in-type integer (number integer-or-marker))
(cl--define-built-in-type marker (integer-or-marker))
(cl--define-built-in-type bignum (integer)
"Type of those integers too large to fit in a `fixnum'.")
(cl--define-built-in-type fixnum (integer)
(format "Type of small (fixed-size) integers.
The size depends on the Emacs version and compilation options.
For this build of Emacs it's %dbit."
(1+ (logb (1+ most-positive-fixnum)))))
(cl--define-built-in-type keyword (symbol)
"Type of those symbols whose first char is `:'.")
(cl--define-built-in-type boolean (symbol)
"Type of the canonical boolean values, i.e. either nil or t.")
(cl--define-built-in-type symbol-with-pos (symbol)
"Type of symbols augmented with source-position information.")
(cl--define-built-in-type vector (array))
(cl--define-built-in-type record (atom)
"Abstract type of objects with slots.")
(cl--define-built-in-type bool-vector (array) "Type of bitvectors.")
(cl--define-built-in-type char-table (array)
"Type of special arrays that are indexed by characters.")
(cl--define-built-in-type string (array))
(cl--define-built-in-type null (boolean list) ;FIXME: `atom' comes before `list'?
"Type of the nil value.")
(cl--define-built-in-type cons (list)
"Type of cons cells."
;; Example of slots we could document.
(car car) (cdr cdr))
(cl--define-built-in-type function (atom)
"Abstract super type of function values.")
(cl--define-built-in-type compiled-function (function)
"Abstract type of functions that have been compiled.")
(cl--define-built-in-type byte-code-function (compiled-function)
"Type of functions that have been byte-compiled.")
(cl--define-built-in-type subr (compiled-function)
"Abstract type of functions compiled to machine code.")
(cl--define-built-in-type module-function (function)
"Type of functions provided via the module API.")
(cl--define-built-in-type interpreted-function (function)
"Type of functions that have not been compiled.")
(cl--define-built-in-type subr-native-elisp (subr)
"Type of function that have been compiled by the native compiler.")
(cl--define-built-in-type subr-primitive (subr)
"Type of functions hand written in C.")
(unless (cl--class-parents (cl--find-class 'cl-structure-object))
;; When `cl-structure-object' is created, built-in classes didn't exist
;; yet, so we couldn't put `record' as the parent.
;; Fix it now to close the recursion.
(setf (cl--class-parents (cl--find-class 'cl-structure-object))
(list (cl--find-class 'record))))
;; Make sure functions defined with cl-defsubst can be inlined even in
;; packages which do not require CL. We don't put an autoload cookie

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