Merge branch 'master' into feature/igc

This commit is contained in:
Helmut Eller 2026-01-30 09:50:17 +01:00
commit 0fc6ab4597
318 changed files with 9320 additions and 4534 deletions

View file

@ -15,7 +15,12 @@
"/[ \t]*DEFVAR_[A-Z_ \t(]+\"[^\"]+\",[ \t]\\([A-Za-z0-9_]+\\)/\\1/"))))
(etags-regen-ignores . ("test/manual/etags/"))
(vc-prepare-patches-separately . nil)
(vc-default-patch-addressee . "bug-gnu-emacs@gnu.org")))
(vc-default-patch-addressee . "bug-gnu-emacs@gnu.org")
;; Uncomment these later once people's builds are likely to know
;; they're safe local variable values.
;; (vc-trunk-branch-regexps . ("master" "\\`emacs-[0-9]+\\'"))
;; (vc-topic-branch-regexps . ("\\`feature/"))
))
(c-mode . ((c-file-style . "GNU")
(c-noise-macro-names . ("INLINE" "NO_INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED"
"ATTRIBUTE_NO_SANITIZE_ADDRESS"

View file

@ -158,6 +158,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>
Philip Kaludercic <philipk@posteo.net> <pkal@posteo.net>
Philipp Stephani <p.stephani2@gmail.com>
Philipp Stephani <phst@google.com>
Phillip Lord <phillip.lord@russet.org.uk> <phillip.lord@newcastle.ac.uk>

View file

@ -34,7 +34,9 @@ __ANDROID_API__ A numerical "API level" indicating the version of
HAVE_NTGUI Use the native W32 GUI for windows, frames, menus&scrollbars.
HAVE_NS Use the NeXT/OpenStep/Cocoa UI under macOS or GNUstep.
NS_IMPL_GNUSTEP Compile support for GNUstep implementation of NS GUI API.
Only true on systems other than macOS.
NS_IMPL_COCOA Compile support for Cocoa (Apple) implementation of NS GUI API.
Only true on macOS.
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.

View file

@ -235,7 +235,6 @@ Philip Kaludercic
lisp/emacs-lisp/package.el
lisp/emacs-lisp/package-vc.el
lisp/emacs-lisp/compat.el
lisp/net/rcirc.el
Yuan Fu
src/treesit.c
@ -390,6 +389,7 @@ Juri Linkov
lisp/repeat.el
Philip Kaludercic
lisp/net/rcirc.el
lisp/epa-ks.el
Harald Jörg

View file

@ -53,6 +53,10 @@ be used to debug Emacs with dense colormaps (PseudoColor).
Check doc strings against documentation.
** cl-lib-deps-report.el
Audit Lisp files for cl-lib usage and missing requires.
** cus-test.el
Tests for custom types and load problems.

162
admin/cl-lib-deps-report.el Executable file
View file

@ -0,0 +1,162 @@
:;exec emacs -Q --batch -l "$0" -- "$@" # -*- lexical-binding: t -*-
;;; cl-lib-deps-report.el --- report cl-lib dependencies in lisp files -*- lexical-binding: t -*-
;; Copyright (C) 2026 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Generate an Org report of cl-lib macro/function usage and missing
;; compile-time/runtime requires for files under lisp/.
;;; Code:
(require 'cl-lib)
(require 'org)
(setq debug-on-error nil)
(defun cl-lib-deps-report--scan-file (file symbol-re macros funcs)
"Return cl-lib usage data for FILE using SYMBOL-RE, MACROS, and FUNCS.
Exclude tokens found in strings or comments, and return a list with
dependency flags, require kind, and sorted symbol lists."
(with-temp-buffer
(insert-file-contents file)
(with-syntax-table emacs-lisp-mode-syntax-table
(let ((tokens '())
(total-req 0)
(eval-req 0))
(goto-char (point-min))
(while (re-search-forward symbol-re nil t)
(let ((ppss (syntax-ppss)))
(unless (or (nth 3 ppss) (nth 4 ppss))
(push (match-string 0) tokens))))
(setq tokens (cl-delete-duplicates tokens :test #'string=))
(let* ((macro-toks (cl-remove-if-not (lambda (tok) (member tok macros)) tokens))
(func-toks (cl-remove-if-not (lambda (tok) (member tok funcs)) tokens))
(macro-dep (and macro-toks t))
(func-dep (and func-toks t)))
(goto-char (point-min))
(while (re-search-forward "(require[[:space:]\n]*'cl-lib" nil t)
(let ((ppss (syntax-ppss)))
(unless (or (nth 3 ppss) (nth 4 ppss))
(setq total-req (1+ total-req)))))
(goto-char (point-min))
(while (re-search-forward "(eval-when-compile[[:space:]\n]*(require[[:space:]\n]*'cl-lib" nil t)
(let ((ppss (syntax-ppss)))
(unless (or (nth 3 ppss) (nth 4 ppss))
(setq eval-req (1+ eval-req)))))
(let* ((runtime-req (> total-req eval-req))
(eval-req-present (> eval-req 0))
(require-kind
(cond
((and (= total-req 0) (= eval-req 0)) "no")
((> total-req eval-req) "runtime")
(t "compile-time"))))
(list macro-dep func-dep require-kind runtime-req eval-req-present
(sort macro-toks #'string<)
(sort func-toks #'string<))))))))
(defun cl-lib-deps-report--main (args)
"Generate an Org report of cl-lib dependencies under a Lisp directory.
ARGS should be `command-line-args-left', which starts with \"--\" when
invoked via the file's exec stub."
(let* ((script-dir (file-name-directory (or load-file-name buffer-file-name)))
(default-root (expand-file-name "../lisp" script-dir))
;; `command-line-args-left' includes a \"--\" sentinel from the exec stub.
(args (if (and args (string= (car args) "--")) (cdr args) args))
(root (or (car args) default-root)))
(unless (file-directory-p root)
(princ (format "%s: Directory not found: %s\n" (or load-file-name "cl-lib-deps-report.el") root))
(kill-emacs 1))
(let* ((candidate-re "cl-[[:alnum:]-]+\\*?")
(symbol-re "\\_<cl-[[:alnum:]-]+\\*?\\_>")
(pattern (format "%s|\\(require[[:space:]]*'cl-lib|\\(eval-when-compile[[:space:]]*\\(require[[:space:]]*'cl-lib"
candidate-re))
(files
(let ((cmd (format "find %s -type f -name '*.el' -print0 | xargs -0 grep -l -E %s || true"
(shell-quote-argument root)
(shell-quote-argument pattern))))
(with-temp-buffer
(call-process "sh" nil t nil "-c" cmd)
(split-string (buffer-string) "\n" t))))
(macros '())
(funcs '()))
(mapatoms
(lambda (sym)
(when (and (symbolp sym)
(string-prefix-p "cl-" (symbol-name sym)))
(cond
((macrop sym) (push (symbol-name sym) macros))
((fboundp sym) (push (symbol-name sym) funcs))))))
(setq macros (sort macros #'string<))
(setq funcs (sort funcs #'string<))
(setq files (sort files #'string<))
(with-temp-buffer
(org-mode)
(insert (format "* cl-lib dependency report (%s)\n" root))
(insert "** files\n")
(insert "| file | cl- macros used | cl- functions used | require |\n")
(insert "|------|-----------------|--------------------|---------|\n")
(let (runtime-missing compile-missing require-unneeded)
(dolist (file files)
(when (file-regular-p file)
(cl-destructuring-bind (macro-dep func-dep require-kind runtime-req eval-req-present macro-toks func-toks)
(cl-lib-deps-report--scan-file file symbol-re macros funcs)
(when (and func-dep (not runtime-req))
(push (list file func-toks) runtime-missing))
(when (and macro-dep (not eval-req-present))
(push (list file macro-toks) compile-missing))
(when (and (not func-dep) (not macro-dep)
(or runtime-req eval-req-present))
(push file require-unneeded))
(let ((skip
(or (and (not macro-dep) (not func-dep)
(string= require-kind "no"))
(and func-dep (string= require-kind "runtime"))
(and macro-dep (not func-dep)
(string= require-kind "compile-time")))))
(unless skip
(insert (format "| %s | %s | %s | %s |\n"
file
(if macro-dep "yes" "no")
(if func-dep "yes" "no")
require-kind)))))))
(org-table-align)
(insert "** runtime dependency missing require\n")
(dolist (entry (sort runtime-missing (lambda (a b) (string< (car a) (car b)))))
(insert (format "- %s (%s)\n"
(car entry)
(mapconcat (lambda (s) (format "~%s~" s)) (cadr entry) ", "))))
(insert "\n** compile-time dependency missing eval-when-compile require\n")
(dolist (entry (sort compile-missing (lambda (a b) (string< (car a) (car b)))))
(insert (format "- %s (%s)\n"
(car entry)
(mapconcat (lambda (s) (format "~%s~" s)) (cadr entry) ", "))))
(insert "\n** no dependency but require present\n")
(dolist (f (sort require-unneeded #'string<))
(insert (format "- %s\n" f)))
(insert "\n* Summary\n")
(insert (format "- Total files audited: %d\n" (length files)))
(insert (format "- Redundant requires found: %d\n" (length require-unneeded)))
(insert (format "- Missing runtime requires: %d\n" (length runtime-missing)))
(insert (format "- Missing compile-time requires: %d\n" (length compile-missing))))
(princ (buffer-string))))))
(cl-lib-deps-report--main command-line-args-left)
;;; cl-lib-deps-report.el ends here

View file

@ -61,7 +61,7 @@ download_tarball ()
# 1c8f3b0cbad474da0ab09018c4ecf2119ac4a52d pixman-0.38.4-emacs.tar.gz
# b687c8439d51634d921674dd009645e24873ca36 rsvg-2.40.21-emacs.tar.gz
# eda251614598aacb06f5984a0a280833de456b29 tiff-4.5.1-emacs.tar.gz
# c00d0ea9c6e848f5cce350cb3ed742024f2bdb8b tree-sitter-0.20.7-emacs.tar.gz
# 9d032de89c874354c22d304f7e968f4ca6de8c0a tree-sitter-0.26.3-emacs.tar.gz
download_tarball "giflib-5.2.1-emacs.tar.gz" "giflib-5.2.1" \
"a407c568961d729bb2d0175a34e0d4ed4a269978"
@ -90,8 +90,8 @@ download_tarball "libtasn1-4.19.0-emacs.tar.gz" "libtasn1-4.19.0" \
"fdc827211075d9b70a8ba6ceffa02eb48d6741e9"
download_tarball "libselinux-3.6-emacs.tar.gz" "libselinux-3.6" \
"8361966e19fe25ae987b08799f1442393ae6366b"
download_tarball "tree-sitter-0.20.7-emacs.tar.gz" "tree-sitter-0.20.7" \
"c00d0ea9c6e848f5cce350cb3ed742024f2bdb8b"
download_tarball "tree-sitter-0.26.3-emacs.tar.gz" "tree-sitter-0.26.3" \
"9d032de89c874354c22d304f7e968f4ca6de8c0a"
download_tarball "harfbuzz-7.1.0-emacs.tar.gz" "harfbuzz-7.1.0" \
"22dc71d503ab2eb263dc8411de9da1db144520f5"
download_tarball "tiff-4.5.1-emacs.tar.gz" "tiff-4.5.1" \

View file

@ -1,35 +0,0 @@
NOTES ON THE EMACS PACKAGE ARCHIVE
The GNU Emacs package archive, at elpa.gnu.org, is managed using a Git
repository named "elpa", hosted on Savannah. To check it out:
git clone https://git.savannah.gnu.org/git/emacs/elpa
cd elpa
make setup
That leaves the elpa/packages directory empty; you must check out the
ones you want.
If you wish to check out all the packages into the packages directory,
you can run the command:
make worktrees
You can check out a specific package <pkgname> into the packages
directory with:
make packages/<pkgname>
Changes to this repository propagate to elpa.gnu.org via a
"deployment" script run daily. This script generates the content
visible at https://elpa.gnu.org/packages.
A new package is released as soon as the "version number" of that
package is changed. So you can use 'elpa' to work on a package
without fear of releasing those changes prematurely. And once the
code is ready, just bump the version number to make a new release of
the package.
It is easy to use the elpa branch to deploy a "local" copy of the
package archive. For details, see the README file in the elpa branch.

43
admin/notes/elpa.md Normal file
View file

@ -0,0 +1,43 @@
# NOTES ON THE EMACS PACKAGE ARCHIVE
The Emacs package archives at `elpa.gnu.org` (GNU ELPA and NonGNU ELPA)
are managed using two Git repositories named `gnu.git` and `nongnu.git`
hosted in the `elpa` group on Savannah.
To check them out:
git clone https://git.savannah.gnu.org/git/elpa/gnu.git
cd gnu
make setup
resp.
git clone https://git.savannah.gnu.org/git/elpa/nongnu.git
cd nongnu
make setup
That leaves the `(non)gnu/packages` directory empty; you must check out the
ones you want.
If you wish to check out all the packages into the packages directory,
you can run the command:
make worktrees
You can check out a specific package <pkgname> into the packages
directory with:
make packages/<pkgname>
Changes to this repository propagate to `elpa.gnu.org` via a
"deployment" script run daily. This script generates the content
visible at https://elpa.gnu.org/packages and https://elpa.nongnu.org/nongnu
A new package is released as soon as the "version number" of that
package is changed (as found in the `;; Version:` header of the main
ELisp file of the package). So you can use `elpa/(non)gnu.git` to work
on a package without fear of releasing those changes prematurely.
And once the code is ready, just bump the version number to make a new
release of the package.
It is easy to use these repositories to deploy a "local" copy of the
package archive. For details, see the README file after cloning them.

View file

@ -138,14 +138,12 @@ This is done by `require'ing all of the features that extend it."
(lambda (source)
(cond ((or (memq :revision source)
(memq :commit source))
(when (memq :revision source)
(let ((unversioned-source (copy-sequence source)))
(setcar (cdr (memq :revision unversioned-source)) nil)
unversioned-source))
(when (memq :commit source)
(let ((unversioned-source (copy-sequence source)))
(setcar (cdr (memq :commit unversioned-source)) nil)
unversioned-source)))
(let ((unversioned-source (copy-sequence source)))
(when (memq :revision source)
(setcar (cdr (memq :revision unversioned-source)) nil))
(when (memq :commit source)
(setcar (cdr (memq :commit unversioned-source)) nil))
unversioned-source))
((nthcdr 2 source)
(let ((unversioned-source (copy-sequence source)))
(setcar (nthcdr 2 unversioned-source) nil)

View file

@ -1,6 +1,6 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2026 Free Software Foundation, Inc.
# Copyright 1992-2025 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
@ -60,7 +60,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2026 Free Software Foundation, Inc.
Copyright 1992-2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

View file

@ -1,6 +1,6 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2026 Free Software Foundation, Inc.
# Copyright 1992-2025 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale
@ -76,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2026 Free Software Foundation, Inc.
Copyright 1992-2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

View file

@ -1819,6 +1819,7 @@ AS_IF([test $gl_gcc_warnings = no],
nw="$nw -Wsync-nand" # irrelevant here, and provokes ObjC warning
nw="$nw -Wunsafe-loop-optimizations" # OK to suppress unsafe optimizations
nw="$nw -Wbad-function-cast" # These casts are no worse than others.
nw="$nw -Wzero-as-null-pointer-constant" # Emacs is not yet C2y-safe.
# Emacs doesn't care about shadowing; see
# <https://lists.gnu.org/r/emacs-diffs/2011-11/msg00265.html>.
@ -2901,6 +2902,11 @@ Mac OS X 12.x or later.
[Define to use native OS APIs for images.])
NATIVE_IMAGE_API="yes (ns)"
fi
if test "${NS_IMPL_GNUSTEP}" = yes; then
AC_CHECK_DECLS([NSImageNameCaution], [], [],
[[#import <AppKit/NSImage.h>]])
fi
fi
AC_SUBST([LIBS_GNUSTEP])
@ -3605,21 +3611,25 @@ if test "${with_webp}" != "no"; then
|| test "${HAVE_BE_APP}" = "yes" || test "${HAVE_PGTK}" = "yes" \
|| test "${REALLY_ANDROID}" = "yes"; then
WEBP_REQUIRED=0.6.0
WEBP_MODULE="libwebpdemux >= $WEBP_REQUIRED"
# Definitions from webp/decode.h are in libwebp, and those from
# webp/demux.h in libwebpdemux, which depends on libwebp.
WEBP_MODULE="libwebpdemux >= $WEBP_REQUIRED libwebp >= $WEBP_REQUIRED"
EMACS_CHECK_MODULES([WEBP], [$WEBP_MODULE])
# WebPGetInfo is sometimes not present inside libwebpdemux, so
# if it does not link, also check for libwebpdecoder.
# If for some reason we still don't have functions from
# webp/decode.h, try libwebpdecoder as well, which is the
# decoder-only subset of libwebp (bug#61988, bug#66221).
OLD_CFLAGS=$CFLAGS
OLD_LIBS=$LIBS
CFLAGS="$CFLAGS $WEBP_CFLAGS"
LIBS="$LIBS $WEBP_LIBS"
LIBS="$WEBP_LIBS $LIBS"
AS_IF([test "$REALLY_ANDROID" != "yes"], [
AC_CHECK_FUNC([WebPGetInfo], [],
[WEBP_MODULE="$WEBP_MODULE libwebpdecoder >= $WEBP_REQUIRED"
AC_CHECK_FUNC([WebPDecodeRGBA], [],
[WEBP_MODULE="libwebpdemux >= $WEBP_REQUIRED"
WEBP_MODULE="$WEBP_MODULE libwebpdecoder >= $WEBP_REQUIRED"
HAVE_WEBP=no
AS_UNSET([WEBP_LIBS])
AS_UNSET([WEBP_CFLAGS])
@ -4074,39 +4084,15 @@ TREE_SITTER_OBJ=
NEED_DYNLIB=no
if test "${with_tree_sitter}" != "no"; then
dnl Tree-sitter 0.20.2 added support to change the malloc it uses
dnl at runtime, we need that feature. However, tree-sitter's
dnl Makefile has problems, until that's fixed, all tree-sitter
dnl libraries distributed are versioned 0.6.3. We try to
dnl accept a tree-sitter library that has incorrect version as long
dnl as it supports changing malloc.
EMACS_CHECK_MODULES([TREE_SITTER], [tree-sitter >= 0.20.2],
dnl Tree-sitter 0.20.10 added ts_tree_cursor_goto_previous_sibling, we
dnl need it for a more efficient implementation for traversing the
dnl parse tree backwards (bug#80108).
EMACS_CHECK_MODULES([TREE_SITTER], [tree-sitter >= 0.20.10],
[HAVE_TREE_SITTER=yes], [HAVE_TREE_SITTER=no])
if test "${HAVE_TREE_SITTER}" = yes; then
AC_DEFINE(HAVE_TREE_SITTER, 1, [Define if using tree-sitter.])
NEED_DYNLIB=yes
else
EMACS_CHECK_MODULES([TREE_SITTER], [tree-sitter >= 0.6.3],
[HAVE_TREE_SITTER=yes], [HAVE_TREE_SITTER=no])
if test "${HAVE_TREE_SITTER}" = yes; then
OLD_CFLAGS=$CFLAGS
OLD_LIBS=$LIBS
CFLAGS="$CFLAGS $TREE_SITTER_CFLAGS"
LIBS="$TREE_SITTER_LIBS $LIBS"
AC_CHECK_FUNCS([ts_set_allocator])
CFLAGS=$OLD_CFLAGS
LIBS=$OLD_LIBS
if test "$ac_cv_func_ts_set_allocator" = yes; then
AC_DEFINE(HAVE_TREE_SITTER, 1, [Define if using tree-sitter.])
NEED_DYNLIB=yes
else
AC_MSG_ERROR([Tree-sitter library exists but its version is too old]);
TREE_SITTER_CFLAGS=
TREE_SITTER_LIBS=
fi
fi
fi
# Windows loads tree-sitter dynamically
if test "${opsys}" = "mingw32"; then
TREE_SITTER_LIBS=
@ -7236,6 +7222,9 @@ AC_SUBST([ns_appsrc])
AC_SUBST([GNU_OBJC_CFLAGS])
AC_SUBST([OTHER_FILES])
AS_IF([test $prefix = "NONE"], [_prefix=/usr/local], [_prefix=$prefix])
AC_DEFINE_UNQUOTED([BINDIR], ["${_prefix}/bin/"], [Executables directory.])
if test -n "${term_header}"; then
AC_DEFINE_UNQUOTED([TERM_HEADER], ["${term_header}"],
[Define to the header for the built-in window system.])

View file

@ -64,6 +64,12 @@ named @file{*compilation*}. The current buffer's default directory is
used as the working directory for the execution of the command, so by
default compilation takes place in that directory.
When invoked with a prefix argument, the @file{*compilation*} buffer
is using Comint mode as its major mode (@pxref{Shell Mode}). By default
Comint mode has the nice property of looking for any credential prompts
in its contents and make Emacs asks for a password if this happens.
This is useful should the compilation command need such a credential.
@vindex compile-command
The default compilation command is @samp{make -k}, which is usually
correct for programs compiled using the @command{make} utility (the

View file

@ -2048,20 +2048,41 @@ variable @code{visible-cursor} is @code{nil} when Emacs starts or
resumes, it uses the normal cursor.
@vindex cursor-type
On a graphical display, many more properties of the text cursor can
be altered. To customize its color, change the @code{:background}
attribute of the face named @code{cursor} (@pxref{Face
Customization}). (The other attributes of this face have no effect;
the text shown under the cursor is drawn using the frame's background
color.) To change its shape, customize the buffer-local variable
@code{cursor-type}; possible values are @code{box} (the default),
@code{(box . @var{size})} (box cursor becoming a hollow box under
masked images larger than @var{size} pixels in either dimension),
@code{hollow} (a hollow box), @code{bar} (a vertical bar), @code{(bar
. @var{n})} (a vertical bar @var{n} pixels wide), @code{hbar} (a
horizontal bar), @code{(hbar . @var{n})} (a horizontal bar @var{n}
On a graphical display and many Xterm-compatible text terminals, the
color and shape of the text cursor can be altered. To customize its
color, change the @code{:background} attribute of the face named
@code{cursor} (@pxref{Face Customization}). (The other attributes of
this face have no effect; the text shown under the cursor is drawn using
the frame's background color.) To change its shape, customize the
buffer-local variable @code{cursor-type}; possible values are @code{box}
(the default), @code{(box . @var{size})} (box cursor becoming a hollow
box under masked images larger than @var{size} pixels in either
dimension), @code{hollow} (a hollow box), @code{bar} (a vertical bar),
@code{(bar . @var{n})} (a vertical bar @var{n} pixels wide), @code{hbar}
(a horizontal bar), @code{(hbar . @var{n})} (a horizontal bar @var{n}
pixels tall), or @code{nil} (no cursor at all).
@vindex xterm-update-cursor
On Xterm-compatible text terminals cursor customization is controlled
by the user option @code{xterm-update-cursor}. Valid values are
@code{t} to update the cursor's color and shape, @code{type} to update
the cursor's shape only, @code{color} to update the cursor's color only,
and @code{nil} to not update the cursor's appearance. Text terminals
can not display a hollow box and instead use a filled box. Similarly,
all text terminals ignore the pixel sizes for @code{bar} and
@code{hbar}.
@findex hl-line-mode
@findex global-hl-line-mode
@cindex highlight current line
To make the cursor even more visible, you can use HL Line mode, a
minor mode that highlights the line containing point. Use @kbd{M-x
hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x
global-hl-line-mode} enables or disables the same mode globally.
The remaining controls only work on graphical displays where Emacs can
fully control the way the cursor appears.
@findex blink-cursor-mode
@cindex cursor, blinking
@cindex blinking cursor
@ -2105,14 +2126,6 @@ non-blinking hollow box. (For a bar cursor, it instead appears as a
thinner bar.) To turn off cursors in non-selected windows, change the
variable @code{cursor-in-non-selected-windows} to @code{nil}.
@findex hl-line-mode
@findex global-hl-line-mode
@cindex highlight current line
To make the cursor even more visible, you can use HL Line mode, a
minor mode that highlights the line containing point. Use @kbd{M-x
hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x
global-hl-line-mode} enables or disables the same mode globally.
@node Line Truncation
@section Line Truncation
@ -2338,6 +2351,16 @@ of lines which are a multiple of certain numbers. Customize
@code{display-line-numbers-minor-tick} respectively to set those
numbers.
@vindex line-spacing
The variable @code{line-spacing} controls the vertical spacing between
lines. It can be set to an integer (specifying pixels) or a float
(specifying spacing relative to the default frame font height). You can
also set this variable to a cons cell of integers or floats, such as
@code{(@var{top} . @var{bottom})}. When set to a cons cell, the spacing
is distributed above and below the line, allowing for text to be
vertically centered within the line height. See also @ref{Line Height,,,
elisp, The Emacs Lisp Reference Manual}.
@vindex visible-bell
If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts
to make the whole screen blink when it would normally make an audible bell

View file

@ -1000,17 +1000,17 @@ File Shadowing is not available on MS Windows.
@cindex modification dates
@cindex last modified time
You can arrange to have a time stamp in a file be updated
automatically each time you save the file.
(A time stamp may also be called a date stamp or a last modified time.)
Having a time stamp in the text of a file ensures that the time the file
was written will be preserved even if the file is copied or transformed
in a way that loses the file system's modification time.
A time stamp may also be called a date stamp or a last modified time.
You can arrange to have a time stamp in a file update
automatically each time you save the file.
There are two steps to setting up automatic time stamping.
First, the file needs a time stamp template
somewhere in the first eight lines.
The template looks like this:
First, the file needs a time stamp template.
By default, the template occurs somewhere in the first eight lines
and looks like this:
@example
Time-stamp: <>
@ -1026,10 +1026,9 @@ Time-stamp: " "
@findex time-stamp
With that template in place, you can update the current buffer's time
stamp once immediately with the command @kbd{M-x time-stamp}.
Emacs will check for a template; if a template is found,
The Emacs editor will check for a template; if a template is found,
Emacs will write the current date, time, author, and/or
other info between the brackets or quotes.
(If the buffer has no template, @code{time-stamp} does nothing.)
other info between the angle brackets or quotes.
After the first time stamp, the line might look like this:
@example
@ -1039,13 +1038,25 @@ Time-stamp: <1993-07-06 11:05:14 terryg>
Second, configure your Emacs to run @code{time-stamp} whenever it saves a
file, by adding @code{time-stamp}
to @code{before-save-hook} (@pxref{Hooks}).
You can either use @kbd{M-x customize-option} (@pxref{Specific
Customization}) to customize the option @code{before-save-hook},
or you can edit your init file adding this line:
There are two ways to do this: you can
@itemize
@item
use @kbd{M-x customize-option} (@pxref{Specific Customization})
to customize the option @code{before-save-hook}, or
@item
edit your initialization file (@pxref{Init File}),
adding this line:
@example
(add-hook 'before-save-hook 'time-stamp)
@end example
@end itemize
Now every time you save a file, Emacs will look for a time stamp.
If the buffer has no template, @code{time-stamp} does nothing;
any file that does have a time stamp will have it kept up to date
automatically.
@menu
* Time Stamp Customization:: How to customize with time-stamp-pattern.
@ -1064,14 +1075,17 @@ identify a template and where in the file to look for the pattern using
@code{time-stamp-pattern}; for details, see the variable's built-in
documentation (with @kbd{C-h v}, @pxref{Name Help}).
As a simple example, if this line occurs near the top of a file:
As a simple example, suppose you want a manuscript to say the year
and city of publication.
You would like the year updated as you make revisions.
You could have this line near the top of a file:
@example
publishing_year_and_city = "Published nnnn in Boston, Mass.";
@end example
@noindent
then the following comment at the end of the same file tells
and the following comment at the end of the same file to tell
@code{time-stamp} how to identify and update that custom template:
@example
@ -1084,12 +1098,24 @@ then the following comment at the end of the same file tells
This pattern says that the text before the start of the time stamp is
``Published '', and the text after the end is `` in Boston''.
If @code{time-stamp} finds both in one of the first eight lines,
what is between will be replaced by the current year, as requested by
the @code{%Y} format.
If @code{time-stamp} finds both the start and the end in one of the
first eight lines,
what is between will be updated as specified by the format, @code{%Y} in
this example. Since @code{%Y} requests the year, the result might look
like this:
After any change to file-local variables,
type @kbd{M-x normal-mode} to re-read them.
@example
publishing_year_and_city = "Published 2025 in Boston, Mass.";
@end example
By specifying a format of @code{%Y}, we get exactly the year
substituted; other parts of the default format (day, time and
author) are not part of this example pattern and so do not appear in the
result.
After changing the value of @code{time-stamp-pattern}
(or any file-local variable),
type @kbd{M-x normal-mode} so that Emacs notices.
Here is another example, with the time stamp inserted into
the last paragraph of an HTML document.
@ -1126,7 +1152,7 @@ for specifics on formatting and other variables that affect it.
If you are working on a file with multiple authors, and you cannot
be sure the other authors have enabled time-stamping globally in
their Emacs init files, you can force it to be enabled for a
their Emacs initialization files, you can force it to be enabled for a
particular file by adding @code{time-stamp} to that buffer's
@code{before-save-hook} in that file's local variables list.
To extend one of the previous examples:
@ -1140,11 +1166,13 @@ To extend one of the previous examples:
@end group
@end example
@noindent
Although this example shows them both set together,
you can use @code{eval} without also setting @code{time-stamp-pattern}
if you like the default pattern.
The extra arguments to @code{add-hook} used here, @code{nil} and @code{t},
are necessary to have the added hook affect only this buffer.
@node Reverting
@section Reverting a Buffer
@findex revert-buffer
@ -2743,10 +2771,16 @@ are shown in the Customize buffer. Remember to select @samp{Save for
future sessions} if you want to use the same filesets in future Emacs
sessions.
@findex filesets-open
@findex filesets-close
@findex filesets-run-cmd
@vindex filesets-commands
You can use the command @kbd{M-x filesets-open} to visit all the
files in a fileset, and @kbd{M-x filesets-close} to close them. Use
@kbd{M-x filesets-run-cmd} to run a shell command on all the files in
a fileset. These commands are also available from the @samp{Filesets}
@kbd{M-x filesets-run-cmd} to run a command (such as
@code{multi-isearch-files} or @command{grep}) on all the files in
a fileset. These commands, which are specified in
@code{filesets-commands}, are also available from the @samp{Filesets}
menu, where each existing fileset is represented by a submenu.
@xref{Version Control}, for a different concept of filesets:

View file

@ -418,6 +418,20 @@ Suspend Emacs or iconify the selected frame.
Show the list of options.
@end table
@vindex ispell-save-corrections-as-abbrevs
You can have Ispell remember your spelling corrections so that they
are applied automatically when Abbrev mode is enabled (@pxref{Abbrevs}).
If you customize @code{ispell-save-corrections-as-abbrevs} to a non-nil
value, then each time you correct a misspelled word, Emacs saves the
correction as a global abbrev. Then, whenever you type the misspelling
and then a word-separator (@key{SPC}, comma, etc.) in a buffer with
Abbrev mode enabled, Emacs expands the misspelling to its correction.
You can override this and disable saving a particular correction by
supplying a @kbd{C-u} prefix argument when selecting a replacement. If
@code{ispell-save-corrections-as-abbrevs} has its default value of nil,
the meaning of a prefix argument is inverted, in that typing @kbd{C-u}
before selecting a replacement @emph{does} save a global abbrev.
Use the command @kbd{M-@key{TAB}} (@code{completion-at-point}) to
complete the word at point. Insert the beginning of a word, and then
type @kbd{M-@key{TAB}} to select from a list of completions. (If your

View file

@ -422,8 +422,9 @@ search for noninteractive functions too.
Search for functions and variables. Both interactive functions
(commands) and noninteractive functions can be found by this.
@item M-x apropos-user-option
@kindex C-h u
@findex apropos-user-option
@item C-h u
Search for user-customizable variables. With a prefix argument,
search for non-customizable variables too.

View file

@ -1066,12 +1066,12 @@ Display the change history for the current repository on another branch
@item C-x v I
Display log entries for the changes that a ``pull'' operation will
retrieve (@code{vc-log-incoming}).
retrieve (@code{vc-root-log-incoming}).
@vindex vc-use-incoming-outgoing-prefixes
If you customize @code{vc-use-incoming-outgoing-prefixes} to
non-@code{nil}, @kbd{C-x v I} becomes a prefix key, and
@code{vc-log-incoming} becomes bound to @kbd{C-x v I L}.
@code{vc-root-log-incoming} becomes bound to @kbd{C-x v I L}.
@item M-x vc-root-diff-incoming
Display a diff of all changes that a pull operation will retrieve.
@ -1088,11 +1088,11 @@ non-@code{nil}, this command becomes available on @kbd{C-x v I =}.
@item C-x v O
Display log entries for the changes that will be sent by the next
``push'' operation (@code{vc-log-outgoing}).
``push'' operation (@code{vc-root-log-outgoing}).
If you customize @code{vc-use-incoming-outgoing-prefixes} to
non-@code{nil}, @kbd{C-x v O} becomes a prefix key, and
@code{vc-log-outgoing} becomes bound to @kbd{C-x v O L}.
@code{vc-root-log-outgoing} becomes bound to @kbd{C-x v O L}.
@item M-x vc-root-diff-outgoing
Display a diff of all changes that will be sent by the next push
@ -1188,31 +1188,31 @@ or the remote branch references supported by Git.
@kindex C-x v I
@kindex C-x v O
@findex vc-log-incoming
@findex vc-log-outgoing
@findex vc-root-log-incoming
@findex vc-root-log-outgoing
On a decentralized version control system, the @kbd{C-x v I}
(@code{vc-log-incoming}) command displays a log buffer showing the
(@code{vc-root-log-incoming}) command displays a log buffer showing the
changes that will be applied the next time you run the version control
system's pull command to get new revisions from another remote location
(@pxref{Pulling / Pushing}). This other remote location is the default
one from which changes are pulled, as defined by the version control
system; with a prefix argument, @code{vc-log-incoming} prompts for a
particular remote location. Similarly, @kbd{C-x v O}
(@code{vc-log-outgoing}) shows the changes that will be sent to another
remote location, the next time you run the push command; with a prefix
argument, it prompts for a particular destination that in case of some
version control system can be a branch name.
system; with a prefix argument, @code{vc-root-log-incoming} prompts for
a particular remote location. Similarly, @kbd{C-x v O}
(@code{vc-root-log-outgoing}) shows the changes that will be sent to
another remote location, the next time you run the push command; with a
prefix argument, it prompts for a particular destination that in case of
some version control system can be a branch name.
@findex vc-root-diff-incoming
@findex vc-root-diff-outgoing
The closely related commands @code{vc-root-diff-incoming} and
@code{vc-root-diff-outgoing} are the diff analogues of
@code{vc-log-incoming} and @code{vc-log-outgoing}. These display diff
buffers reporting the changes that would be pulled or pushed. You can
use a prefix argument here too to specify a particular remote location.
@code{vc-root-diff-outgoing} is useful as a way to preview your push and
quickly check that all and only the changes you intended to include were
committed and will be pushed.
@code{vc-root-log-incoming} and @code{vc-root-log-outgoing}. These
display diff buffers reporting the changes that would be pulled or
pushed. You can use a prefix argument here too to specify a particular
remote location. @code{vc-root-diff-outgoing} is useful as a way to
preview your push and quickly check that all and only the changes you
intended to include were committed and will be pushed.
@findex vc-diff-incoming
@findex vc-diff-outgoing
@ -1360,6 +1360,7 @@ also prompt for a specific VCS shell command to run for this purpose.
@table @kbd
@item C-x v u
@item C-x v @@
Revert the work file(s) in the current VC fileset to the last revision
(@code{vc-revert}).
@ -1374,24 +1375,25 @@ Delete an unpushed commit from the revision history.
@end table
@kindex C-x v u
@kindex C-x v @@
@findex vc-revert
@vindex vc-revert-show-diff
If you want to discard all the changes you have made to the current
VC fileset, type @kbd{C-x v u} (@code{vc-revert}). This will ask you
for confirmation before discarding the changes. If you agree, the
fileset is reverted.
If you want to discard all the changes you have made to the current VC
fileset, type @kbd{C-x v u} or @kbd{C-x v @@} (@code{vc-revert}). This
will ask you for confirmation before discarding the changes. If you
agree, the fileset is reverted.
If @code{vc-revert-show-diff} is non-@code{nil}, this command will
show you a diff between the work file(s) and the revision from which
you started editing. Afterwards, the diff buffer will either be
killed (if this variable is @code{kill}), or the buffer will be buried
(any other non-@code{nil} value). If you don't want @kbd{C-x v u} to
show a diff, set this variable to @code{nil} (you can still view the
diff directly with @kbd{C-x v =}; @pxref{Old Revisions}).
show you a diff between the work file(s) and the revision from which you
started editing. Afterwards, the diff buffer will either be killed (if
this variable is @code{kill}), or the buffer will be buried (any other
non-@code{nil} value). If you don't want @code{vc-revert} to show you
diffs, set this variable to @code{nil} (you can still view the diff
directly with @kbd{C-x v =}; @pxref{Old Revisions}).
On locking-based version control systems, @kbd{C-x v u} leaves files
unlocked; you must lock again to resume editing. You can also use
@kbd{C-x v u} to unlock a file if you lock it and then decide not to
On locking-based version control systems, @code{vc-revert} leaves
files unlocked; you must lock again to resume editing. You can also use
@code{vc-revert} to unlock a file if you lock it and then decide not to
change it.
@findex vc-revert-or-delete-revision
@ -1562,8 +1564,8 @@ repository, such as the name of the backend in use and the working
directory. In addition, for decentralized VCS, if you have outgoing
commits (@pxref{VC Change Log}), Emacs displays a line @w{"Outgoing : N
unpushed revisions"} where @var{N} is a number. You can click on this
text to execute the @code{vc-log-outgoing} command (@pxref{VC Change
Log}).
text to execute the @code{vc-root-log-outgoing} command (@pxref{VC
Change Log}).
@vindex vc-dir-show-outgoing-count
Emacs tries to use cached information to determine the number of
@ -1641,6 +1643,10 @@ ignore (@code{vc-dir-ignore}). For instance, if the VC is Git, it
will append this file to the @file{.gitignore} file. If given a
prefix, do this with all the marked files.
@item @@
Discard all the changes you have made to the current fileset
(@code{vc-revert}).
@item q
Quit the VC Directory buffer, and bury it (@code{quit-window}).
@ -1706,6 +1712,9 @@ Do an incremental regular expression search on the fileset
Apart from acting on multiple files, these commands behave much like
their single-buffer counterparts (@pxref{Search}).
@c Outstanding changes commands under 'T' are not mentioned because
@c these are an advanced feature documented only in vc1-xtra.texi.
The VC Directory buffer additionally defines some branch-related
commands starting with the prefix @kbd{b}:
@ -1840,9 +1849,9 @@ with Git, and @kbd{hg push} with Mercurial. The default commands
always push to the repository in the default location determined by
the version control system from your branch configuration.
Prior to pushing, you can use @kbd{C-x v O} (@code{vc-log-outgoing})
to view a log buffer of the changes to be sent upstream. @xref{VC
Change Log}.
Prior to pushing, you can use @kbd{C-x v O}
(@code{vc-root-log-outgoing}) to view a log buffer of the changes to be
sent upstream. @xref{VC Change Log}.
@cindex bound branch (Bazaar VCS)
This command is currently supported only by Bazaar, Git, and Mercurial.
@ -1876,9 +1885,9 @@ it into the current branch. With Mercurial, it calls @kbd{hg pull
-u} to fetch changesets from the default remote repository and update
the working directory.
Prior to pulling, you can use @kbd{C-x v I} (@code{vc-log-incoming})
to view a log buffer of the changes to be applied. @xref{VC Change
Log}.
Prior to pulling, you can use @kbd{C-x v I}
(@code{vc-root-log-incoming}) to view a log buffer of the changes to be
applied. @xref{VC Change Log}.
With a centralized version control system like CVS, @kbd{C-x v +}
updates the current VC fileset from the repository.
@ -2049,7 +2058,10 @@ project. See its entry below for description and related options.
If this user option is non-@code{nil}, Emacs displays the name of the
current project (if any) on the mode line; clicking @kbd{mouse-1} on
the project name pops up the menu with the project-related commands.
The default value is @code{nil}.
The default value is @code{nil}. If the value is @code{non-remote},
Emacs will show the name of the project only for local files; this comes
in handy when updating the mode line for projects on remote systems is
slow due to network latencies.
@end defopt
@menu

View file

@ -500,7 +500,7 @@ completion buffer and delete the window showing it
@vindex minibuffer-visible-completions
If the variable @code{minibuffer-visible-completions} is customized to
a non-@code{nil} value, it changes the commands bound to the arrow keys:
the value @code{t}, it changes the commands bound to the arrow keys:
instead of moving in the minibuffer, they move between completion
candidates, like meta-arrow keys do by default (but note that, just as
when the window showing the completion list is selected, here too,
@ -509,7 +509,11 @@ when the window showing the completion list is selected, here too,
regardless of the completion list format). Similarly, @kbd{@key{RET}}
selects the current candidate, like @kbd{M-@key{RET}} does normally.
@code{C-g} hides the completion window, but leaves the minibuffer
active, so you can continue typing at the prompt.
active, so you can continue typing at the prompt. If the value of this
variable is @code{up-down}, only the @kbd{@key{UP}} and @kbd{@key{DOWN}}
arrow keys move point between completion candidates, while
@kbd{@key{RIGHT}} and @kbd{@key{LEFT}} move point in the minibuffer
window.
@node Completion Exit
@subsection Completion Exit

View file

@ -402,6 +402,17 @@ package is somehow unavailable, Emacs signals an error and stops
installation.) A package's requirements list is shown in its help
buffer.
@cindex review
@vindex package-review-policy
If you are cautious when it comes to installing and upgrading packages
from package archives, you can configure @code{package-review-policy} to
give you a chance to review packages before installing them. By setting
the user option to @code{t}, you get to review all packages (including
dependencies), during which you can browse the source code, examine a
diff between the downloaded package and a previous installation or read
a changelog. You can also configure @code{package-review-policy} to
selectively trust or distrust specific packages or archives.
@cindex GNU ELPA
@cindex NonGNU ELPA
By default, Emacs downloads packages from two archives:

View file

@ -298,22 +298,31 @@ yet merged into the target branch.
@cindex outstanding changes
@table @kbd
@item C-x v o =
@item C-x v T =
Display diffs of changes to the VC fileset since the merge base of this
branch and its upstream counterpart (@code{vc-diff-outgoing-base}).
@item C-x v o D
Display all changes since the merge base of this branch and its upstream
counterpart (@code{vc-root-diff-outgoing-base}).
@item C-x v T D
Display a diff of all changes since the merge base of this branch and
its upstream counterpart (@code{vc-root-diff-outgoing-base}).
@item C-x v T l
Display log messages for changes to the VC fileset since the merge base
of this branch and its upstream counterpart
(@code{vc-log-outgoing-base}).
@item C-x v T L
Display log messages for all changes since the merge base of this branch
and its upstream counterpart (@code{vc-root-log-outgoing-base}).
@end table
For decentralized version control systems (@pxref{VCS Repositories}),
these commands provide specialized versions of @kbd{C-x v M D} (see
@pxref{Merge Bases}) which also take into account the state of upstream
repositories. These commands are useful both when working on a single
branch and when developing features on a separate branch
(@pxref{Branches}). These two cases involve using the commands
differently, and so we will describe them separately.
these commands provide specialized versions of @kbd{C-x v M L} and
@w{@kbd{C-x v M D}} (see @pxref{Merge Bases}) which also take into
account the state of upstream repositories. These commands are useful
both when working on a single branch and when developing features on a
separate branch (@pxref{Branches}). These two cases are conceptually
distinct, and so we will introduce them separately.
First, consider working on a single branch. @dfn{Outstanding changes}
are those which you haven't yet pushed upstream. This includes both
@ -321,17 +330,17 @@ unpushed commits and uncommitted changes in your working tree. In many
cases the reason these changes are not pushed yet is that they are not
finished: the changes committed so far don't make sense in isolation.
@kindex C-x v o =
@kindex C-x v T =
@findex vc-diff-outgoing-base
@kindex C-x v o D
@kindex C-x v T D
@findex vc-root-diff-outgoing-base
Type @kbd{C-x v o D} (@code{vc-root-diff-outgoing-base}) to display a
Type @kbd{C-x v T D} (@code{vc-root-diff-outgoing-base}) to display a
summary of all these changes, committed and uncommitted. This summary
is in the form of a diff of what committing and pushing (@pxref{Pulling
/ Pushing}) all these changes would do to the upstream repository. You
can use @kbd{C-x v o =} (@code{vc-diff-outgoing-base}) instead to limit
can use @kbd{C-x v T =} (@code{vc-diff-outgoing-base}) instead to limit
the display of changes to the current VC fileset. (The difference
between @w{@kbd{C-x v o D}} and @w{@kbd{C-x v o =}} is like the
between @w{@kbd{C-x v T D}} and @w{@kbd{C-x v T =}} is like the
difference between @kbd{C-x v D} and @kbd{C-x v =} (@pxref{Old
Revisions}).)@footnote{Another point of comparison is that these
commands are like @w{@kbd{C-x v O =}} (@code{vc-fileset-diff-outgoing})
@ -340,13 +349,25 @@ include uncommitted changes in the reported diffs. Like those other
commands, you can use a prefix argument to specify a particular upstream
location.}
@kindex C-x v T l
@findex vc-log-outgoing-base
@kindex C-x v T L
@findex vc-root-log-outgoing-base
Type @kbd{C-x v T L} (@code{vc-root-log-outgoing-base}) to display a
summary of the same changes in the form of a revision log; this does not
include uncommitted changes. You can use @kbd{C-x v T l}
(@code{vc-log-outgoing-base}) instead to limit the display of changes to
the current VC fileset.
Second, consider developing a feature on a separate branch. Call this
the @dfn{topic branch},@footnote{Topic branches are sometimes called
``feature branches''. It is also common for the term ``feature branch''
to be reserved for a particular kind of topic branch, one that another
branch or other branches are repeatedly merged into.} and call the
branch from which the topic branch was originally created the
@dfn{trunk} or @dfn{development trunk}.
the @dfn{topic branch},@footnote{What we mean by a topic branch is any
shorter-lived branch used for work which will later be merged into a
longer-lived branch. Topic branches are sometimes called ``feature
branches''. It is also common for the term ``feature branch'' to be
reserved for a particular kind of topic branch, one that another branch
or other branches are repeatedly merged into.} and call the branch from
which the topic branch was originally created the @dfn{trunk} or
@dfn{development trunk}.
In this case, outstanding changes is a more specific notion than just
unpushed and uncommitted changes on the topic branch. You're not
@ -357,20 +378,106 @@ upstream repository's development trunk. That means committed changes
on the topic branch that haven't yet been merged into the trunk, plus
uncommitted changes.
@cindex outgoing base, version control
The @dfn{outgoing base} is the upstream location for which the changes
are destined once they are no longer outstanding. In this case, that's
the upstream version of the trunk, to which you and your collaborators
push finished work.
When the current branch is a topic branch and you type @kbd{C-x v T D},
Emacs displays a summary of all the changes that are outstanding against
the trunk to which the current branch will be merged. This summary is
in the form of a diff of what committing and pushing all the changes,
@emph{and} subsequently merging the topic branch, would do to the trunk.
As above, you can use @kbd{C-x v T =} instead to limit the display of
changes to the current VC fileset. @kbd{C-x v T L} and @kbd{C-x v T l}
show the corresponding revision logs, excluding uncommitted changes as
above.
To display a summary of outgoing changes in this multi-branch example,
supply a prefix argument, by typing @w{@kbd{C-u C-x v o =}} or
@w{@kbd{C-u C-x v o D}}. When prompted, enter the outgoing base.
Exactly what you must supply here depends on the name of your
development trunk and the version control system in use. For example,
with Git, usually you will enter @kbd{origin/master}. We hope to
improve these commands such that no prefix argument is required in the
multi-branch case, too.
This functionality relies on Emacs correctly detecting whether the
current branch is a trunk or a topic branch, and in the latter case,
correctly determining the branch to which the topic branch will
eventually be merged. If the autodetection doesn't produce the right
results, there are several options to tweak and override it.
@vindex vc-trunk-branch-regexps
@vindex vc-topic-branch-regexps
The variables @code{vc-trunk-branch-regexps} and
@code{vc-topic-branch-regexps} contain lists of regular expressions
matching the names of branches that should always be considered trunk
and topic branches, respectively. You can also specify prefix arguments
to @kbd{C-x v T @dots{}}. Here is a summary of how to use these
controls:
@enumerate
@item
If the problem is that Emacs thinks your topic branch is a trunk, you
can add either its name, or a regular expression matching its name
(@pxref{Regexps}), to the @code{vc-topic-branch-regexps} variable.
There are a few special kinds of value to simplify common use cases:
@itemize
@item
If an element contains no characters that are special in regular
expressions, then the regular expression is implictly anchored at both
ends, i.e., it matches only a branch with exactly that name.
@item
If the first element of @code{vc-topic-branch-regexps} is the symbol
@code{not}, then the meaning of @code{vc-topic-branch-regexps} is
inverted, in that Emacs treats all branches whose names @emph{don't}
match any element of @code{vc-topic-branch-regexps} to be topic
branches.
@item
If instead of a list of regular expressions the
@code{vc-topic-branch-regexps} variable has the special value @code{t},
then Emacs treats as a topic branch any branch that the
@code{vc-trunk-branch-regexps} variable doesn't positively identify as a
trunk.
@end itemize
@xref{Directory Variables}, regarding how to specify values of
@code{vc-topic-branch-regexps} and @code{vc-trunk-branch-regexps} for a
single VC repository.
@item
If the problem is that Emacs thinks your trunk is a topic branch, you
can add either its name, or a regular expression matching its name, to
the @code{vc-trunk-branch-regexps} variable. This works just like
@code{vc-topic-branch-regexps} with the same special values we just
described. E.g., if the value of @code{vc-trunk-branch-regexps} is
@code{t}, Emacs treats as a trunk any branch that the
@code{vc-topic-branch-regexps} variable doesn't identify as a topic
branch.
@item
Supply a double prefix argument, i.e. @w{@kbd{C-u C-u C-x v T @dots{}}},
and Emacs will treat the current branch as a trunk, no matter what.
This is useful when you simply want to obtain a diff of all outgoing
changes (@pxref{VC Change Log}) plus uncommitted changes.
@item
@cindex outgoing base, version control
Finally, you can take full manual control by supplying a single prefix
argument, i.e. @w{@kbd{C-u C-x v T @dots{}}}. Emacs will prompt you for
the @dfn{outgoing base}, which is the upstream location for which the
changes are destined once they are no longer outstanding.
To treat the current branch as a trunk specify a reference to the
upstream version of the current branch, to which you and your
collaborators push finished work. To treat the current branch as a
topic branch specify a reference to the upstream version of the trunk to
which the topic branch will later be merged.
Exactly how to specify a reference to the upstream version of a branch
depends on the version control system in use. For example, with Git, to
refer to the upstream version of a branch @var{foo}, you would supply
@kbd{origin/@var{foo}}. So if @var{foo} is the current branch then you
would enter an outgoing base of @kbd{origin/@var{foo}} to treat
@var{foo} as a trunk, or an outgoing base of @kbd{origin/@var{bar}} to
treat @var{foo} as a topic branch which will later be merged into a
trunk named @var{bar}.
If there is a default option, it is what Emacs thinks you need to enter
in order to treat the current branch as a topic branch. If there is no
default, then entering nothing at the prompt means to treat the current
branch as a trunk.
@end enumerate
@node Other Working Trees
@subsubsection Multiple Working Trees for One Repository

View file

@ -519,6 +519,8 @@ selected frame, and display the buffer in that new window.
@vindex split-height-threshold
@vindex split-width-threshold
@vindex split-window-preferred-direction
@cindex portrait frame
@cindex landscape frame
The split can be either vertical or horizontal, depending on the
variables @code{split-height-threshold} and
@code{split-width-threshold}. These variables should have integer
@ -528,8 +530,14 @@ window's height, the split puts the new window below. Otherwise, if
split puts the new window on the right. If neither condition holds,
Emacs tries to split so that the new window is below---but only if the
window was not split before (to avoid excessive splitting). Whether
Emacs tries first to split vertically or horizontally, is
determined by the value of @code{split-window-preferred-direction}.
Emacs tries first to split vertically or horizontally when both
conditions hold is determined by the value of
@code{split-window-preferred-direction}. Its default is @code{longest},
which means to split vertically if the window's frame is taller than it
is wide (a @dfn{portrait} frame), and split horizontally if its wider
than it's tall (a @dfn{landscape} frame). The values @code{vertical}
and @code{horizontal} always prefer, respectively, the vertical or the
horizontal split.
@item
Otherwise, display the buffer in a window previously showing it.

View file

@ -486,7 +486,7 @@ A convenient way to do this is to use a @dfn{progress reporter}.
(progress-reporter-done progress-reporter))
@end smallexample
@defun make-progress-reporter message &optional min-value max-value current-value min-change min-time
@defun make-progress-reporter message &optional min-value max-value current-value min-change min-time context
This function creates and returns a progress reporter object, which
you will use as an argument for the other functions listed below. The
idea is to precompute as much data as possible to make progress
@ -513,13 +513,19 @@ If @var{min-value} and @var{max-value} are numbers, you can give the
argument @var{current-value} a numerical value specifying the initial
progress; if omitted, this defaults to @var{min-value}.
The remaining arguments control the rate of echo area updates. The
progress reporter will wait for at least @var{min-change} more
percents of the operation to be completed before printing next
message; the default is one percent. @var{min-time} specifies the
minimum time in seconds to pass between successive prints; the default
is 0.2 seconds. (On some operating systems, the progress reporter may
handle fractions of seconds with varying precision).
The arguments @var{min-change} and @var{min-time} control the rate of
echo area updates. The progress reporter will wait for at least
@var{min-change} more percents of the operation to be completed before
printing next message; the default is one percent. @var{min-time}
specifies the minimum time in seconds to pass between successive prints;
the default is 0.2 seconds. (On some operating systems, the progress
reporter may handle fractions of seconds with varying precision).
If @var{context} is the symbol @code{async}, it announces that the updates
will occur asynchronously. Backends can use that info to prevent the
progress updates from interfering with other data. For example, the
backend that displays the progress in the echo area will not display
those async updates when the echo area is in use.
This function calls @code{progress-reporter-update}, so the first
message is printed immediately.
@ -2576,10 +2582,13 @@ the spacing relative to the frame's default line height.
@vindex line-spacing
You can specify the line spacing for all lines in a buffer via the
buffer-local @code{line-spacing} variable. An integer specifies
the number of pixels put below lines. A floating-point number
specifies the spacing relative to the default frame line height. This
overrides line spacings specified for the frame.
buffer-local @code{line-spacing} variable. An integer specifies the
number of pixels put below lines. A floating-point number specifies the
spacing relative to the default frame line height. A cons cell of
integers or floating-point numbers specifies the spacing put above and
below the line, allowing for vertically centering text. This overrides
line spacings specified for the frame.
@kindex line-spacing @r{(text property)}
Finally, a newline can have a @code{line-spacing} text or overlay
@ -4905,7 +4914,7 @@ either a string or a vector of integers, where each element (an
integer) corresponds to one row of the bitmap. Each bit of an integer
corresponds to one pixel of the bitmap, where the low bit corresponds
to the rightmost pixel of the bitmap. (Note that this order of bits
is opposite of the order in XBM images; @pxref{XBM Images}.)
is the opposite of the order in XBM images; @pxref{XBM Images}.)
The height is normally the length of @var{bits}. However, you
can specify a different height with non-@code{nil} @var{height}. The width
@ -6361,8 +6370,8 @@ used for each pixel in the XBM that is 0. The default is the frame's
background color.
@end table
If you specify an XBM image using data within Emacs instead of an
external file, use the following three properties:
To specify an XBM image using data within Emacs instead of an
external file, use the following properties:
@table @code
@item :data @var{data}
@ -6993,6 +7002,7 @@ Supports the @code{:index} property. @xref{Multi-Frame Images}.
@item WebP
Image type @code{webp}.
Supports the @code{:index} property. @xref{Multi-Frame Images}.
@end table
@node Defining Images
@ -7314,8 +7324,8 @@ about these image-specific key bindings.
@cindex image frames
Some image files can contain more than one image. We say that there
are multiple ``frames'' in the image. At present, Emacs supports
multiple frames for GIF, TIFF, and certain ImageMagick formats such as
DJVM@.
multiple frames for GIF, TIFF, WebP, and certain ImageMagick formats
such as DJVM@.
The frames can be used either to represent multiple pages (this is
usually the case with multi-frame TIFF files, for example), or to
@ -7405,7 +7415,7 @@ period much shorter than @code{image-cache-eviction-delay} (see
below), you can opt to flush unused images yourself, instead of
waiting for Emacs to do it automatically.
@defun clear-image-cache &optional filter
@defun clear-image-cache &optional filter animation-filter
This function clears an image cache, removing all the images stored in
it. If @var{filter} is omitted or @code{nil}, it clears the cache for
the selected frame. If @var{filter} is a frame, it clears the cache
@ -7413,6 +7423,16 @@ for that frame. If @var{filter} is @code{t}, all image caches are
cleared. Otherwise, @var{filter} is taken to be a file name, and all
images associated with that file name are removed from all image
caches.
This function also clears the image animation cache, which is a separate
cache that Emacs maintains for animated multi-frame images
(@pxref{Multi-Frame Images}). If @var{animation-filter} is omitted or
@code{nil}, it clears the animation cache in addition to the image
caches selected by @var{filter}. Otherwise, this function removes the
image with specification @code{eq} to @var{animation-filter} only from
the animation cache, and does not clear any image caches. This can help
reduce memory usage after an animation is stopped but the image is still
displayed.
@end defun
If an image in the image cache has not been displayed for a specified

View file

@ -109,6 +109,25 @@ must be a root frame, which means it cannot be a child frame itself
descending from it.
@end defun
@cindex frame identifier
@defun frame-id &optional frame
This function returns the unique identifier of a frame, an integer,
assigned to @var{frame}. If @var{frame} is @code{nil} or unspecified,
it defaults to the selected frame (@pxref{Input Focus}). This can be
used to unambiguously identify a frame in a context where you do not or
cannot use a frame object.
A frame undeleted using @command{undelete-frame} will retain its
identifier. A frame cloned using @command{clone-frame} will not retain
its original identifier. @xref{Frame Commands,,,emacs, the Emacs
Manual}.
Frame identifiers are not persisted using the desktop library
(@pxref{Desktop Save Mode}), @command{frameset-to-register}, or
@code{frameset-save}, and each of their restored frames will bear a new
unique id.
@end defun
@menu
* Creating Frames:: Creating additional frames.
* Multiple Terminals:: Displaying on several different devices.
@ -198,6 +217,11 @@ A normal hook run by @code{make-frame} before it creates the frame.
An abnormal hook run by @code{make-frame} after it created the frame.
Each function in @code{after-make-frame-functions} receives one
argument, the frame just created.
You can consult the frame parameters @code{cloned-from} and
@code{undeleted} in your function to determine if a frame was cloned
using @command{clone-frame}, or if it was undeleted using
@command{undelete-frame}. @xref{Frame Parameters}.
@end defvar
Note that any functions added to these hooks by your initial file are
@ -2206,8 +2230,18 @@ left position ratio is preserved if the @sc{cdr} of the cell is either
@code{t} or @code{left-only}. The top position ratio is preserved if
the @sc{cdr} of the cell is either @code{t} or @code{top-only}. This
parameter has not been yet implemented on text terminals.
@end table
@vindex cloned-from@r{, a frame parameter}
@item cloned-from
The original frame if this frame was made via @code{clone-frame}
(@pxref{Creating Frames,,,emacs, the Emacs Manual}).
@vindex undeleted@r{, a frame parameter}
@item undeleted
This is non-@code{nil} if this frame was undeleted using the command
@command{undelete-frame} (@pxref{Frame Commands,,,emacs, the Emacs
Manual}).
@end table
@node Mouse Dragging Parameters
@subsubsection Mouse Dragging Parameters
@ -3154,6 +3188,29 @@ could switch to a different terminal without switching back when
you're done.
@end deffn
@deffn Command select-frame-by-id id &optional noerror
This function searches open and undeletable frames for a matching frame
identifier @var{id} (@pxref{Frames}). If found, its frame is undeleted,
if necessary, then raised, given focus, and made the selected frame. On
a text terminal, raising a frame causes it to occupy the entire terminal
display.
This function returns the selected frame or signals an error if @var{id}
is not found, unless @var{noerror} is non-@code{nil}, in which case it
returns @code{nil}.
@end deffn
@deffn Command undelete-frame-by-id id &optional noerror
This function searches undeletable frames for a matching frame
identifier @var{id} (@pxref{Frames}). If found, its frame is undeleted,
raised, given focus, and made the selected frame. On a text terminal,
raising a frame causes it to occupy the entire terminal display.
This function returns the undeleted frame or signals an error if
@var{id} is not found, unless @var{noerror} is non-@code{nil}, in which
case it returns @code{nil}.
@end deffn
@cindex text-terminal focus notification
Emacs cooperates with the window system by arranging to select frames
as the server and window manager request. When a window system

View file

@ -286,13 +286,9 @@ program does not use so much space as to force a second garbage
collection).
@end quotation
@deffn Command garbage-collect
This command runs a garbage collection, and returns information on
the amount of space in use. (Garbage collection can also occur
spontaneously if you use more than @code{gc-cons-threshold} bytes of
Lisp data since the previous garbage collection.)
@code{garbage-collect} returns a list with information on amount of space in
@defun garbage-collect-heapsize
This function returns information on the current memory usage.
The return value is a list with information on amount of space in
use, where each entry has the form @samp{(@var{name} @var{size} @var{used})}
or @samp{(@var{name} @var{size} @var{used} @var{free})}. In the entry,
@var{name} is a symbol describing the kind of objects this entry represents,
@ -422,6 +418,16 @@ Total heap size, in @var{unit-size} units.
@item free-size
Heap space which is not currently used, in @var{unit-size} units.
@end table
@end defun
@deffn Command garbage-collect
This command runs a garbage collection, and returns information on
the amount of space in use. (Garbage collection can also occur
spontaneously if you use more than @code{gc-cons-threshold} bytes of
Lisp data since the previous garbage collection.)
@code{garbage-collect} returns the same list as shown above for
@code{garbage-collect-heapsize}.
@end deffn
@defopt garbage-collection-messages
@ -1660,6 +1666,7 @@ point to an array of at least @var{count} elements specifying the
little-endian magnitude of the return value.
@end deftypefn
@cindex GMP, the GNU Multiprecision Library
The following example uses the GNU Multiprecision Library (GMP) to
calculate the next probable prime after a given integer.
@xref{Top,,,gmp}, for a general overview of GMP, and @pxref{Integer
@ -1752,7 +1759,11 @@ next_prime (emacs_env *env, ptrdiff_t nargs, emacs_value *args,
mpz_t p;
mpz_init (p);
extract_big_integer (env, args[0], p);
/* Assume Emacs is linked to the full GMP library,
not to its mini-gmp subset that lacks mpz_nextprime. */
mpz_nextprime (p, p);
emacs_value result = make_big_integer (env, p);
mpz_clear (p);
return result;
@ -2844,11 +2855,23 @@ Avoid arbitrary limits. For example, avoid @code{int len = strlen
fit in @code{int} range.
@item
@cindex overflow in integers
@cindex integer overflow
Do not assume that signed integer arithmetic wraps around on overflow.
This is no longer true of Emacs porting targets: signed integer
overflow has undefined behavior in practice, and can dump core or
even cause earlier or later code to behave illogically. Unsigned
overflow does wrap around reliably, modulo a power of two.
overflow does wrap around reliably, modulo a power of two,
if all operand types are unsigned and are @code{unsigned int} or wider.
@item
Use the macros of @code{<stdckdint.h>} to check for integer overflow
or to implement wraparound arithmetic reliably with integer types
that are signed or are narrower than @code{unsigned int}.
Although @code{<stdckdint.h>} was not standardized until C23,
on non-C23 platforms Emacs internally provides a fallback substitute.
Avoid complex arguments to its macros @code{ckd_add}, @code{ckd_sub} and
@code{ckd_mul}, as the fallback macros might evaluate arguments more than once.
@item
Prefer signed types to unsigned, as code gets confusing when signed
@ -2907,10 +2930,17 @@ although @code{off_t} is always signed, @code{time_t} need not be.
@item
Prefer @code{intmax_t} for representing values that might be any
signed integer value.
signed integer value in machine range.
A @code{printf}-family function can print such a value
via a format like @code{"%"PRIdMAX}.
@item
Prefer Emacs integers, which are either fixnums or bignums,
for representing values that might be outside machine range.
Although low level code uses GMP directly for efficiency,
Emacs integers are typically more convenient at higher levels of
abstraction.
@item
Prefer @code{bool}, @code{false} and @code{true} for booleans.
Using @code{bool} can make programs easier to read and a bit faster than

View file

@ -57,14 +57,18 @@ buffer size plus 1. If narrowing is in effect (@pxref{Narrowing}), then
point is constrained to fall within the accessible portion of the buffer
(possibly at one end of it).
@cindex buffer point
Each buffer has its own value of point, which is independent of the
value of point in other buffers. Each window also has a value of point,
which is independent of the value of point in other windows on the same
buffer. This is why point can have different values in various windows
that display the same buffer. When a buffer appears in only one window,
the buffer's point and the window's point normally have the same value,
so the distinction is rarely important. @xref{Window Point}, for more
details.
which is independent of the value of point in other windows showing the
same buffer. This is why the cursor may appear at different positions
in various windows that display the same buffer. Wherever necessary, we
use the terms @dfn{buffer point} for the unique position of point of a
specific buffer and the term @dfn{window point} for the position of
point in a specific window showing that buffer. When a buffer appears
in only one window, its buffer's point and that window's point normally
have the same value, so the distinction is rarely important.
@xref{Window Point}, for more details.
@defun point
@cindex current buffer position

View file

@ -1842,11 +1842,11 @@ text arrives, you could insert a line like the following just before the
To force point to the end of the new output, no matter where it was
previously, eliminate the variable @code{moving} from the example and
call @code{goto-char} unconditionally. Note that this doesn't
necessarily move the window point. The default filter actually uses
@code{insert-before-markers} which moves all markers, including the
window point. This may move unrelated markers, so it's generally
better to move the window point explicitly, or set its insertion type
to @code{t} (@pxref{Window Point}).
necessarily move window point. The default filter actually uses
@code{insert-before-markers} which moves all markers, including window
point. This may move unrelated markers, so it's generally better to
move window point explicitly, or set its insertion type to @code{t}
(@pxref{Window Point}).
@ignore
In earlier Emacs versions, every filter function that did regular

View file

@ -713,11 +713,11 @@ would have printed for the same argument.
(prin1-to-string (mark-marker))
@result{} "#<marker at 2773 in strings.texi>"
@end group
@end example
If @var{overrides} is non-@code{nil}, it should either be @code{t}
(which tells @code{prin1} to use the defaults for all printer related
variables), or a list of settings. @xref{Output Overrides}, for details.
@end example
If @var{noescape} is non-@code{nil}, that inhibits use of quoting
characters in the output. (This argument is supported in Emacs versions

View file

@ -6014,12 +6014,21 @@ must be a Lisp object that can be serialized as JSON (@pxref{Parsing
JSON}). The result is forwarded to the server as the JSONRPC
@code{result} object. A non-local return, achieved by calling the
function @code{jsonrpc-error}, causes an error response to be sent to
the server. The details of the accompanying JSONRPC @code{error}
object are filled out with whatever was passed to
@code{jsonrpc-error}. A non-local return triggered by an unexpected
error of any other type also causes an error response to be sent
(unless you have set @code{debug-on-error}, in which case this calls
the Lisp debugger, @pxref{Error Debugging}).
the server. A non-local return triggered by an unexpected error of any
other type also causes a response to be sent. The debugger is never
called (unless you have set @code{debug-on-error}, in which case the
Lisp debugger may be called, @pxref{Error Debugging}).
The details of the accompanying JSONRPC @code{error} object are filled
out automatically (in the case of unexpected errors) or with whatever
was passed to @code{jsonrpc-error} (in the case of explicit calls).
Exceptionally, an explicit call to @code{jsonrpc-error} which sets
@code{:code} to 32000 and @code{:data} to any JSON object has the
meaning of ``no error'' and triggers a normal response to the remote
endpoint with @code{result} being set to @code{:data}. This is useful
if the application wants to treat some non-local exits such as user
quits as benign.
@findex jsonrpc-convert-to-endpoint
@findex jsonrpc-convert-from-endpoint

View file

@ -3549,6 +3549,72 @@ the selected window is not used; thus if the selected frame has a
single window, it is not used.
@end defun
@defun display-buffer-in-new-tab buffer alist
This function tries to display @var{buffer} in a new tab.
If @var{alist} contains a non-@code{nil} @code{tab-name} entry (which
may be a string or a function), the buffer is displayed in a new tab
with that name. If the @code{tab-name} entry is a function, it is
called with two arguments (@var{buffer} and @var{alist}), and should
return the tab name.
If the @code{tab-name} entry is omitted or @code{nil}, a new tab is
created without an explicit name.
If @var{alist} contains a non-@code{nil} @code{tab-group} entry, this
defines the tab group, overriding user option
@code{tab-bar-new-tab-group}. This entry may again be a string or a
function which is called in the same manner as @code{tab-name}.
@end defun
@defun display-buffer-in-tab buffer alist
This function tries to display @var{buffer} in a new or existing tab.
If @var{alist} contains a non-@code{nil} @code{reusable-frames} entry
then the frames indicated by its value are searched for an existing tab
which already displays the buffer. The possible values of
@code{reusable-frames} are:
@itemize @bullet
@item @code{t}
means consider all existing frames.
@item @code{visible}
means consider all visible frames.
@item 0
means consider all frames on the current terminal.
@item A frame
means consider that frame only.
@item Any other non-@code{nil} value
means consider the selected frame.
@item @code{nil}
means do not search any frames (equivalent to omitting the entry). Note
that this is different to the typical meaning of the value @code{nil}
for a @code{reusable-frames} entry in a buffer display action alist.
@end itemize
If @var{alist} contains a non-@code{nil} @code{ignore-current-tab}
entry, then the current tab is skipped when searching for a reusable
tab. Otherwise the current tab is used by preference if it already
displays the buffer.
If a window displaying the buffer is located in any reusable tab then
that tab and window are selected.
If no such window is located, the buffer is displayed in a new or
existing tab based on the @var{alist} entry @code{tab-name} (which may
be a string or a function). If a tab with this name already exists then
that tab is selected, otherwise a new tab with that name is created. If
the @code{tab-name} entry is a function, it is called with two arguments
(@var{buffer} and @var{alist}), and should return the tab name. If the
@code{tab-name} entry is omitted or @code{nil}, a new tab is created
without an explicit name.
If a new tab is created and @var{alist} contains a non-@code{nil}
@code{tab-group} entry, this defines the tab group, overriding user
option @code{tab-bar-new-tab-group}. This entry may again be a string
or a function which is called in the same manner as @code{tab-name}.
@end defun
@defun display-buffer-no-window buffer alist
If @var{alist} has a non-@code{nil} @code{allow-no-window} entry, then
this function does not display @var{buffer} and returns the symbol
@ -3661,6 +3727,10 @@ well. @code{display-buffer-in-previous-window} consults it when
searching for a window that previously displayed the buffer on another
frame.
Action function @code{display-buffer-in-tab} searches the tabs of the
frame(s) identified by this entry, and also interprets the value
@code{nil} differently.
@vindex inhibit-switch-frame@r{, a buffer display action alist entry}
@item inhibit-switch-frame
A non-@code{nil} value prevents another frame from being raised or
@ -3981,6 +4051,19 @@ List, @code{buffer-match-p}}. Thus, if a Lisp program uses a particular
@var{symbol} as the category when calling @code{display-buffer}, users
can customize how these buffers will be displayed by including such an
entry in @code{display-buffer-alist}.
@vindex tab-name@r{, a buffer display action alist entry}
@item tab-name
The value names the tab in which the buffer should be displayed. This
entry is used by @code{display-buffer-in-new-tab} and (conditionally) by
@code{display-buffer-in-tab}.
@vindex tab-group@r{, a buffer display action alist entry}
@vindex tab-bar-new-tab-group@r{, override for buffer display actions}
@item tab-group
The value names the tab group to use when creating a new tab, overriding
user option @code{tab-bar-new-tab-group}. This entry is used by
@code{display-buffer-in-new-tab} and @code{display-buffer-in-tab}.
@end table
By convention, the entries @code{window-height}, @code{window-width}
@ -4039,16 +4122,19 @@ window. If @var{window} cannot be split, it returns @code{nil}. If
@var{window} is omitted or @code{nil}, it defaults to the selected
window.
This function obeys the usual rules that determine when a window may
be split (@pxref{Splitting Windows}). It first tries to split by
placing the new window below, subject to the restriction imposed by
@code{split-height-threshold} (see below), in addition to any other
restrictions. If that fails, it tries to split by placing the new
window to the right, subject to @code{split-width-threshold} (see
below). If that also fails, and the window is the only window on its
frame, this function again tries to split and place the new window
below, disregarding @code{split-height-threshold}. If this fails as
well, this function gives up and returns @code{nil}.
This function obeys the usual rules that determine when a window may be
split (@pxref{Splitting Windows}). It first tries either a vertical
split by placing the new window below, subject to the restriction
imposed by @code{split-height-threshold} (see below), or a horizontal
split that places the new window to the right, subject to
@code{split-width-threshold}, in addition to any other restrictions.
Whether it tries first to split vertically or horizontally depends on
the value of the user option @code{split-window-preferred-direction}.
If splitting along the first dimension fails, it tries to split along
the other dimension. If that also fails, and the window is the only
window on its frame, this function again tries to split and place the
new window below, disregarding @code{split-height-threshold}. If this
fails as well, this function gives up and returns @code{nil}.
@end defun
@defopt split-height-threshold
@ -4067,6 +4153,18 @@ window has at least that many columns. If the value is @code{nil},
that means not to split this way.
@end defopt
@defopt split-window-preferred-direction
This variable determines the first dimension along which
@code{split-window-sensibly} tries to split the window, if the window
could be split both vertically and horizontally, as determined by the
values of @code{split-height-threshold} and
@code{split-width-threshold}. The default value is @code{longest},
which means to split vertically if the height of the window's frame is
greater or equal to its width, and horizontally otherwise. The values
@code{vertical} and @code{horizontal} specify the direction in which to
attempt the first split.
@end defopt
@defopt even-window-sizes
This variable, if non-@code{nil}, causes @code{display-buffer} to even
window sizes whenever it reuses an existing window, and that window is
@ -4826,8 +4924,8 @@ Each list element has the form @code{(@var{buffer} @var{window-start}
@var{window-pos})}, where @var{buffer} is a buffer previously shown in
the window, @var{window-start} is the window start position
(@pxref{Window Start and End}) when that buffer was last shown, and
@var{window-pos} is the point position (@pxref{Window Point}) when
that buffer was last shown in @var{window}.
@var{window-pos} is the window point position (@pxref{Window Point})
when that buffer was last shown in @var{window}.
The list is ordered so that earlier elements correspond to more
recently-shown buffers, and the first element usually corresponds to the
@ -5774,8 +5872,8 @@ makes it useful to have multiple windows showing one buffer.
@itemize @bullet
@item
The window point is established when a window is first created; it is
initialized from the buffer's point, or from the window point of another
Window point is established when a window is first created; it is
initialized from the buffer's point, or from window point of another
window opened on the buffer if such a window exists.
@item
@ -5789,6 +5887,18 @@ the other windows are stored in those windows.
@item
As long as the selected window displays the current buffer, the window's
point and the buffer's point always move together; they remain equal.
@item
Many Emacs functions temporarily select a window in order to operate on
its contents. This will move point (@pxref{Point}) of that
window's buffer to the position of window point of that window and
not restore buffer point to its previous position when terminating
the temporary selection. This means that when one and the same buffer
is simultaneously displayed in more than one window, its buffer point
may change in unpredictable ways to the position of window point of any
of these windows as a side-effect of things like redisplay, calling
@code{with-selected-window} (@pxref{Selecting Windows}) or running
@code{window-configuration-change-hook} (@pxref{Window Hooks}).
@end itemize
@cindex cursor
@ -5844,6 +5954,40 @@ This function returns the cursor type of @var{window}, defaulting to the
selected window.
@end defun
@defun window-cursor-info &optional window
This function returns information about the cursor of @var{window},
defaulting to the selected window.
The value returned by the function is a vector of the form
@w{@code{[@var{type} @var{x} @var{y} @var{width} @var{height}
@var{ascent}]}}. Here's the description of each components of this
vector:
@table @var
@item type
The type of the cursor, a symbol. This is the same value returned by
@code{window-cursor-type}.
@item x
@itemx y
The pixel coordinates of the cursor's top-left corner, relative to the
top-left corner of @var{window}'s text area.
@item width
@itemx height
The pixel dimensions of the cursor.
@item ascent
The number of pixels the cursor extends above the baseline.
@end table
If the cursor is not currently displayed for @var{window}, this function
returns @code{nil}.
Any element except the first one in the returned vector may be
@code{-1}, meaning the actual value is currently unavailable.
@end defun
@node Window Start and End
@section The Window Start and End Positions
@cindex window start position
@ -7185,8 +7329,8 @@ function may also delete windows which were found live by
Each entry in the list that is passed as the second argument to the
function is itself a list of six values: the window whose buffer was
found dead, the dead buffer or its name, the positions of window-start
(@pxref{Window Start and End}) and window-point (@pxref{Window Point})
found dead, the dead buffer or its name, the positions of window start
(@pxref{Window Start and End}) and window point (@pxref{Window Point})
of the buffer in that window, the dedicated state of the window as
previously reported by @code{window-dedicated-p} and a flag that is
@code{t} if the window has been found to be alive by

View file

@ -35694,10 +35694,9 @@ The variable @code{calc-string-maximum-character} is the maximum value
of a vector's elements for @code{calc-display-strings}, @code{string},
and @code{bstring} to display the vector as a string. This maximum
@emph{must} represent a character, i.e. it's a non-negative integer less
than or equal to @code{(max-char)} or @code{0x3FFFFF}. Any negative
value effectively disables the display of strings, and for values larger
than @code{0x3FFFFF} the display acts as if the maximum were
@code{0x3FFFFF}. Some natural choices (and their resulting ranges) are:
than or equal to @code{(max-char)} or @code{0x3FFFFF}. Any value not
representing a character effectively disables the display of strings.
Some natural choices (and their resulting ranges) are:
@itemize
@item

View file

@ -64,6 +64,7 @@ another. An overview of D-Bus can be found at
* Alternative Buses:: Alternative buses and environments.
* Errors and Events:: Errors and events.
* Monitoring Messages:: Monitoring messages.
* Inhibitor Locks:: Inhibit system shutdowns and sleep states.
* Index:: Index including concepts, functions, variables.
* GNU Free Documentation License:: The license for this documentation.
@ -124,7 +125,7 @@ name could be @samp{org.gnu.Emacs.TextEditor} or
@node Inspection
@chapter Inspection of D-Bus services.
@chapter Inspection of D-Bus services
@cindex inspection
@menu
@ -139,7 +140,7 @@ name could be @samp{org.gnu.Emacs.TextEditor} or
@node Version
@section D-Bus version.
@section D-Bus version
D-Bus has evolved over the years. New features have been added with
new D-Bus versions. There are two variables, which allow the determination
@ -158,7 +159,7 @@ It is also @code{nil}, if it cannot be determined at runtime.
@node Bus names
@section Bus names.
@section Bus names
There are several basic functions which inspect the buses for
registered names. Internally they use the basic interface
@ -267,7 +268,7 @@ at D-Bus @var{bus}, as a string.
@node Introspection
@section Knowing the details of D-Bus services.
@section Knowing the details of D-Bus services
D-Bus services publish their interfaces. This can be retrieved and
analyzed during runtime, in order to understand the used
@ -483,7 +484,7 @@ If @var{object} has no @var{attribute}, the function returns
@node Nodes and Interfaces
@section Detecting object paths and interfaces.
@section Detecting object paths and interfaces
The first elements, to be introspected for a D-Bus object, are further
object paths and interfaces.
@ -593,7 +594,7 @@ data from a running system:
@node Methods and Signal
@section Applying the functionality.
@section Applying the functionality
Methods and signals are the communication means to D-Bus. The
following functions return their specifications.
@ -673,7 +674,7 @@ Example:
@node Properties and Annotations
@section What else to know about interfaces.
@section What else to know about interfaces
Interfaces can have properties. These can be exposed via the
@samp{org.freedesktop.DBus.Properties} interface@footnote{See
@ -894,7 +895,7 @@ An attribute value can be retrieved by
@node Arguments and Signatures
@section The final details.
@section The final details
Methods and signals have arguments. They are described in the
@code{arg} XML elements.
@ -962,7 +963,7 @@ non-@code{nil}, @var{direction} must be @samp{out}. Example:
@node Type Conversion
@chapter Mapping Lisp types and D-Bus types.
@chapter Mapping Lisp types and D-Bus types
@cindex type conversion
D-Bus method calls and signals accept usually several arguments as
@ -975,7 +976,7 @@ applied Lisp object @expansion{} D-Bus type for input parameters, and
D-Bus type @expansion{} Lisp object for output parameters.
@section Input parameters.
@section Input parameters
Input parameters for D-Bus methods and signals occur as arguments of a
Lisp function call. The following mapping to D-Bus types is
@ -1116,7 +1117,7 @@ lower-case hex digits. As a special case, "" is escaped to
@end defun
@section Output parameters.
@section Output parameters
Output parameters of D-Bus methods and signals are mapped to Lisp
objects.
@ -1199,7 +1200,7 @@ that string:
@node Synchronous Methods
@chapter Calling methods in a blocking way.
@chapter Calling methods in a blocking way
@cindex method calls, synchronous
@cindex synchronous method calls
@ -1240,6 +1241,8 @@ running):
"org.freedesktop.systemd1.Manager" "RestartUnit"
:authorizable t
"bluetooth.service" "replace")
@result{} "/org/freedesktop/systemd1/job/17508"
@end lisp
The remaining arguments @var{args} are passed to @var{method} as
@ -1317,7 +1320,7 @@ emulate the @code{lshal} command on GNU/Linux systems:
@node Asynchronous Methods
@chapter Calling methods non-blocking.
@chapter Calling methods non-blocking
@cindex method calls, asynchronous
@cindex asynchronous method calls
@ -1369,7 +1372,7 @@ message arrives, and @var{handler} is called. Example:
@node Register Objects
@chapter Offering own services.
@chapter Offering own services
@cindex method calls, returning
@cindex returning method calls
@ -1720,7 +1723,7 @@ to the service from D-Bus.
@node Signals
@chapter Sending and receiving signals.
@chapter Sending and receiving signals
@cindex signals
Signals are one way messages. They carry input parameters, which are
@ -1752,6 +1755,8 @@ arguments. They are converted into D-Bus types as described in
:session nil dbus-path-emacs
(concat dbus-interface-emacs ".FileManager") "FileModified"
"/home/albinus/.emacs")
@result{} nil
@end lisp
@end defun
@ -1779,7 +1784,10 @@ argument.
@var{handler} is a Lisp function to be called when the @var{signal} is
received. It must accept as arguments the output parameters
@var{signal} is sending.
@var{signal} is sending.@footnote{It is possible to register different
handlers for the same signal. All registered handlers will be called
when the signal arrives. This is useful for example if different Lisp
packages are interested in the same signal.}
The remaining arguments @var{args} can be keywords or keyword string
pairs.@footnote{For backward compatibility, the arguments @var{args}
@ -1852,7 +1860,7 @@ for a dummy signal, and check the result:
@node Alternative Buses
@chapter Alternative buses and environments.
@chapter Alternative buses and environments
@cindex bus names
@cindex UNIX domain socket
@cindex TCP/IP socket
@ -1979,7 +1987,7 @@ running. This could be achieved by
@node Errors and Events
@chapter Errors and events.
@chapter Errors and events
@cindex debugging
@cindex errors
@cindex events
@ -2138,7 +2146,7 @@ whether a given D-Bus error is related to them.
@node Monitoring Messages
@chapter Monitoring messages.
@chapter Monitoring messages
@cindex monitoring
@defun dbus-register-monitor bus &optional handler &key type sender destination path interface member
@ -2178,12 +2186,16 @@ The following form shows all D-Bus events on the session bus in buffer
@lisp
(dbus-register-monitor :session)
@result{} ((:monitor :session-private) (nil nil dbus-monitor-handler))
@end lisp
And this form restricts the monitoring on D-Bus errors:
@lisp
(dbus-register-monitor :session nil :type "error")
@result{} ((:monitor :session-private) (nil nil dbus-monitor-handler))
@end lisp
@end defun
@ -2193,6 +2205,111 @@ switches to the monitor buffer.
@end deffn
@node Inhibitor Locks
@chapter Inhibit system shutdowns and sleep states
@uref{https://systemd.io/INHIBITOR_LOCKS/, Systemd} includes a logic to
inhibit system shutdowns and sleep states. It can be controlled by a
D-Bus API@footnote{@uref{https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.login1.html}}.
Because this API includes handling of file descriptors, not all
functions can be implemented by simple D-Bus method calls. Therefore,
the following functions are provided.
@defun dbus-make-inhibitor-lock what why &optional block
This function creates an inhibitor for system shutdowns and sleep states.
@var{what} is a colon-separated string of lock types: @samp{shutdown},
@samp{sleep}, @samp{idle}, @samp{handle-power-key},
@samp{handle-suspend-key}, @samp{handle-hibernate-key},
@samp{handle-lid-switch}. Example: @samp{shutdown:idle}.
@c@var{who} is a descriptive string of who is taking the lock. If it is
@c@code{nil}, it defaults to @samp{Emacs}.
@var{why} is a descriptive string of why the lock is taken. Example:
@samp{Package Update in Progress}.
The optional @var{block} is the mode of the inhibitor lock, either
@samp{block} (@var{block} is non-@code{nil}), or @samp{delay}.
Note, that the @code{who} argument of the inhibitor lock object of the
systemd manager is always set to the string @samp{Emacs}.
It returns a file descriptor or @code{nil}, if the lock cannot be
acquired. If there is already an inhibitor lock for the triple
@code{(WHAT WHY BLOCK)}, this lock is returned. Example:
@lisp
(dbus-make-inhibitor-lock "sleep" "Test")
@result{} 25
@end lisp
@end defun
@defun dbus-registered-inhibitor-locks
Return registered inhibitor locks, an alist.
This allows to check, whether other packages of the running Emacs
instance have acquired an inhibitor lock as well.
An entry in this list is a list @code{(@var{fd} @var{what} @var{why}
@var{block})}. The car of the list is the file descriptor retrieved
from a @code{dbus-make-inhibitor-lock} call. The cdr of the list
represents the three arguments @code{dbus-make-inhibitor-lock} was
called with. Example:
@lisp
(dbus-registered-inhibitor-locks)
@result{} ((25 "sleep" "Test" nil))
@end lisp
@end defun
@defun dbus-close-inhibitor-lock lock
Close inhibitor lock file descriptor.
@var{lock}, a file descriptor, must be the result of a
@code{dbus-make-inhibitor-lock} call. It returns @code{t} in case of
success, or @code{nil} if it isn't be possible to close the lock, or if
the lock is closed already. Example:
@lisp
(dbus-close-inhibitor-lock 25)
@result{} t
@end lisp
@end defun
A typical scenario for these functions is to register for the
D-Bus signal @samp{org.freedesktop.login1.Manager.PrepareForSleep}:
@lisp
(defvar my-inhibitor-lock
(dbus-make-inhibitor-lock "sleep" "Test"))
(defun my-dbus-PrepareForSleep-handler (start)
(if start ;; The system goes down for sleep
(progn
@dots{}
;; Release inhibitor lock.
(when (natnump my-inhibitor-lock)
(dbus-close-inhibitor-lock my-inhibitor-lock)
(setq my-inhibitor-lock nil)))
;; Reacquire inhibitor lock.
(setq my-inhibitor-lock
(dbus-make-inhibitor-lock "sleep" "Test"))))
(dbus-register-signal
:system "org.freedesktop.login1" "/org/freedesktop/login1"
"org.freedesktop.login1.Manager" "PrepareForSleep"
#'my-dbus-PrepareForSleep-handler)
@result{} ((:signal :system "org.freedesktop.login1.Manager" "PrepareForSleep")
("org.freedesktop.login1" "/org/freedesktop/login1"
my-dbus-PrepareForSleep-handler))
@end lisp
@node Index
@unnumbered Index

View file

@ -87,7 +87,9 @@ Eglot itself is completely language-agnostic, but it can support any
programming language for which there is a language server and an Emacs
major mode.
This manual documents how to configure, use, and customize Eglot.
This manual documents how to configure, use, and customize Eglot. To
read this manual from within Emacs, type @kbd{M-x eglot-manual
@key{RET}}.
@insertcopying
@ -97,6 +99,7 @@ This manual documents how to configure, use, and customize Eglot.
* Using Eglot:: Important Eglot commands and variables.
* Customizing Eglot:: Eglot customization and advanced features.
* Advanced server configuration:: Fine-tune a specific language server
* Multi-server support:: Use more than one server in a buffer
* Extending Eglot:: Writing Eglot extensions in Elisp
* Troubleshooting Eglot:: Troubleshooting and reporting bugs.
* GNU Free Documentation License:: The license for this manual.
@ -763,6 +766,22 @@ serve hints about positional parameter names in function calls and a
variable's automatically deduced type. Inlay hints help the user not
have to remember these things by heart.
@cindex momentary inlay hints
@item eglot-momentary-inlay-hints
When bound to a single key in @code{eglot-mode-map}
(@pxref{Customization Variables}), this will arrange for inlay hints to
be displayed as long as the key is held down, and then hidden shortly
after it is released. The best way to set it up is something like this:
@lisp
(define-key eglot-mode-map [f7] 'eglot-momentary-inlay-hints)
@end lisp
@noindent
Note that Emacs doesn't support binding to \"key up\" events, so this
command offers an approximation by estimating your system keyboard delay
and repeat rate.
@cindex semantic tokens
@item M-x eglot-semantic-tokens-mode
This command toggles LSP @dfn{semantic tokens} fontification on and off
@ -975,6 +994,7 @@ For example:
(define-key eglot-mode-map (kbd "C-c o") 'eglot-code-action-organize-imports)
(define-key eglot-mode-map (kbd "C-c h") 'eldoc)
(define-key eglot-mode-map (kbd "<f6>") 'xref-find-definitions)
(define-key eglot-mode-map (kbd "<f7>") 'eglot-momentary-inlay-hints)
@end lisp
@cindex progress
@ -1509,6 +1529,152 @@ is serialized by Eglot to the following JSON text:
@}
@end example
@node Multi-server support
@chapter Multi-server support
@cindex multiple servers per buffer
@cindex LSP server multiplexer
@cindex per-buffer multiple servers
One of the most frequently requested features for Eglot in close to a
decade of existence is the ability to use more than one LSP server in a
single buffer. This is distinct from using multiple servers in a
project, where each server manages a disjoint set of files written in
different languages.
The latter case---multiple servers for different files---is
intrinsically supported by Eglot. For example, in a web project with
JavaScript, CSS, and Python files, Eglot can seamlessly manage separate
language servers for each file type within the same project
(@pxref{Starting Eglot}). Each buffer communicates with its appropriate
server, and this works out-of-the-box.
However, there are several scenarios where multiple servers per buffer
are useful:
@itemize @bullet
@item
Combining a spell-checking language server like @command{codebook-lsp}
with language-specific servers for C++, Go, or Python files. The
spell-checker provides diagnostics for comments and strings, while the
language server handles syntax and semantics.
@item
One might want multiple servers to cover different aspects of the same
language. For Python, you might combine @command{ty} for type checking
with @command{ruff} for linting and formatting. For JavaScript, you
might use @command{typescript-language-server} for language features
together with @command{eslint} for linting.
@item
When working on multi-language files like Vue @file{.vue} files, which
contain JavaScript, CSS, and HTML embedded in a single file, multiple
servers can manage the different areas of the buffer.
@end itemize
These use cases are not directly supported by Eglot's architecture,
however, you can use a language-agnostic @dfn{LSP server multiplexer}
that sits between Eglot and the actual language servers. Eglot still
communicates with a single LSP server process in each buffer, but that
process mediates communication to multiple language-specific servers,
meaning that for practical purposes, it's @emph{as if} Eglot was
connected to them directly.
This approach is more powerful and user-friendly than current
workarounds that combine one LSP server in a buffer with additional
non-LSP mechanisms such as extra Flymake backends (@pxref{Top,,,
Flymake, GNU Flymake manual}) for the same buffer.
@menu
* Using Rassumfrassum:: Setup the @code{rass} LSP multiplexer
* Design rationale:: Benefits and drawbacks of LSP multiplexers
@end menu
@node Using Rassumfrassum
@section Using Rassumfrassum
@uref{https://github.com/joaotavora/rassumfrassum, Rassumfrassum} is an
LSP server multiplexer program that fits the bill. Like most language
servers, it must be installed separately since it is not bundled with
Emacs (at time of writing). The installation is similar to installing
any other language server, and usually amounts to making sure the
program executable is somewhere in @code{PATH} or @code{exec-path}.
The Rassumfrassum program, invoked via the @command{rass} command, works
by spawning multiple LSP server subprocesses and aggregating their
capabilities, requests, and responses into a single unified LSP
interface. From Eglot's perspective, it appears to be communicating with
a single server.
To use Rassumfrassum with Eglot, you can start it interactively with a
prefix argument to @code{eglot} and specify the @command{rass} command
followed by the actual servers you want to use, separated by @code{--}:
@example
C-u M-x eglot RET rass -- clangd -- codebook-lsp serve RET
@end example
@noindent
This starts @command{clangd} for C++ language support and
@command{codebook-lsp} for spell-checking in the same buffer.
For Python, you might use:
@example
C-u M-x eglot RET rass -- ty server -- ruff server RET
@end example
@noindent
or simply @kbd{C-u M-x eglot RET rass python}, using the ``preset''
feature. This combines @command{ty} for type checking with
@command{ruff} for linting and formatting.
These configurations can be integrated into the
@code{eglot-server-programs} variable (@pxref{Setting Up LSP Servers})
for automatic use:
@lisp
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'(c-ts-base-mode . ("rass" "--" "clangd" "--"
"codebook-lsp" "serve")))
(add-to-list 'eglot-server-programs
'(python-mode . ("rass" "--" "ty" "server" "--"
"ruff" "server"))))
@end lisp
@node Design rationale
@section Design rationale
Using an LSP server multiplexer like @command{rass} relieves Eglot from
knowing about the specific characteristics of individual servers and the
complexity of managing multiple simultaneous server connections per
buffer. This helps preserve the essential features that distinguish
Eglot's code base from other LSP offers for Emacs: simple, performant
and mindful of the core tenet of LSP, which is for a client to be
language-agnostic.
This approach has an additional benefit: because the multiplexer
mediates all communication between Eglot and the servers, it can take
advantage of different optimization opportunities. For instance, at the
system level it may be multi-threaded to process different JSONRPC
streams in with true parallelism, something which is currently
impossible to do in plain Elisp. At the LSP-level it can merge server
responses intelligently, truncate unnecessarily large objects, and cache
significant amounts of information in efficient ways. In many cases,
this can reduce the amount of JSONRPC traffic exchanged with Emacs to
levels well below what would occur if a client connected to multiple
servers separately. Some of these optimizations may apply even when a
program like @command{rass} is mediating communication to a single
server.
The multiplexer approach is not without drawbacks. Since LSP is a
relatively large protocol with a decade of existence and many backward
compatibility concerns, combining the responses of servers using completely
different mechanisms of the protocol to respond to the same request
sometimes leads to complexity in covering the corner cases. However,
offloading this complexity to a completely separate layer has proven
very effective in practice.
@node Extending Eglot
@chapter Extending Eglot
@ -1685,9 +1851,13 @@ slowly, try to customize the variable @code{eglot-events-buffer-config}
0. This will disable recording any events and may speed things up.
In other situations, the cause of poor performance lies in the language
server itself. Servers use aggressive caching and other techniques to
improve their performance. Often, this can be tweaked by changing the
server configuration (@pxref{Advanced server configuration}).
server itself. Some servers use aggressive caching and other techniques
to improve their performance. Often, this can be tweaked by changing
the server configuration (@pxref{Advanced server configuration}).
Another aspect that may cause performance degradation is the amount of
JSONRPC information exchanged with Emacs. Using an LSP program like
@ref{Using Rassumfrassum,Rassumfrassum} may alleviate such problems.
@node Getting the latest version
@section Getting the latest version
@ -1749,10 +1919,17 @@ may be using. If possible, try to replicate the problem with the
C/C@t{++} or Python servers, as these are very easy to install.
@item
Describe how to setup a @emph{minimal} project directory where Eglot
If using an LSP multiplexer server like @ref{Using Rassumfrassum,
Rassumfrassum}, first verify if the program replicates by using one of
the multiplexed servers directly. If it doesn't the problem lies in the
LSP multiplexer program and should be reported there.
@item
Include a description of a @emph{minimal} project directory where Eglot
should be started for the problem to happen. Describe each file's name
and its contents. Alternatively, you can supply the address of a public
Git repository.
and its contents, or---sometimes better--- zip that project directory
completely and attach it. Alternatively, you can supply the address of
a public Git repository.
@item
Include versions of the software used. The Emacs version can be
@ -1765,12 +1942,13 @@ first check if the problem isn't already fixed in the latest version
It's also essential to include the version of ELPA packages that are
explicitly or implicitly loaded. The optional but popular Company or
Markdown packages are distributed as GNU ELPA packages, not to mention
Eglot itself in some situations. Some major modes (Go, Rust, etc.) are
provided by ELPA packages. It's sometimes easy to miss these, since
they are usually implicitly loaded when visiting a file in that
language.
Eglot itself in some situations. Prefer reproducing the problem with
built-in Treesit major modes like @code{go-ts-mode} or
@code{rust-ts-mode} since the non-ts modes for such languages are
usually provided by ELPA packages, and it's often easy to miss them.
ELPA packages usually live in @code{~/.emacs.d/elpa} (or what is in
If you can't reproduce your bug without ELPA packages, you may find the
ones you're using in @code{~/.emacs.d/elpa} (or what is in
@code{package-user-dir}). Including a listing of files in that
directory is a way to tell the maintainers about ELPA package versions.

View file

@ -5,7 +5,7 @@
%
\def\texinfoversion{2025-12-23.13}
%
% Copyright 1985--1986, 1988, 1990--2026 Free Software Foundation, Inc.
% Copyright 1985, 1986, 1988, 1990-2025 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

View file

@ -1132,9 +1132,11 @@ an external transfer program.
External methods save on the overhead of encoding and decoding of
inline methods.
@vindex tramp-copy-size-limit
Since external methods have the overhead of opening a new channel,
files smaller than @code{tramp-copy-size-limit} still use inline
methods.
methods. If an external method is used inside a multi-hop connection
(@pxref{Multi-hops}), its inherent inline method is used as well.
@table @asis
@cindex method @option{rcp}
@ -3891,7 +3893,7 @@ proxy @samp{bird@@bastion} to a remote file on @samp{you@@remotehost}:
ssh@value{postfixhop}you@@remotehost@value{postfix}/path @key{RET}}
@end example
Each involved method must be an inline method (@pxref{Inline methods}).
Each involved method must be handled by @value{tramp}'s @code{tramp-sh} backend.
@value{tramp} adds the ad-hoc definitions as an ephemeral record to
@code{tramp-default-proxies-alist}, which are available for reuse

View file

@ -7,7 +7,7 @@
@c In the Tramp GIT, the version number and the bug report address
@c are auto-frobbed from configure.ac.
@set trampver 2.8.1
@set trampver 2.8.2-pre
@set trampurl https://www.gnu.org/software/tramp/
@set tramp-bug-report-address tramp-devel@@gnu.org
@set emacsver 28.1

View file

@ -25,13 +25,13 @@ General Public License for more details.
@dircategory Emacs misc features
@direntry
* Transient: (transient). Transient Commands.
* Transient: (transient). Transient Commands.
@end direntry
@finalout
@titlepage
@title Transient User and Developer Manual
@subtitle for version 0.11.0
@subtitle for version 0.12.0
@author Jonas Bernoulli
@page
@vskip 0pt plus 1filll
@ -53,7 +53,7 @@ resource to get over that hurdle is Psionic K's interactive tutorial,
available at @uref{https://github.com/positron-solutions/transient-showcase}.
@noindent
This manual is for Transient version 0.11.0.
This manual is for Transient version 0.12.0.
@insertcopying
@end ifnottex
@ -385,7 +385,7 @@ than outlined above and even customizable.}
If the user does not save the value and just exits using a regular
suffix command, then the value is merely saved to the transient's
history. That value won't be used when the transient is next invoked,
but it is easily accessible (see @ref{Using History}).
but it is easily accessible (@pxref{Using History}).
Option @code{transient-common-command-prefix} controls the prefix key used
in the following bindings. For simplicity's sake the default, @kbd{C-x},
@ -454,8 +454,8 @@ previously used values. Usually the same keys as those mentioned
above are bound to those commands.
Authors of transients should arrange for different infix commands that
read the same kind of value to also use the same history key (see
@ref{Suffix Slots}).
read the same kind of value to also use the same history key
(@pxref{Suffix Slots}).
Both kinds of history are saved to a file when Emacs is exited.
@ -785,7 +785,7 @@ menu buffer. The menu buffer is displayed in a window using
The value of this option has the form @code{(@var{FUNCTION} . @var{ALIST})},
where @var{FUNCTION} is a function or a list of functions. Each such
function should accept two arguments: a buffer to display and an
alist of the same form as @var{ALIST}. See @ref{Choosing Window,,,elisp,},
alist of the same form as @var{ALIST}. @xref{Choosing Window,,,elisp,},
for details.
The default is:
@ -798,8 +798,8 @@ The default is:
@end lisp
This displays the window at the bottom of the selected frame.
For alternatives see @ref{Buffer Display Action Functions,,,elisp,},
and @ref{Buffer Display Action Alists,,,elisp,}.
For alternatives @xref{Buffer Display Action Functions,,,elisp,},
and @xref{Buffer Display Action Alists,,,elisp,}.
When you switch to a different ACTION, you should keep the ALIST
entries for @code{dedicated} and @code{inhibit-same-window} in most cases.
@ -861,7 +861,7 @@ used to draw the line.
This user option may be overridden if @code{:mode-line-format} is passed
when creating a new prefix with @code{transient-define-prefix}.
Otherwise this can be any mode-line format. See @ref{Mode Line Format,,,elisp,}, for details.
Otherwise this can be any mode-line format. @xref{Mode Line Format,,,elisp,}, for details.
@end defopt
@defopt transient-semantic-coloring
@ -1002,8 +1002,8 @@ That buffer is current and empty when this hook is runs.
@cindex modifying existing transients
To an extent, transients can be customized interactively, see
@ref{Enabling and Disabling Suffixes}. This section explains how existing
To an extent, transients can be customized interactively,
@xref{Enabling and Disabling Suffixes}. This section explains how existing
transients can be further modified non-interactively. Let's begin
with an example:
@ -1029,10 +1029,10 @@ which can be included in multiple prefixes. See TODO@.
as expected by @code{transient-define-prefix}. Note that an infix is a
special kind of suffix. Depending on context ``suffixes'' means
``suffixes (including infixes)'' or ``non-infix suffixes''. Here it
means the former. See @ref{Suffix Specifications}.
means the former. @xref{Suffix Specifications}.
@var{SUFFIX} may also be a group in the same form as expected by
@code{transient-define-prefix}. See @ref{Group Specifications}.
@code{transient-define-prefix}. @xref{Group Specifications}.
@item
@var{LOC} is a key description (a string as returned by @code{key-description}
@ -1055,9 +1055,9 @@ the function @code{transient--get-layout}.
These functions operate on the information stored in the
@code{transient--layout} property of the @var{PREFIX} symbol. Elements in that
tree are not objects but have the form @code{(@var{CLASS} @var{PLIST}) for suffixes} and
tree are not objects but have the form @code{(@var{CLASS} @var{PLIST})} for suffixes and
@code{[CLASS PLIST CHILDREN]} for groups. At the root of the tree is an
element @code{[N Nil CHILDREN]}, where @code{N} is the version of the layout format,
element @code{[N nil CHILDREN]}, where @code{N} is the version of the layout format,
currently and hopefully for a long time 2. While that element looks
like a group vector, that element does not count when identifying a
group using a coordinate vector, i.e., @code{[0]} is its first child, not the
@ -1072,7 +1072,7 @@ or after @var{LOC}.
Conceptually adding a binding to a transient prefix is similar to
adding a binding to a keymap, but this is complicated by the fact
that multiple suffix commands can be bound to the same key, provided
they are never active at the same time, see @ref{Predicate Slots}.
they are never active at the same time, @xref{Predicate Slots}.
Unfortunately both false-positives and false-negatives are possible.
To deal with the former, use non-@code{nil} @var{KEEP-OTHER@.} The symbol @code{always}
@ -1205,14 +1205,14 @@ enabled. One benefit of the Transient interface is that it remembers
history not only on a global level (``this command was invoked using
these arguments, and previously it was invoked using those other
arguments''), but also remembers the values of individual arguments
independently. See @ref{Using History}.
independently. @xref{Using History}.
After a transient prefix command is invoked, @kbd{C-h @var{KEY}} can be used to
show the documentation for the infix or suffix command that @kbd{@var{KEY}} is
bound to (see @ref{Getting Help for Suffix Commands}), and infixes and
bound to (@pxref{Getting Help for Suffix Commands}), and infixes and
suffixes can be removed from the transient using @kbd{C-x l @var{KEY}}. Infixes
and suffixes that are disabled by default can be enabled the same way.
See @ref{Enabling and Disabling Suffixes}.
@xref{Enabling and Disabling Suffixes}.
Transient ships with support for a few different types of specialized
infix commands. A command that sets a command line option, for example,
@ -1263,7 +1263,7 @@ explicitly.
@var{GROUP}s add key bindings for infix and suffix commands and specify
how these bindings are presented in the menu buffer. At least one
@var{GROUP} has to be specified. See @ref{Binding Suffix and Infix Commands}.
@var{GROUP} has to be specified. @xref{Binding Suffix and Infix Commands}.
The @var{BODY} is optional. If it is omitted, then @var{ARGLIST} is ignored and
the function definition becomes:
@ -1314,11 +1314,13 @@ GROUPs have the same form as for @code{transient-define-prefix}.
@section Binding Suffix and Infix Commands
The macro @code{transient-define-prefix} is used to define a transient.
This defines the actual transient prefix command (see @ref{Defining Transients}) and adds the transient's infix and suffix bindings, as
This defines the actual transient prefix command (@pxref{Defining
Transients}) and adds the transient's infix and suffix bindings, as
described below.
Users and third-party packages can add additional bindings using
functions such as @code{transient-insert-suffix} (see @ref{Modifying Existing Transients}). These functions take a ``suffix specification'' as one of
functions such as @code{transient-insert-suffix} (@pxref{Modifying Existing Transients}).
These functions take a ``suffix specification'' as one of
their arguments, which has the same form as the specifications used in
@code{transient-define-prefix}.
@ -1334,7 +1336,7 @@ for a set of suffixes.
Several group classes exist, some of which organize suffixes in
subgroups. In most cases the class does not have to be specified
explicitly, but see @ref{Group Classes}.
explicitly, but @xref{Group Classes}.
Groups are specified in the call to @code{transient-define-prefix}, using
vectors. Because groups are represented using vectors, we cannot use
@ -1344,10 +1346,13 @@ brackets to do the latter.
Group specifications then have this form:
@lisp
[@{LEVEL@} @{DESCRIPTION@} @{KEYWORD VALUE@}... ELEMENT...]
[@{@var{LEVEL}@} @{@var{DESCRIPTION}@}
@{@var{KEYWORD} @var{VALUE}@}...
@var{ELEMENT}...]
@end lisp
The @var{LEVEL} is optional and defaults to 4. See @ref{Enabling and Disabling Suffixes}.
The @var{LEVEL} is optional and defaults to 4. @xref{Enabling and
Disabling Suffixes}.
The @var{DESCRIPTION} is optional. If present, it is used as the heading of
the group.
@ -1378,7 +1383,7 @@ useful while rebase is already in progress; and another that uses
initiate a rebase.
These predicates can also be used on individual suffixes and are
only documented once, see @ref{Predicate Slots}.
only documented once, @xref{Predicate Slots}.
@item
The value of @code{:hide}, if non-@code{nil}, is a predicate that controls
@ -1483,13 +1488,13 @@ The form of suffix specifications is documented in the next node.
@cindex suffix specifications
A transient's suffix and infix commands are bound when the transient
prefix command is defined using @code{transient-define-prefix}, see
@ref{Defining Transients}. The commands are organized into groups, see
@ref{Group Specifications}. Here we describe the form used to bind an
prefix command is defined using @code{transient-define-prefix},
@xref{Defining Transients}. The commands are organized into groups,
@xref{Group Specifications}. Here we describe the form used to bind an
individual suffix command.
The same form is also used when later binding additional commands
using functions such as @code{transient-insert-suffix}, see @ref{Modifying Existing Transients}.
using functions such as @code{transient-insert-suffix}, @xref{Modifying Existing Transients}.
Note that an infix is a special kind of suffix. Depending on context
``suffixes'' means ``suffixes (including infixes)'' or ``non-infix
@ -1498,7 +1503,9 @@ suffixes''. Here it means the former.
Suffix specifications have this form:
@lisp
([LEVEL] [KEY [DESCRIPTION]] COMMAND|ARGUMENT [KEYWORD VALUE]...)
([@var{LEVEL}]
[@var{KEY} [@var{DESCRIPTION}]]
@var{COMMAND}|@var{ARGUMENT} [@var{KEYWORD} @var{VALUE}]...)
@end lisp
@var{LEVEL}, @var{KEY} and @var{DESCRIPTION} can also be specified using the @var{KEYWORD}s
@ -1509,8 +1516,8 @@ the object's values just for the binding inside this transient.
@itemize
@item
@var{LEVEL} is the suffix level, an integer between 1 and 7. See
@ref{Enabling and Disabling Suffixes}.
@var{LEVEL} is the suffix level, an integer between 1 and 7.
@xref{Enabling and Disabling Suffixes}.
@item
KEY is the key binding, a string in the format returned by
@ -1584,7 +1591,7 @@ guessed based on the long argument. If the argument ends with @samp{=}
Finally, details can be specified using optional @var{KEYWORD}-@var{VALUE} pairs.
Each keyword has to be a keyword symbol, either @code{:class} or a keyword
argument supported by the constructor of that class. See @ref{Suffix Slots}.
argument supported by the constructor of that class. @xref{Suffix Slots}.
If a keyword argument accepts a function as value, you an use a @code{lambda}
expression. As a special case, the @code{##} macro (which returns a @code{lambda}
@ -1702,7 +1709,7 @@ should be used.
@end defun
@defun transient-get-value
This function returns the value of the current prefix.
This function returns the value of the extant prefix.
This function is intended to be used when setting up a menu and its
suffixes. It is not intended to be used when a suffix command is
@ -1934,8 +1941,8 @@ means that all outer prefixes are exited at once.
@item
The behavior for non-suffixes can be set for a particular prefix,
by the prefix's @code{transient-non-suffix} slot to a boolean, a suitable
pre-command function, or a shorthand for such a function. See
@ref{Pre-commands for Non-Suffixes}.
pre-command function, or a shorthand for such a function.
@xref{Pre-commands for Non-Suffixes}.
@item
The common behavior for the suffixes of a particular prefix can be
@ -2260,7 +2267,7 @@ Transient itself provides a single class for prefix commands,
@code{transient-prefix}, but package authors may wish to define specialized
classes. Doing so makes it possible to change the behavior of the set
of prefix commands that use that class, by implementing specialized
methods for certain generic functions (see @ref{Prefix Methods}).
methods for certain generic functions (@pxref{Prefix Methods}).
A transient prefix command's object is stored in the @code{transient--prefix}
property of the command symbol. While a transient is active, a clone
@ -2275,7 +2282,7 @@ object should not affect later invocations.
@item
All suffix and infix classes derive from @code{transient-suffix}, which in
turn derives from @code{transient-child}, from which @code{transient-group} also
derives (see @ref{Group Classes}).
derives (@pxref{Group Classes}).
@item
All infix classes derive from the abstract @code{transient-infix} class,
@ -2283,13 +2290,13 @@ which in turn derives from the @code{transient-suffix} class.
Infixes are a special type of suffixes. The primary difference is
that infixes always use the @code{transient--do-stay} pre-command, while
non-infix suffixes use a variety of pre-commands (see @ref{Transient State}). Doing that is most easily achieved by using this class,
non-infix suffixes use a variety of pre-commands (@pxref{Transient State}). Doing that is most easily achieved by using this class,
though theoretically it would be possible to define an infix class
that does not do so. If you do that then you get to implement many
methods.
Also, infixes and non-infix suffixes are usually defined using
different macros (see @ref{Defining Suffix and Infix Commands}).
different macros (@pxref{Defining Suffix and Infix Commands}).
@item
Classes used for infix commands that represent arguments should
@ -2699,7 +2706,7 @@ secondary value, called a ``scope''. See @code{transient-define-prefix}.
@code{transient-suffix}, @code{transient-non-suffix} and @code{transient-switch-frame}
play a part when determining whether the currently active transient
prefix command remains active/transient when a suffix or arbitrary
non-suffix command is invoked. See @ref{Transient State}.
non-suffix command is invoked. @xref{Transient State}.
@item
@code{refresh-suffixes} Normally suffix objects and keymaps are only setup
@ -2781,7 +2788,7 @@ of the same symbol.
@item
@code{level} The level of the prefix commands. The suffix commands whose
layer is equal or lower are displayed. See @ref{Enabling and Disabling Suffixes}.
layer is equal or lower are displayed. @pxref{Enabling and Disabling Suffixes}.
@item
@code{value} The likely outdated value of the prefix. Instead of accessing
@ -2805,15 +2812,15 @@ Here we document most of the slots that are only available for suffix
objects. Some slots are shared by suffix and group objects, they are
documented in @ref{Predicate Slots}.
Also see @ref{Suffix Classes}.
Also @xref{Suffix Classes}.
@anchor{Slots of @code{transient-child}}
@subheading Slots of @code{transient-child}
This is the abstract superclass of @code{transient-suffix} and @code{transient-group}.
This is where the shared @code{if*} and @code{inapt-if*} slots (see @ref{Predicate Slots}),
the @code{level} slot (see @ref{Enabling and Disabling Suffixes}), and the @code{advice}
and @code{advice*} slots (see @ref{Slots of @code{transient-suffix}}) are defined.
This is where the shared @code{if*} and @code{inapt-if*} slots (@pxref{Predicate Slots}),
the @code{level} slot (@pxref{Enabling and Disabling Suffixes}), and the @code{advice}
and @code{advice*} slots (@pxref{Slots of @code{transient-suffix}}) are defined.
@itemize
@item
@ -2839,7 +2846,7 @@ which is useful for alignment purposes.
@code{command} The command, a symbol.
@item
@code{transient} Whether to stay transient. See @ref{Transient State}.
@code{transient} Whether to stay transient. @xref{Transient State}.
@item
@code{format} The format used to display the suffix in the menu buffer.
@ -3063,14 +3070,14 @@ currently cannot be invoked.
By default these predicates run when the prefix command is invoked,
but this can be changes, using the @code{refresh-suffixes} prefix slot.
See @ref{Prefix Slots}.
@xref{Prefix Slots}.
One more slot is shared between group and suffix classes, @code{level}. Like
the slots documented above, it is a predicate, but it is used for a
different purpose. The value has to be an integer between 1
and 7. @code{level} controls whether a suffix or a group should be
available depending on user preference.
See @ref{Enabling and Disabling Suffixes}.
@xref{Enabling and Disabling Suffixes}.
@node FAQ
@appendix FAQ

View file

@ -20,6 +20,71 @@ https://github.com/joaotavora/eglot/issues/1234.
* Changes to upcoming Eglot
** File watch limits to prevent resource exhaustion (github#1568)
The new variable 'eglot-max-file-watches' limits the number of file
watches that can be created. Some language servers request watching
for a very large number of directories (e.g. Python virtualenvs), which
can exhaust system resources and cause slow startup.
** Support for complex workspace edits (create/rename/delete files)
Eglot now advertises support for file resource operations in workspace
edits and can handle create, rename, and delete file operations. The
confirmation UI has been reworked to handle mixed operation types.
The 'eglot-confirm-server-edits' defcustom has been overhauled and now
also accepts file operation kinds as keys in the alist form, providing
more fine-grained control over what confirmation mechanism to use.
** 'eglot-advertise-cancellation' now defaults to t
The variable 'eglot-advertise-cancellation' now defaults to t, which
means Eglot will send '$/cancelRequest' notifications to servers when it
thinks responses to inflight requests are no longer useful. The current
2026 LSP landscape (especially gopls and ocamllsp) suggests this is
beneficial and helps servers avoid costly useless work.
** Imenu setup is more predictable (github#1569)
Eglot now sets 'imenu-create-index-function' using ':override' advice,
making the integration cleaner and more predictable.
** Fixed textDocument/prepareRename support (github#1554)
Eglot now properly checks server capabilities before sending
prepareRename requests.
* Changes in Eglot 1.21 (11/1/2026)
This is a bugfix release with small fixes for semantic tokens and Emacs
26.3 compatibility.
* Changes in Eglot 1.20 (11/1/2026)
** Dramatically faster handling of files with many diagnostics
Diagnostic conversion between LSP and Flymake versions is now much
faster. Previously, editing, e.g. a Python file with thousands of
diagnostics was next to impossible to to periodic interruptions of
diagnostic reports. Now it's practically unnoticeable.
** Support for LSP server multiplexers via Rassumfrassum
Eglot can now leverage LSP server multiplexer programs like Rassumfrassum
(invoked via the 'rass' command) to use multiple language servers in a
single buffer. This enables combining spell-checkers with language
servers, using multiple servers for the same language (e.g., 'ty' for
type checking and 'ruff' for linting in Python), or handling
multi-language files like Vue.
Some invocations of 'rass' are offered as alternatives in the built-in
'eglot-server-programs' variable. The manual (readable with 'M-x
eglot-manual') contains a comprehensive discussion of how to set up and
use multiplexers in the new "Multi-server support" chapter.
** Support for pull diagnostics (github#1559, github#1290)
For servers supporting the 'diagnosticProvider' capability, Eglot
@ -28,6 +93,15 @@ requests diagnostics explicitly rather than relying on sporadic
server is known to support the "pull" variant exclusively, while the
'ty' server is known to support it alongside "push".
** New command 'eglot-momentary-inlay-hints'
When bound to a single key in 'eglot-mode-map' this will arrange for
inlay hints to be displayed as long as the key is held down, and then
hidden shortly after it is released. Emacs doesn't support binding to
\"key up\" events, but this function offers an approximation. It relies
on measuring your keyboard initial delay and repeat rate, and may not be
100% accurate.
** Support for watching files outside the project (bug#79809)
Eglot now supports and advertises the 'relativePatternSupport'
@ -45,6 +119,11 @@ controlling which token types and modifiers to consider, as well as
faces for customizing their appearance. The minor mode is on by
default: consult the manual on how to turn it off.
** Reading the Eglot manual in Emacs is easy again
The command 'M-x eglot-manual' is now easier to reach and directly drops
the user into the manual.
* Changes in Eglot 1.19 (23/10/2025)

251
etc/NEWS
View file

@ -82,6 +82,13 @@ other directory on your system. You can also invoke the
* Changes in Emacs 31.1
+++
** 'line-spacing' now supports specifying spacing above the line.
Previously, only spacing below the line could be specified. The variable
can now be set to a cons cell to specify spacing both above and below
the line, which allows for vertically centering text.
+++
** 'prettify-symbols-mode' attempts to ignore undisplayable characters.
Previously, such characters would be rendered as, e.g., white boxes.
@ -199,6 +206,13 @@ different completion categories by customizing
be updated as you type, or nil to suppress this always. Note that for
large or inefficient completion tables this can slow down typing.
+++
*** New optional value of 'minibuffer-visible-completions'.
If the value of this option is 'up-down', only the '<up>' and '<down>'
arrow keys move point between candidates shown in the "*Completions*"
buffer display, while '<right>' and '<left>' arrows move point in the
minibuffer window.
---
*** 'RET' chooses the completion selected with 'M-<up>/M-<down>'.
If a completion candidate is selected with 'M-<up>' or 'M-<down>',
@ -402,11 +416,20 @@ for which you can use '(category . tex-shell)'.
+++
*** New user option 'split-window-preferred-direction'.
Users can now choose in which direction Emacs tries to split first:
vertically or horizontally. The new default is to prefer to split
horizontally if the frame is landscape and vertically if it is portrait.
You can customize this option to 'vertical' to restore Emacs's old
behavior of always preferring vertical splits.
Functions called by 'display-buffer' split the selected window when they
need to create a new window. A window can be split either vertically,
one below the other, or horizontally, side by side. This new option
determines which direction will be tried first, when both directions are
possible according to the values of 'split-width-threshold' and
'split-height-threshold'. The default value is 'longest', which means
to prefer to split horizontally if the window's frame is a "landscape"
frame, and vertically if it is a "portrait" frame. (A frame is
considered to be "portrait" if its vertical dimension in pixels is
greater or equal to its horizontal dimension, otherwise it's considered
to be "landscape".) Previous versions of Emacs always tried to split
vertically first, so to get previous behavior, you can customize this
option to 'vertical'. The value 'horizontal' always prefers the
horizontal split.
+++
*** New argument INDIRECT for 'get-buffer-window-list'.
@ -440,6 +463,12 @@ adjacent windows and subsequently operate on that parent.
'uncombine-window' can then be used to restore the window configuration
to the state it had before running 'combine-windows'.
+++
*** New function 'window-cursor-info'.
This function returns a vector of pixel-level information about the
physical cursor in a given window, including its type, coordinates,
dimensions, and ascent.
** Frames
+++
@ -465,7 +494,7 @@ either resize the frame and change the fullscreen status accordingly or
keep the frame size unchanged. The value t means to first reset the
fullscreen status and then resize the frame.
*** New commands to set frame size and position in one compound step.
*** New functions to set frame size and position in one compound step.
'set-frame-size-and-position' sets the new size and position of a frame
in one compound step. Both, size and position, can be specified as with
the corresponding frame parameters 'width', 'height', 'left' and 'top'.
@ -482,6 +511,30 @@ frames into one of these frames and deletes the other one.
Unlike with other frame names, an attempt to rename to "F<number>" throws
an error when a frame of that name already exists.
+++
*** New frame parameters 'cloned-from' and 'undeleted'.
The frame parameter 'cloned-from' is set to the frame from which the new
frame is cloned using the command 'clone-frame'.
The frame parameter 'undeleted' is set to t when a frame is undeleted
using the command 'undelete-frame'.
These are useful if you need to detect a cloned frame or undeleted frame
in hooks like 'after-make-frame-functions' and
'server-after-make-frame-hook'.
*** Frames now have unique ids and the new function 'frame-id'.
Each non-tooltip frame is assigned a unique integer id. This allows you
to unambiguously identify frames even if they share the same name or
title. When 'undelete-frame-mode' is enabled, each deleted frame's id
is stored for resurrection. The function 'frame-id' returns a frame's
id (in C, use the frame struct member 'id').
*** New commands 'select-frame-by-id', 'undelete-frame-by-id'.
The command 'select-frame-by-id' selects a frame by ID and undeletes it
if deleted. The command 'undelete-frame-by-id' undeletes a frame by its
ID. When called interactively, both functions prompt for an ID.
** Mode Line
+++
@ -506,9 +559,10 @@ every buffer.
** Tab Bars and Tab Lines
---
*** New command 'merge-tabs'.
'merge-tabs' merges all windows from two tabs into one of these tabs
and closes the other tab.
*** New commands 'split-tab' and 'merge-tabs'.
'split-tab' moves a specified number of windows from an existing tab
to a newly-created tab. 'merge-tabs' merges all windows from two tabs
into one of these tabs and closes the other tab.
---
*** New abnormal hook 'tab-bar-auto-width-functions'.
@ -666,6 +720,17 @@ project, during completion. That makes some items shorter.
The category defaults are the same as for 'buffer' but any user
customizations would need to be re-added.
+++
*** 'project-mode-line' can now show project name only for local files.
If the value of 'project-mode-line' is 'non-remote', project name and
the Project menu will be shown on the mode line only for projects with
local files.
** Help
+++
*** New keybinding 'C-h u' for 'apropos-user-option'.
** IDLWAVE has been moved to GNU ELPA.
The version bundled with Emacs is out-of-date, and is now marked as
obsolete. Use 'M-x list-packages' to install the 'idlwave' package from
@ -749,6 +814,15 @@ Emacs previously discarded arguments to emacsclient of zero length, such
as in 'emacsclient --eval "(length (pop server-eval-args-left))" ""'.
These are no longer discarded.
+++
** New user option 'xterm-update-cursor' to update cursor display on TTYs.
When enabled, Emacs sends Xterm escape sequences on Xterm-compatible
terminals to update the cursor's appearacse. Emacs can update the
cursor's shape and color. For example, if you use a purple bar cursor
on graphical displays then when this option is enabled Emacs will use a
purple bar cursor on compatible terminals as well. See the Info node
"(emacs) Cursor Display" for more information.
* Editing Changes in Emacs 31.1
@ -896,6 +970,11 @@ These commands did not previously accept a prefix argument.
Now a numeric prefix argument specifies a repeat count, just like it
already did for 'undo'.
** New minor mode 'center-line-mode'.
This mode keeps modified lines centered horizontally according to the
value of 'fill-column', by calling 'center-line' on each non-empty line
of the modified region.
* Changes in Specialized Modes and Packages in Emacs 31.1
@ -1039,11 +1118,11 @@ The new variable 'forward-comment-function' is set to the new function
'treesit-forward-comment' if a major mode defines the thing 'comment'.
+++
*** New function 'treesit-query-eagerly-compiled-p'
*** New function 'treesit-query-eagerly-compiled-p'.
This function returns non-nil if a query was eagerly compiled.
+++
*** New function 'treesit-query-source'
*** New function 'treesit-query-source'.
This function returns the string or sexp source query of a compiled query.
+++
@ -1135,8 +1214,9 @@ convention. Also, the ':match?' predicate can now take the regexp as
either the first or second argument, so it works with both tree-sitter
convention (regexp arg second) and Emacs convention (regexp arg first).
** Track changes
+++
** Track-changes
*** New variable 'track-changes-undo-only' to distinguish undo changes.
** Hideshow
@ -1152,7 +1232,7 @@ blocks.
This command hides or shows all the blocks in the current buffer.
---
*** 'hs-hide-level' no longer hide all the blocks in the current buffer.
*** 'hs-hide-level' no longer hides all the blocks in the current buffer.
If 'hs-hide-level' was not inside a code block it would hide all the
blocks in the buffer like 'hs-hide-all'. Now it should only hide all
the second level blocks.
@ -1208,10 +1288,9 @@ buffer-local variables 'hs-block-start-regexp', 'hs-c-start-regexp',
'hs-forward-sexp-function', etc.
+++
*** 'hs-hide-level' and 'hs-cycle' can now hide comments too.
*** 'hs-hide-level' can now hide comments too.
This is controlled by 'hs-hide-comments-when-hiding-all'.
** C-ts mode
+++
@ -1270,6 +1349,12 @@ available.
Now method chaining is indented by 8 spaces rather than 4, and this
option controls how much is indented for method chaining.
** JSON-ts mode
*** New command 'json-ts-jq-path-at-point'.
This command copies the path of the JSON element at point to the
kill-ring, formatted for use with the 'jq' utility.
** PHP-ts mode
---
@ -1321,6 +1406,13 @@ associated to a remote PHP file, show the remote PHP ini files.
Rust number literals may have an optional type suffix. When this option
is non-nil, this suffix is fontified using 'font-lock-type-face'.
** YAML-ts mode
---
*** New user option 'yaml-ts-mode-yamllint-options'.
Additional options for 'yamllint' the command used for Flymake's YAML
support.
** EIEIO
---
@ -1626,7 +1718,6 @@ is the default.
This user option is in sympathy with recentf, and savehist autosave
timers.
** Savehist
---
@ -1996,7 +2087,7 @@ for docstrings where symbols 'nil' and 't' are in quotes.
In most cases, having it enabled leads to a large amount of false
positives.
*** New file-local variable 'lisp-indent-local-overrides'
*** New file-local variable 'lisp-indent-local-overrides'.
This variable can be used to locally override the indent specification
of symbols.
@ -2008,6 +2099,14 @@ When you kill the IELM process with 'C-c C-c', the input history is now
saved to the file specified by 'ielm-history-file-name', just like when
you exit the Emacs session or kill the IELM buffer.
---
*** New value 'point' for user option 'ielm-dynamic-return'.
When 'ielm-dynamic-return' is set to 'point', typing 'RET' has dynamic
behavior based on whether point is inside an sexp. While point is
inside an sexp typing 'RET' inserts a newline, and otherwise Emacs
proceeds with evaluating the expression. This is useful when
'electric-pair-mode', or a similar automatic pairing mode, is enabled.
** DocView
---
@ -2038,6 +2137,14 @@ option 'doc-view-djvused-program'.
The default value is now 30 seconds, as the old value was too short to
allow reading the help text.
+++
*** Ispell can now save spelling corrections as abbrevs.
In the Ispell command loop, type 'C-u' immediately before selecting a
replacement to toggle whether that correction will be saved as a global
abbrev expansion for its misspelling. The new user option
'ispell-save-corrections-as-abbrevs' determines whether abbrev saving
is enabled by default.
** Flyspell
---
@ -2065,6 +2172,10 @@ connections after you close remote-file buffers without having to either
cherry-pick via 'tramp-cleanup-connection' or clear them all via
'tramp-cleanup-all-connections'.
+++
*** External methods can now be used in multi-hop connections.
This is implemented for 'tramp-sh' methods, like "/scp:user@host|sudo::".
+++
*** New command 'tramp-dired-find-file-with-sudo'.
This command, bound to '@' in Dired, visits the file or directory on the
@ -2445,7 +2556,7 @@ appearance of the list can be customized with the new faces
+++
*** Printing root branch logs has moved to 'C-x v b L'.
Previously the command to print the root log for a branch was bound to
Previously, the command to print the root log for a branch was bound to
'C-x v b l'. It has now been renamed from 'vc-print-branch-log' to
'vc-print-root-branch-log', and bound to 'C-x v b L'. This is more
consistent with the rest of the 'C-x v' keymap, and makes room for a new
@ -2508,8 +2619,15 @@ cloning, or prompts for that, too.
When the argument is non-nil, the function switches to a buffer visiting
the directory into which the repository was cloned.
+++
*** 'vc-revert' is now bound to '@' in VC-Dir.
+++
*** 'vc-revert' is now additionally bound to 'C-x v @'.
This is in addition to 'C-x v u'.
---
*** 'C-x v u' ('vc-revert') now works on directories listed in VC Directory.
*** 'vc-revert' now works on directories listed in VC Directory.
Reverting a directory means reverting changes to all files inside it.
+++
@ -2625,8 +2743,8 @@ relevant buffers before generating the contents of a VC Directory buffer
*** New commands to report incoming and outgoing diffs.
'vc-root-diff-incoming' and 'vc-root-diff-outgoing' report diffs of all
the changes that would be pulled and would be pushed, respectively.
They are the diff analogues of the existing commands 'vc-log-incoming'
and 'vc-log-outgoing'.
They are the diff analogues of the existing commands
'vc-root-log-incoming' and 'vc-root-log-outgoing'.
In particular, 'vc-root-diff-outgoing' is useful as a way to preview
your push and ensure that all and only the changes you intended to
@ -2636,12 +2754,15 @@ include were committed and will be pushed.
current VC fileset.
+++
*** New commands to report diffs of outstanding changes.
'C-x v o =' ('vc-diff-outgoing-base') and 'C-x v o D'
*** New commands to report information about outstanding changes.
'C-x v T =' ('vc-diff-outgoing-base') and 'C-x v T D'
('vc-root-diff-outgoing-base') report diffs of changes since the merge
base with the remote branch, including uncommitted changes.
They are useful to view all outstanding (unmerged, unpushed) changes on
the current branch.
'C-x v T l' ('vc-log-outgoing-base') and 'C-x v T L'
('vc-root-log-outgoing-base') show the corresponding revision logs.
These are useful to view all outstanding (unmerged, unpushed) changes on
the current branch. They are also available as 'T =', 'T D', 'T l' and
'T L' in VC-Dir buffers.
+++
*** New user option 'vc-use-incoming-outgoing-prefixes'.
@ -2649,16 +2770,16 @@ If this is customized to non-nil, 'C-x v I' and 'C-x v O' become prefix
commands, such that the new incoming and outgoing commands have global
bindings:
- 'C-x v I L' is bound to 'vc-log-incoming'
- 'C-x v I L' is bound to 'vc-root-log-incoming'
- 'C-x v I D' is bound to 'vc-root-diff-incoming'
- 'C-x v O L' is bound to 'vc-log-outgoing'
- 'C-x v O L' is bound to 'vc-root-log-outgoing'
- 'C-x v O D' is bound to 'vc-root-diff-outgoing'.
+++
*** New display of outgoing revisions count in VC Directory.
If there are outgoing revisions, VC Directory now includes a count of
how many in its headers, to remind you to push them.
You can disable this by customizing vc-dir-show-outgoing-count to nil.
You can disable this by customizing 'vc-dir-show-outgoing-count' to nil.
+++
*** New user option 'vc-async-checkin' to enable async checkin operations.
@ -2748,6 +2869,13 @@ already have, consider replacing the default global bindings, like this:
---
*** New command alias 'vc-restore' for 'vc-revert'.
---
*** The 'diff-restrict-view' command is disabled by default.
This command is Diff mode's specialized 'narrow-to-region'.
'narrow-to-region' has long been disabled by default, so for
consistency, 'diff-restrict-view' is now too.
To enable it again, use 'M-x enable-command'.
** Package
+++
@ -2783,6 +2911,11 @@ When called from Lisp, it now only accepts a symbol.
When invoking the command in a Dired buffer with marked files,
the command will only copy those files.
---
*** 'package-isolate' can now also install packages.
If a package is missing, 'package-isolate' will fetch the missing
tarballs and prepare them to be activated in the sub-process.
+++
*** package-x.el is now obsolete.
@ -2806,6 +2939,14 @@ packages.
---
*** Uninstalling a package now removes its directory from 'load-path'.
+++
*** Packages can be reviewed before installation or upgrade.
The user option 'package-review-policy' can configure which packages
the user should be allowed to review before any processing takes place.
The package review can include reading the downloaded source code,
presenting a diff between the downloaded code and a previous
installation or displaying a ChangeLog.
** Rcirc
+++
@ -2916,6 +3057,10 @@ Meant to be given a global binding convenient to the user. Example:
** Icomplete
*** New key 'M-j' for 'icomplete-mode' and 'icomplete-vertical-mode'.
Like 'M-j' in 'fido-mode', it can exit the minibuffer with a selected
candidate even when 'icomplete-show-matches-on-no-input' is non-nil.
*** New user options for 'icomplete-vertical-mode'.
New user options have been added to enhance 'icomplete-vertical-mode':
@ -3294,7 +3439,7 @@ the source, or to 'antlr-v3' otherwise.
*** New command 'antlr-v4-mode' is a derived mode of 'antlr-mode'.
It sets 'antlr-tool-version' to value 'antlr-v4', and is automatically
used for files with extension "g4".
used for files with extension ".g4".
*** The variable 'antlr-language' is now used more generally.
The variable has a symbol as value which determines which of the
@ -3307,8 +3452,8 @@ ObjC, Python and Ruby, additional to Java and Cpp.
*** New user option 'antlr-run-tool-on-buffer-file'.
Command 'antlr-run-tool' now usually runs on the file for the current
buffer. Customize this user option to have value ' nil' to get the
previous behavior back.
buffer. Customize this user option to nil to get the previous behavior
back.
** Hi Lock
@ -3318,6 +3463,10 @@ If an active region exists, the commands 'hi-lock-line-face-buffer' and
'hi-lock-face-phrase-buffer' now use its contents as their default
value. Previously, only 'hi-lock-face-buffer' supported this.
** Shadowfile
*** 'shadow-info-buffer' and 'shadow-todo-buffer' use ephemeral buffer names now.
* New Modes and Packages in Emacs 31.1
@ -3479,8 +3628,8 @@ separator, are also supported.
---
** The experimental variable 'binary-as-unsigned' has been removed.
Instead of (let ((binary-as-unsigned t)) (format "%x" N)) you can use
(format "%x" (logand N MASK)) where MASK is for the desired word size,
Instead of '(let ((binary-as-unsigned t)) (format "%x" N))' you can use
'(format "%x" (logand N MASK))' where MASK is for the desired word size,
e.g., #x3fffffffffffffff for typical Emacs fixnums.
+++
@ -3530,6 +3679,11 @@ and other similar functions.
* Lisp Changes in Emacs 31.1
+++
** New function 'garbage-collect-heapsize'.
Same as 'garbage-collect' but just returns the info from the last GC
without performing a collection.
+++
** Improve 'replace-region-contents' to accept more forms of sources.
It has been promoted from 'subr-x' to the C code.
@ -3661,12 +3815,21 @@ without marking it as automatically buffer-local.
** The obsolete face attribute ':reverse-video' has been removed.
Use ':inverse-video' instead.
** D-Bus
+++
** Support interactive D-Bus authorization.
*** Support interactive D-Bus authorization.
A new ':authorizable t' parameter has been added to 'dbus-call-method'
and 'dbus-call-method-asynchronously' to allow the user to interactively
authorize the invoked D-Bus method (for example via polkit).
+++
*** New D-Bus functions to support systemd inhibitor locks.
The functions 'dbus-make-inhibitor-lock', 'dbus-close-inhibitor-lock'
and 'dbus-registered-inhibitor-locks' implement acquiring and releasing
systemd inhibitor locks. See the Info node "(dbus) Inhibitor Locks" for
details.
** The customization group 'wp' has been removed.
It has been obsolete since Emacs 26.1. Use the group 'text' instead.
@ -3770,6 +3933,13 @@ Binding 'inhibit-message' to a non-nil value will now suppress both
the display of messages and the clearing of the echo area, such as
caused by calling 'message' with a nil argument.
---
** 'minibuffer-message' no longer blocks while displaying message.
'minibuffer-message' now uses a timer to clear the message printed to
the minibuffer, instead of waiting with 'sit-for' and then clearing it.
This makes 'minibuffer-message' usable in Lisp programs which want to
print a message and then continue to perform work.
** Special Events
+++
@ -3837,14 +4007,23 @@ When the theme is set on PGTK, Android, or MS-Windows systems,
variable 'toolkit-theme' as either symbol 'dark' or 'light', but may be
extended to encompass other toolkit-specific symbols in the future.
** Progress reporter
+++
** Progress reporter callbacks.
*** Progress reporter callbacks.
'make-progress-reporter' now accepts optional arguments UPDATE-CALLBACK,
called on progress steps, and DONE-CALLBACK, called when the progress
reporter is done. See the 'make-progress-reporter' docstring for a full
specification of these new optional arguments.
** Add binary format specifications '%b' and '%B'.
+++
*** Progress reporter context.
'make-progress-reporter' now accepts the optional argument CONTEXT,
which if it is the symbol 'async', inhibits updates in the echo area
when it is busy. This is useful, for example, if you want to monitor progress
of an inherently asynchronous command such as 'compile'.
** Binary format specifications '%b' and '%B' added.
These produce the binary representation of a number.
'%#b' and '%#B' prefix the bits with '0b' and '0B', respectively.

View file

@ -1382,6 +1382,19 @@ these problems by disabling XIM in your X resources:
Emacs.useXIM: false
** When the compose key is pressed, a small window appears that won't go away
In some circumstances, pressing the compose key under X pops up a small
character-selection window next to the cursor, which can be moved but
not closed; it disappears when some window manager operation is
performed, like creating or deleting a window. You can prevent this
window from appearing by completely disabling the X input method (XIM).
If this is acceptable to you, you should set the 'XMODIFIERS'
environment variable to the value '@im=none', and export it before
calling Emacs, for example by invoking Emacs like so:
env XMODIFIERS=@im=none emacs
** On Haiku, BeCJK doesn't work properly with Emacs
Some popular Haiku input methods such BeCJK are known to behave badly

View file

@ -240,7 +240,7 @@ de M-v.
Si vous utilisez un environnement graphique, comme X11 ou MS-Windows,
il devrait y avoir une zone rectangulaire appelée barre de défilement,
ou « scrollbar » sur le bord gauche de la fenêtre d'Emacs. Vous pouvez
ou « scrollbar » sur le bord droit de la fenêtre d'Emacs. Vous pouvez
faire défiler le texte en cliquant avec la souris dans cette barre de
défilement.

View file

@ -39,6 +39,7 @@ Maintainer: Mohsen BANAN <emacs@mohsen.1.banan.byname.net>
* TUTORIAL.fr:
Author: Éric Jacoboni <jaco@teaser.fr>
Maintainer: Éric Jacoboni <jaco@teaser.fr>
Bastien Guerry <bzg@gnu.org>
* TUTORIAL.he
Author: Eli Zaretskii <eliz@gnu.org>

View file

@ -1,7 +1,7 @@
/* Memory allocation on the stack.
Copyright (C) 1995, 1999, 2001-2004, 2006-2026 Free Software
Foundation, Inc.
Copyright (C) 1995, 1999, 2001-2004, 2006-2026 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,6 +1,5 @@
/* Binary mode I/O.
Copyright (C) 2001, 2003, 2005, 2008-2026 Free Software Foundation,
Inc.
Copyright (C) 2001, 2003, 2005, 2008-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -5,8 +5,7 @@
<ctype.h> functions' behaviour depends on the current locale set via
setlocale.
Copyright (C) 2000-2003, 2006, 2008-2026 Free Software Foundation,
Inc.
Copyright (C) 2000-2003, 2006, 2008-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,6 +1,5 @@
/* c-strcasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 1998-1999, 2005-2006, 2009-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,6 +1,5 @@
/* c-strncasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 1998-1999, 2005-2006, 2009-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,7 @@
/* Read symbolic links into a buffer without size limitation, relative to fd.
Copyright (C) 2001, 2003-2004, 2007, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 2001, 2003-2004, 2007, 2009-2026 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* cloexec.c - set or clear the close-on-exec descriptor flag
Copyright (C) 1991, 2004-2006, 2009-2026 Free Software Foundation,
Inc.
Copyright (C) 1991, 2004-2006, 2009-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* Close a stream, with nicer error checking than fclose's.
Copyright (C) 1998-2002, 2004, 2006-2026 Free Software Foundation,
Inc.
Copyright (C) 1998-2002, 2004, 2006-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
/* Analyze differences between two vectors.
Copyright (C) 1988-1989, 1992-1995, 2001-2004, 2006-2026 Free
Software Foundation, Inc.
Copyright (C) 1988-1989, 1992-1995, 2001-2004, 2006-2026 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,6 @@
/* Duplicate an open file descriptor to a specified file descriptor.
Copyright (C) 1999, 2004-2007, 2009-2026 Free Software Foundation,
Inc.
Copyright (C) 1999, 2004-2007, 2009-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,7 @@
/* Make a string describing file modes.
Copyright (C) 1998-1999, 2003, 2006, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 1998-1999, 2003, 2006, 2009-2026 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/* fpending.c -- return the number of pending output bytes on a stream
Copyright (C) 2000, 2004, 2006-2007, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 2000, 2004, 2006-2007, 2009-2026 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
/* Declare __fpending.
Copyright (C) 2000, 2003, 2005-2006, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 2000, 2003, 2005-2006, 2009-2026 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
/* fsusage.c -- return space usage of mounted file systems
Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2026 Free
Software Foundation, Inc.
Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2026 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -92,54 +92,56 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
*lineptr = new_lineptr;
}
size_t cur_len = 0;
for (;;)
{
int i;
{
size_t cur_len = 0;
for (;;)
{
int i;
i = getc_maybe_unlocked (fp);
if (i == EOF)
{
result = -1;
i = getc_maybe_unlocked (fp);
if (i == EOF)
{
result = -1;
break;
}
/* Make enough space for len+1 (for final NUL) bytes. */
if (cur_len + 1 >= *n)
{
size_t needed_max =
SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX;
size_t needed = 2 * *n + 1; /* Be generous. */
if (needed_max < needed)
needed = needed_max;
if (cur_len + 1 >= needed)
{
result = -1;
errno = EOVERFLOW;
goto unlock_return;
}
char *new_lineptr = (char *) realloc (*lineptr, needed);
if (new_lineptr == NULL)
{
alloc_failed ();
result = -1;
goto unlock_return;
}
*lineptr = new_lineptr;
*n = needed;
}
(*lineptr)[cur_len] = i;
cur_len++;
if (i == delimiter)
break;
}
/* Make enough space for len+1 (for final NUL) bytes. */
if (cur_len + 1 >= *n)
{
size_t needed_max =
SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX;
size_t needed = 2 * *n + 1; /* Be generous. */
if (needed_max < needed)
needed = needed_max;
if (cur_len + 1 >= needed)
{
result = -1;
errno = EOVERFLOW;
goto unlock_return;
}
char *new_lineptr = (char *) realloc (*lineptr, needed);
if (new_lineptr == NULL)
{
alloc_failed ();
result = -1;
goto unlock_return;
}
*lineptr = new_lineptr;
*n = needed;
}
(*lineptr)[cur_len] = i;
cur_len++;
if (i == delimiter)
break;
}
(*lineptr)[cur_len] = '\0';
result = cur_len ? cur_len : result;
}
(*lineptr)[cur_len] = '\0';
result = cur_len ? cur_len : result;
}
unlock_return:
funlockfile (fp); /* doesn't set errno */

View file

@ -1,7 +1,6 @@
/* provide consistent interface to getgroups for systems that don't allow N==0
Copyright (C) 1996, 1999, 2003, 2006-2026 Free Software Foundation,
Inc.
Copyright (C) 1996, 1999, 2003, 2006-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,7 @@
/* Get the system load averages.
Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2026 Free
Software Foundation, Inc.
Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2026 Free Software
Foundation, Inc.
NOTE: The canonical source of this file is maintained with gnulib.
Bugs can be reported to bug-gnulib@gnu.org.

View file

@ -1,7 +1,6 @@
/* gettime -- get the system clock
Copyright (C) 2002, 2004-2007, 2009-2026 Free Software Foundation,
Inc.
Copyright (C) 2002, 2004-2007, 2009-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* Provide gettimeofday for systems that don't have it or for which it's broken.
Copyright (C) 2001-2003, 2005-2007, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 2001-2003, 2005-2007, 2009-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -951,6 +951,7 @@ HAVE_SYS_ENDIAN_H = @HAVE_SYS_ENDIAN_H@
HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
HAVE_SYS_PROCESS_H = @HAVE_SYS_PROCESS_H@
HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@
HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@
HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
@ -3644,6 +3645,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
-e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
-e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-e 's|@''HAVE_SYS_PROCESS_H''@|$(HAVE_SYS_PROCESS_H)|g' \
-e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
-e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
< $@-t1 > $@-t2

View file

@ -1,7 +1,7 @@
/* group-member.c -- determine whether group id is in calling user's group list
Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2026 Free
Software Foundation, Inc.
Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2026 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* malloc() function that is glibc compatible.
Copyright (C) 1997-1998, 2006-2007, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 1997-1998, 2006-2007, 2009-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,7 @@
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2026 Free
Software Foundation, Inc.
Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2026 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify

View file

@ -1,7 +1,7 @@
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2026 Free
Software Foundation, Inc.
Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2026 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify

View file

@ -1,7 +1,7 @@
/* Declaration of functions and data types used for MD5 sum computing
library functions.
Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2026 Free
Software Foundation, Inc.
Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2026 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify

View file

@ -1,5 +1,5 @@
/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2026 Free
Software Foundation, Inc.
/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2026 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify

View file

@ -1,7 +1,7 @@
/* memrchr -- find the last occurrence of a byte in a memory block
Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2026 Free
Software Foundation, Inc.
Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2026 Free Software
Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
with help from Dan Sahlin (dan@sics.se) and

View file

@ -1,7 +1,6 @@
/* Provide a replacement for the POSIX nanosleep function.
Copyright (C) 1999-2000, 2002, 2004-2026 Free Software Foundation,
Inc.
Copyright (C) 1999-2000, 2002, 2004-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -405,7 +405,7 @@ get_cgroup2_cpu_quota (void)
if (! fp)
return cpu_quota;
/* Get our cgroupv2 (unififed) hierarchy. */
/* Get our cgroupv2 (unified) hierarchy. */
char *cgroup = NULL;
char *cgroup_str = NULL;
size_t cgroup_size = 0;

View file

@ -5,7 +5,7 @@
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@ -45,10 +45,10 @@
the getcwd-lgpl module, but to be truly robust, use the getcwd module.
Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin,
SCO Xenix. Also, SunOS 4 and Irix 5.3 provide the function, yet it
doesn't work for partitions on which auditing is enabled. If
you're still using an obsolete system with these problems, please
send email to the maintainer of this code. */
SCO Xenix. Also, SunOS 4 provides the function, yet it doesn't work
for partitions on which auditing is enabled. If you're still using
an obsolete system with these problems, please send email to the
maintainer of this code. */
#if !defined HAVE_FCHDIR && !defined fchdir
# define fchdir(fd) (-1)
@ -57,10 +57,11 @@
int
save_cwd (struct saved_cwd *cwd)
{
cwd->desc = open (".", O_SEARCH | O_CLOEXEC);
/* The 'name' member is present only to minimize differences from
gnulib. Initialize it to zero, if only to simplify debugging. */
cwd->name = 0;
gnulib. Initialize it to NULL, if only to simplify debugging. */
cwd->name = NULL;
cwd->desc = open (".", O_SEARCH | O_CLOEXEC);
return 0;
}

View file

@ -1,7 +1,7 @@
/* Save and restore current working directory.
Copyright (C) 1995, 1997-1998, 2003, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 1995, 1997-1998, 2003, 2009-2026 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,8 +1,7 @@
/* sha1.c - Functions to compute SHA1 message digest of files or
memory blocks according to the NIST specification FIPS-180-1.
Copyright (C) 2000-2001, 2003-2006, 2008-2026 Free Software
Foundation, Inc.
Copyright (C) 2000-2001, 2003-2006, 2008-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* sig2str.c -- convert between signal names and numbers
Copyright (C) 2002, 2004, 2006, 2009-2026 Free Software Foundation,
Inc.
Copyright (C) 2002, 2004, 2006, 2009-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -47,7 +47,7 @@
These are like the standard macros introduced in C23, except that
arguments should not have side effects. The C++26 standard is
expected to add this header and it's macros. */
expected to add this header and its macros. */
# define ckd_add(r, a, b) ((bool) _GL_INT_ADD_WRAPV (a, b, r))
# define ckd_sub(r, a, b) ((bool) _GL_INT_SUBTRACT_WRAPV (a, b, r))

View file

@ -1,7 +1,6 @@
/* A GNU-like <stdlib.h>.
Copyright (C) 1995, 2001-2004, 2006-2026 Free Software Foundation,
Inc.
Copyright (C) 1995, 2001-2004, 2006-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@ -71,6 +70,11 @@
# include <sys/loadavg.h>
#endif
/* QNX declares getprogname() in <sys/process.h>. */
#if (@GNULIB_GETPROGNAME@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_PROCESS_H@
# include <sys/process.h>
#endif
/* Native Windows platforms declare _mktemp() in <io.h>. */
#if defined _WIN32 && !defined __CYGWIN__
# include <io.h>

View file

@ -316,7 +316,7 @@ typedef sbyte_count_t retval_t;
else if (to_uppcase) \
for (byte_count_t _i = 0; _i < _n; _i++) \
FPUTC (TOUPPER ((UCHAR_T) _s[_i], loc), p); \
else if (fwrite (_s, _n, 1, p) == 0) \
else if (_n && fwrite (_s, _n, 1, p) == 0) \
return FAILURE; \
} \
while (0) \

View file

@ -1,7 +1,7 @@
/* Convert string representation of a number into an intmax_t value.
Copyright (C) 1999, 2001-2004, 2006, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 1999, 2001-2004, 2006, 2009-2026 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,7 @@
/* Convert string representation of a number into an integer value.
Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2026 Free
Software Foundation, Inc.
Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2026 Free Software
Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
Library. Bugs can be reported to bug-glibc@gnu.org.

View file

@ -1,6 +1,6 @@
/* Function to parse a 'long long int' from text.
Copyright (C) 1995-1997, 1999, 2001, 2009-2026 Free Software
Foundation, Inc.
Copyright (C) 1995-1997, 1999, 2001, 2009-2026 Free Software Foundation,
Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify

View file

@ -1,7 +1,6 @@
/* Reentrant time functions like localtime_r.
Copyright (C) 2003, 2006-2007, 2010-2026 Free Software Foundation,
Inc.
Copyright (C) 2003, 2006-2007, 2010-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -465,7 +465,7 @@ When `outline-minor-mode' is enabled and point is on the outline
heading line, this command will unmark all entries in the outline."
(interactive "P" Buffer-menu-mode)
(cond ((tabulated-list-get-id)
(Buffer-menu--unmark)
(Buffer-menu--unmark ?\r)
(forward-line (if backup -1 1)))
((and (bound-and-true-p outline-minor-mode) (outline-on-heading-p))
(let ((old-pos (point))
@ -488,11 +488,7 @@ When called interactively prompt for MARK; RET remove all marks."
(save-excursion
(goto-char (point-min))
(while (not (eobp))
(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))))
(Buffer-menu--unmark mark)
(forward-line))))
(defun Buffer-menu-unmark-all ()
@ -506,15 +502,22 @@ When called interactively prompt for MARK; RET remove all marks."
(forward-line -1)
(while (and (not (tabulated-list-get-id)) (not (bobp)))
(forward-line -1))
(if (tabulated-list-get-id) (Buffer-menu--unmark)))
(if (tabulated-list-get-id) (Buffer-menu--unmark ?\r)))
(defun Buffer-menu--unmark ()
(tabulated-list-set-col 0 " " t)
(let ((buf (Buffer-menu-buffer)))
(when buf
(if (buffer-modified-p buf)
(tabulated-list-set-col 2 "*" t)
(tabulated-list-set-col 2 " " t)))))
(defun Buffer-menu--unmark (mark)
"Remove MARK in current entry.
If MARK is \\`RET' remove all marks."
(when-let* ((entry (tabulated-list-get-entry)))
;; A mark could appear in column 0 or 2.
(dolist (col '(0 2))
(when (or (char-equal mark ?\r)
(char-equal mark (string-to-char (aref entry col))))
(tabulated-list-set-col col " " t)))
;; Reset modified mark in column 2.
(let ((buf (Buffer-menu-buffer)))
(when (and buf (buffer-modified-p buf)
(string-equal (aref entry 2) " "))
(tabulated-list-set-col 2 "*" t)))))
(defun Buffer-menu-delete (&optional arg)
"Mark the buffer on this Buffer Menu buffer line for deletion.

View file

@ -911,17 +911,19 @@
Elements of A must either be a character (see `characterp') or a complex
number with only a real character part, each with a value less than or
equal to the custom variable `calc-string-maximum-character'."
(while (and (setq a (cdr a))
(or (and (characterp (car a))
(<= (car a)
calc-string-maximum-character))
(and (eq (car-safe (car a)) 'cplx)
(characterp (nth 1 (car a)))
(eq (nth 2 (car a)) 0)
(<= (nth 1 (car a))
calc-string-maximum-character)))))
(null a))
equal to the value of `calc-string-maximum-character'. Return nil if
`calc-string-maximum-character' is not a character."
(when (characterp calc-string-maximum-character)
(while (and (setq a (cdr a))
(or (and (characterp (car a))
(<= (car a)
calc-string-maximum-character))
(and (eq (car-safe (car a)) 'cplx)
(characterp (nth 1 (car a)))
(eq (nth 2 (car a)) 0)
(<= (nth 1 (car a))
calc-string-maximum-character)))))
(null a)))
(defconst math-vector-to-string-chars '( ( ?\" . "\\\"" )
( ?\\ . "\\\\" )
@ -1556,8 +1558,12 @@ Not all brackets have midpieces.")
(setq c (cdr c))
(while (setq c (cdr c))
(if (eq (car-safe (car c)) 'rule)
(math-comp-add-string (make-string maxwid (nth 1 (car c)))
math-comp-hpos math-comp-vpos)
(let* ((sep (nth 1 (car c)))
(rule-width (ceiling
(* maxwid (string-pixel-width "-"))
(string-pixel-width (char-to-string sep)))))
(math-comp-add-string (make-string rule-width sep)
math-comp-hpos math-comp-vpos))
(let ((math-comp-hpos (+ math-comp-hpos (/ (* bias (- maxwid
(car widths)))
2))))
@ -1654,7 +1660,11 @@ Not all brackets have midpieces.")
((memq (car c) '(set break)) t)))
(defun math-comp-width (c)
(cond ((not (consp c)) (length c))
(cond ((not (consp c))
(or (and (stringp c)
(ceiling (string-pixel-width c)
(string-pixel-width "-")))
(length c)))
((memq (car c) '(horiz subscr supscr))
(let ((accum 0))
(while (setq c (cdr c))

View file

@ -571,232 +571,6 @@ Prefix argument ARG will make the entry nonmarking."
"Baháí calendar equivalent of date diary entry."
(format "Baháí date: %s" (calendar-bahai-date-string date)))
;;; ======================================================================
;;; Verification and Testing
;;; ======================================================================
;; The following code verifies the astronomical calculations against
;; official dates published by the Baháí World Centre.
;;
;; BACKGROUND: 2014 Calendar Reform
;; --------------------------------
;; On 10 July 2014, the Universal House of Justice announced provisions
;; for the uniform implementation of the Badí' calendar, effective from
;; Naw-Rúz 172 BE (March 2015). The key provisions are:
;;
;; 1. NAW-RÚZ DETERMINATION:
;; "The Festival of Naw-Rúz falleth on the day that the sun entereth
;; the sign of Aries, even should this occur no more than one minute
;; before sunset." Tehran is the reference point for determining the
;; moment of the vernal equinox. If the equinox occurs before sunset
;; in Tehran, that day is Naw-Rúz; otherwise, the following day is.
;;
;; 2. TWIN HOLY BIRTHDAYS:
;; "They will now be observed on the first and the second day
;; following the occurrence of the eighth new moon after Naw-Rúz,
;; as determined in advance by astronomical tables using Ṭihrán as
;; the point of reference."
;;
;; VERIFICATION APPROACH
;; ---------------------
;; The functions below compare calculated dates against official data
;; from the Baháí World Centre, covering the 50-year period from
;; 172 BE (2015 CE) to 221 BE (2064 CE). This data was extracted from
;; the official ICS calendar file distributed by the Baháí World Centre.
;;
;; The verification confirms:
;; - Naw-Rúz dates: Calculated using `solar-equinoxes/solstices' for the
;; vernal equinox and `solar-sunrise-sunset' for Tehran sunset times.
;; - Twin Holy Birthdays: Calculated using `lunar-new-moon-on-or-after'
;; to find the eighth new moon after Naw-Rúz.
;;
;; To run the verification:
;; M-x calendar-bahai-verify-calculations RET
(defconst calendar-bahai--nawruz-reference-dates
'((2015 3 21) (2016 3 20) (2017 3 20) (2018 3 21) (2019 3 21)
(2020 3 20) (2021 3 20) (2022 3 21) (2023 3 21) (2024 3 20)
(2025 3 20) (2026 3 21) (2027 3 21) (2028 3 20) (2029 3 20)
(2030 3 20) (2031 3 21) (2032 3 20) (2033 3 20) (2034 3 20)
(2035 3 21) (2036 3 20) (2037 3 20) (2038 3 20) (2039 3 21)
(2040 3 20) (2041 3 20) (2042 3 20) (2043 3 21) (2044 3 20)
(2045 3 20) (2046 3 20) (2047 3 21) (2048 3 20) (2049 3 20)
(2050 3 20) (2051 3 21) (2052 3 20) (2053 3 20) (2054 3 20)
(2055 3 21) (2056 3 20) (2057 3 20) (2058 3 20) (2059 3 20)
(2060 3 20) (2061 3 20) (2062 3 20) (2063 3 20) (2064 3 20))
"Official Naw-Rúz dates from the Baháí World Centre (2015-2064).
Each entry is (GREGORIAN-YEAR MONTH DAY). These dates are extracted
from the official ICS calendar file and serve as the authoritative
reference for verifying the astronomical calculations.
The dates show that Naw-Rúz falls on March 20 or 21, depending on
when the vernal equinox occurs relative to sunset in Tehran.")
(defconst calendar-bahai--twin-birthdays-reference-dates
'(;; (GREG-YEAR BAB-MONTH BAB-DAY BAHA-MONTH BAHA-DAY)
(2015 11 13 11 14) (2016 11 1 11 2) (2017 10 21 10 22)
(2018 11 9 11 10) (2019 10 29 10 30) (2020 10 18 10 19)
(2021 11 6 11 7) (2022 10 26 10 27) (2023 10 16 10 17)
(2024 11 2 11 3) (2025 10 22 10 23) (2026 11 10 11 11)
(2027 10 30 10 31) (2028 10 19 10 20) (2029 11 7 11 8)
(2030 10 28 10 29) (2031 10 17 10 18) (2032 11 4 11 5)
(2033 10 24 10 25) (2034 11 12 11 13) (2035 11 1 11 2)
(2036 10 20 10 21) (2037 11 8 11 9) (2038 10 29 10 30)
(2039 10 19 10 20) (2040 11 6 11 7) (2041 10 26 10 27)
(2042 10 15 10 16) (2043 11 3 11 4) (2044 10 22 10 23)
(2045 11 10 11 11) (2046 10 30 10 31) (2047 10 20 10 21)
(2048 11 7 11 8) (2049 10 28 10 29) (2050 10 17 10 18)
(2051 11 5 11 6) (2052 10 24 10 25) (2053 11 11 11 12)
(2054 11 1 11 2) (2055 10 21 10 22) (2056 11 8 11 9)
(2057 10 29 10 30) (2058 10 18 10 19) (2059 11 6 11 7)
(2060 10 25 10 26) (2061 10 14 10 15) (2062 11 2 11 3)
(2063 10 23 10 24) (2064 11 10 11 11))
"Official Twin Holy Birthday dates from the Baháí World Centre (2015-2064).
Each entry is (GREGORIAN-YEAR BAB-MONTH BAB-DAY BAHA-MONTH BAHA-DAY).
The Birth of the Báb and the Birth of Baháulláh are celebrated on
consecutive days, determined by the eighth new moon after Naw-Rúz.
These dates move through the Gregorian calendar, typically falling
between mid-October and mid-November (Baháí months of Mashíyyat,
\\='Ilm, and Qudrat).")
(defun calendar-bahai--verify-nawruz ()
"Verify Naw-Rúz calculations against official reference dates.
Returns a plist with :total, :correct, and :errors keys."
(let ((total 0)
(correct 0)
(errors nil))
(dolist (entry calendar-bahai--nawruz-reference-dates)
(let* ((greg-year (nth 0 entry))
(expected-month (nth 1 entry))
(expected-day (nth 2 entry))
(expected (list expected-month expected-day greg-year))
(computed (calendar-bahai-nawruz-for-gregorian-year greg-year)))
(setq total (1+ total))
(if (equal computed expected)
(setq correct (1+ correct))
(push (list greg-year expected computed) errors))))
(list :total total :correct correct :errors (nreverse errors))))
(defun calendar-bahai--verify-twin-birthdays ()
"Verify Twin Holy Birthday calculations against official reference dates.
Returns a plist with :total, :bab-correct, :baha-correct, and :errors keys."
(let ((total 0)
(bab-correct 0)
(baha-correct 0)
(errors nil))
(dolist (entry calendar-bahai--twin-birthdays-reference-dates)
(let* ((greg-year (nth 0 entry))
(bahai-year (- greg-year (1- 1844)))
(expected-bab (list (nth 1 entry) (nth 2 entry) greg-year))
(expected-baha (list (nth 3 entry) (nth 4 entry) greg-year)))
;; Only verify from reform year onwards
(when (>= bahai-year calendar-bahai-reform-year)
(setq total (1+ total))
(let* ((computed (calendar-bahai-twin-holy-birthdays-for-year bahai-year))
(computed-bab (car computed))
(computed-baha (cadr computed)))
(if (equal computed-bab expected-bab)
(setq bab-correct (1+ bab-correct))
(push (list greg-year "Báb" expected-bab computed-bab) errors))
(if (equal computed-baha expected-baha)
(setq baha-correct (1+ baha-correct))
(push (list greg-year "Baháulláh" expected-baha computed-baha)
errors))))))
(list :total total
:bab-correct bab-correct
:baha-correct baha-correct
:errors (nreverse errors))))
(defun calendar-bahai-verify-calculations ()
"Verify Baháí calendar calculations against official reference dates.
This function compares the astronomical calculations for Naw-Rúz and
the Twin Holy Birthdays against official dates from the Baháí World
Centre for the period 172-221 BE (2015-2064 CE).
The verification tests:
1. Naw-Rúz dates - calculated from the vernal equinox relative to
sunset in Tehran.
2. Birth of the Báb dates - the first day following the eighth new
moon after Naw-Rúz.
3. Birth of Baháulláh dates - the second day following the eighth
new moon after Naw-Rúz.
Results are displayed in the *Baháí Calendar Verification* buffer."
(interactive)
(let* ((nawruz-results (calendar-bahai--verify-nawruz))
(twin-results (calendar-bahai--verify-twin-birthdays))
(buf (get-buffer-create "*Baháí Calendar Verification*")))
(with-current-buffer buf
(erase-buffer)
(insert "This report verifies the astronomical calculations against\n")
(insert "official dates from the Baháí World Centre (172-221 BE).\n\n")
;; Naw-Rúz results
(insert "───────────────────────────────────────────────────────────────\n")
(insert "NAW-RÚZ VERIFICATION\n")
(insert "───────────────────────────────────────────────────────────────\n")
(insert (format " Total years tested: %d\n" (plist-get nawruz-results :total)))
(insert (format " Correct: %d\n" (plist-get nawruz-results :correct)))
(insert (format " Errors: %d\n"
(length (plist-get nawruz-results :errors))))
(when (plist-get nawruz-results :errors)
(insert "\n Discrepancies:\n")
(dolist (err (plist-get nawruz-results :errors))
(insert (format " %d: expected %S, calculated %S\n"
(nth 0 err) (nth 1 err) (nth 2 err)))))
(insert "\n")
;; Twin Holy Birthdays results
(insert "───────────────────────────────────────────────────────────────\n")
(insert "TWIN HOLY BIRTHDAYS VERIFICATION\n")
(insert "───────────────────────────────────────────────────────────────\n")
(insert (format " Total years tested: %d\n"
(plist-get twin-results :total)))
(insert (format " Birth of Báb correct: %d\n"
(plist-get twin-results :bab-correct)))
(insert (format " Birth of Baháulláh correct: %d\n"
(plist-get twin-results :baha-correct)))
(insert (format " Errors: %d\n"
(length (plist-get twin-results :errors))))
(when (plist-get twin-results :errors)
(insert "\n Discrepancies:\n")
(dolist (err (plist-get twin-results :errors))
(insert (format " %d %s: expected %S, calculated %S\n"
(nth 0 err) (nth 1 err) (nth 2 err) (nth 3 err)))))
(insert "\n")
;; Summary
(insert "───────────────────────────────────────────────────────────────\n")
(insert "SUMMARY\n")
(insert "───────────────────────────────────────────────────────────────\n")
(let ((total-errors (+ (length (plist-get nawruz-results :errors))
(length (plist-get twin-results :errors)))))
(if (zerop total-errors)
(progn
(insert " All calculations match official dates!\n\n")
(insert " The astronomical algorithms correctly compute:\n")
(insert " • Naw-Rúz from the vernal equinox/sunset in Tehran\n")
(insert " • Twin Holy Birthdays from the 8th new moon after Naw-Rúz\n"))
(insert (format " ✗ Total discrepancies: %d\n" total-errors))
(insert " Review the errors above for details.\n"))))
(display-buffer buf)
;; Return results for programmatic use
(list :nawruz nawruz-results :twin-birthdays twin-results)))
(defun calendar-bahai-run-tests ()
"Run verification tests and return t if all pass, nil otherwise.
This function is suitable for use in automated testing."
(let* ((nawruz-results (calendar-bahai--verify-nawruz))
(twin-results (calendar-bahai--verify-twin-birthdays))
(nawruz-ok (zerop (length (plist-get nawruz-results :errors))))
(twin-ok (zerop (length (plist-get twin-results :errors)))))
(and nawruz-ok twin-ok)))
(provide 'cal-bahai)
;;; cal-bahai.el ends here

View file

@ -1098,7 +1098,7 @@ Otherwise, use symbolic time zones like \"CET\"."
(defconst calendar-first-date-row 3
"First row in the calendar with actual dates.")
(defconst calendar-buffer "*Calendar*"
(defvar calendar-buffer "*Calendar*"
"Name of the buffer used for the calendar.")
(defun calendar-get-buffer ()
@ -1450,9 +1450,12 @@ Optional integers MON and YR are used instead of today's date."
(calendar-mark-holidays))
(unwind-protect
(if calendar-mark-diary-entries (diary-mark-entries))
(run-hooks (if (calendar-date-is-visible-p today)
'calendar-today-visible-hook
'calendar-today-invisible-hook)))))
(if (not (calendar-date-is-visible-p today))
(run-hooks 'calendar-today-invisible-hook)
;; Functions in calendar-today-visible-hook may rely on the cursor
;; being on today's date.
(calendar-cursor-to-visible-date today)
(run-hooks 'calendar-today-visible-hook)))))
(defun calendar-generate (month year)
"Generate a three-month Gregorian calendar centered around MONTH, YEAR."

View file

@ -1402,7 +1402,7 @@ marks. This is intended to deal with deleted diary entries."
(diary-buffer (find-buffer-visiting diary-file))
;; Record current calendar buffer in case this function is
;; called in a calendar-mode buffer not named `calendar-buffer'.
(calendar-buffer (calendar-get-buffer))
(calendar-buffer (buffer-name (calendar-get-buffer)))
;; Dynamically bound in diary-include-files.
(d-incp (and (boundp 'diary-including) diary-including))
file-glob-attrs temp-buff)

View file

@ -654,10 +654,17 @@ STRING)). Returns nil if it is not visible in the current calendar window."
(defun holiday-float (month dayname n string &optional day)
"Holiday called STRING on the Nth DAYNAME after/before MONTH DAY.
DAYNAME=0 means Sunday, DAYNAME=1 means Monday, and so on.
If N>0, use the Nth DAYNAME after MONTH DAY.
If N<0, use the Nth DAYNAME before MONTH DAY.
DAY defaults to 1 if N>0, and MONTH's last day otherwise.
DAYNAME = 0 means Sunday, DAYNAME = 1 means Monday, and so on. DAY
defaults to 1 if N > 0, and MONTH's last day otherwise.
If N > 0, use the Nth DAYNAME after MONTH DAY.
If N < 0, use the Nth DAYNAME before MONTH DAY.
When MONTH DAY falls on DAYNAME, the holiday will be |N|-1 weeks before
or after MONTH DAY. For example, with N = +1 (-1) the holiday falls on
MONTH DAY, and with N = +2 (-2) the holiday falls 1 week after (before)
MONTH DAY.
If the holiday is visible in the calendar window, returns a
list (((month day year) STRING)). Otherwise returns nil."
;; This is messy because the holiday may be visible, while the date

View file

@ -723,19 +723,23 @@ SYMBOL is a function that can be overridden."
override (symbol-function override)))))
(when (and override override-file)
(let ((meta-name (cons override major-mode))
;; For the declaration:
;;
;;(define-mode-local-override xref-elisp-foo c-mode
;;
;; The override symbol name is
;; "xref-elisp-foo-c-mode". The summary should match
;; the declaration, so strip the mode from the
;; symbol name.
(summary (format elisp--xref-format-extra
'define-mode-local-override
(substring (symbol-name override) 0 (- (1+ (length (symbol-name major-mode)))))
major-mode)))
(let* ((meta-name (cons override major-mode))
;; For the declaration:
;;
;;(define-mode-local-override xref-elisp-foo c-mode
;;
;; The override symbol name is
;; "xref-elisp-foo-c-mode". The summary should match
;; the declaration, so strip the mode from the
;; symbol name.
(overridesymbol
(intern
(substring (symbol-name override)
0 (- (1+ (length (symbol-name major-mode)))))))
(summary (format elisp--xref-format-extra
'define-mode-local-override
overridesymbol
major-mode)))
(unless (xref-mode-local--override-present override xrefs)
(push (elisp--xref-make-xref

View file

@ -150,7 +150,11 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
(scroll-down-aggressively windows
(choice (const :tag "off" nil) float)
"21.1")
(line-spacing display (choice (const :tag "none" nil) number)
(line-spacing display
(choice (const :tag "No spacing" nil)
(number :tag "Spacing below")
(cons :tag "Spacing above and below"
number number))
"22.1")
(cursor-in-non-selected-windows
cursor ,cursor-type-types nil

View file

@ -5038,12 +5038,16 @@ format, use `\\[universal-argument] \\[dired]'.")
;; `dired-ls-sorting-switches' after -t overrides -t.
"[^ " dired-ls-sorting-switches "]*"
"\\(\\(\\`\\| +\\)\\(--[^ ]+\\|-[^- t"
dired-ls-sorting-switches "]+\\)\\)* *$")
dired-ls-sorting-switches "]+\\|"
;; Allow quoted strings
"\"[^\"]*\"\\)\\)* *$")
"Regexp recognized by Dired to set `by date' mode.")
(defvar dired-sort-by-name-regexp
(concat "\\`\\(\\(\\`\\| +\\)\\(--[^ ]+\\|"
"-[^- t" dired-ls-sorting-switches "]+\\)\\)* *$")
"-[^- t" dired-ls-sorting-switches "]+[^- tSXU]+\\|"
;; Allow quoted strings
"\"[^\"]*\"\\)\\)* *$")
"Regexp recognized by Dired to set `by name' mode.")
(defvar dired-sort-inhibit nil

View file

@ -31,12 +31,9 @@
;;; Code:
(require 'cl-lib)
(eval-when-compile
(require 'subr-x))
(require 'editorconfig)
;;;###autoload

View file

@ -154,17 +154,22 @@ also passed as second argument to SPECIALIZERS-FUNCTION."
(:constructor cl--generic-make-method
(specializers qualifiers call-con function))
(:predicate nil))
"Type of `cl-generic' method objects.
FUNCTION holds a function containing the actual code of the method.
SPECIALIZERS holds the list of specializers (as long as the number of
mandatory arguments of the method).
QUALIFIERS holds the list of qualifiers.
CALL-CON indicates the calling convention expected by FUNCTION:
- nil: FUNCTION is just a normal function with no extra arguments for
`call-next-method' or `next-method-p' (which it hence can't use).
- `curried': FUNCTION is a curried function that first takes the
\"next combined method\" and returns the resulting combined method.
It can distinguish `next-method-p' by checking if that next method
is `cl--generic-isnot-nnm-p'.
- t: FUNCTION takes the `call-next-method' function as an extra first
argument."
(specializers nil :read-only t :type list)
(qualifiers nil :read-only t :type (list-of atom))
;; CALL-CON indicates the calling convention expected by FUNCTION:
;; - nil: FUNCTION is just a normal function with no extra arguments for
;; `call-next-method' or `next-method-p' (which it hence can't use).
;; - `curried': FUNCTION is a curried function that first takes the
;; "next combined method" and return the resulting combined method.
;; It can distinguish `next-method-p' by checking if that next method
;; is `cl--generic-isnot-nnm-p'.
;; - t: FUNCTION takes the `call-next-method' function as its first (extra)
;; argument.
(call-con nil :read-only t :type symbol)
(function nil :read-only t :type function))
@ -181,7 +186,10 @@ also passed as second argument to SPECIALIZERS-FUNCTION."
;; The most important dispatch is last in the list (and the least is first).
(dispatches nil :type (list-of (cons natnum (list-of generalizers))))
(method-table nil :type (list-of cl--generic-method))
(options nil :type list))
(options nil :type list)
;; This slot holds the function we put into `symbol-function' before
;; the actual dispatch function has been computed.
(lazy-function nil))
(defun cl-generic-function-options (generic)
"Return the options of the generic function GENERIC."
@ -316,6 +324,9 @@ DEFAULT-BODY, if present, is used as the body of a default method.
,@warnings
(defalias ',name
(cl-generic-define ',name ',args ',(nreverse options))
;; FIXME: This docstring argument is used as circumstantial
;; evidence that this generic function was defined via
;; `cl-defgeneric' rather than only `cl-defmethod's.
,(if (consp doc) ;An expression rather than a constant.
`(help-add-fundoc-usage ,doc ',args)
(help-add-fundoc-usage doc args)))
@ -658,8 +669,6 @@ The set of acceptable TYPEs (also called \"specializers\") is defined
;; Keep the ordering; important for methods with :extra qualifiers.
(mapcar (lambda (x) (if (eq x (car me)) method x)) mt)))
(let ((sym (cl--generic-name generic)) ; Actual name (for aliases).
;; FIXME: Try to avoid re-constructing a new function if the old one
;; is still valid (e.g. still empty method cache)?
(gfun (cl--generic-make-function generic)))
(cl-pushnew `(cl-defmethod . ,(cl--generic-load-hist-format
(cl--generic-name generic)
@ -827,9 +836,30 @@ You might need to add: %S"
,@fixedargs args)))))))))
(defun cl--generic-make-function (generic)
(cl--generic-make-next-function generic
(cl--generic-dispatches generic)
(cl--generic-method-table generic)))
"Return the function to put into the `symbol-function' of GENERIC."
;; The function we want is the one that performs the dispatch,
;; but that function depends on the set of methods and needs to be
;; flushed/recomputed when the set of methods changes.
;; To avoid reconstructing such a method N times for N `cl-defmethod',
;; we construct the dispatch function lazily:
;; we first return a "lazy" function, which waits until the
;; first call to the method to really compute the dispatch function,
;; at which point we replace the dummy with the real one.
(with-memoization (cl--generic-lazy-function generic)
(lambda (&rest args)
(let* ((real
(cl--generic-make-next-function generic
(cl--generic-dispatches generic)
(cl--generic-method-table generic)))
(sym (cl--generic-name generic))
(old-adv-cc (get-advertised-calling-convention
(symbol-function sym))))
(when (listp old-adv-cc)
(set-advertised-calling-convention real old-adv-cc nil))
(when (symbol-function sym)
(let ((current-load-list nil))
(defalias sym real)))
(apply real args)))))
(defun cl--generic-make-next-function (generic dispatches methods)
(let* ((dispatch
@ -855,33 +885,32 @@ This is particularly useful when many different tags select the same set
of methods, since this table then allows us to share a single combined-method
for all those different tags in the method-cache.")
(define-error 'cl--generic-cyclic-definition "Cyclic definition")
(defun cl--generic-build-combined-method (generic methods)
(if (null methods)
;; Special case needed to fix a circularity during bootstrap.
(cl--generic-standard-method-combination generic methods)
(let ((f
(with-memoization
;; FIXME: Since the fields of `generic' are modified, this
;; hash-table won't work right, because the hashes will change!
;; It's not terribly serious, but reduces the effectiveness of
;; the table.
(gethash (cons generic methods)
cl--generic-combined-method-memoization)
(puthash (cons generic methods) :cl--generic--under-construction
cl--generic-combined-method-memoization)
(condition-case nil
(cl-generic-combine-methods generic methods)
;; Special case needed to fix a circularity during bootstrap.
(cl--generic-cyclic-definition
(cl--generic-standard-method-combination generic methods))))))
(if (eq f :cl--generic--under-construction)
(signal 'cl--generic-cyclic-definition
(list (cl--generic-name generic)))
f))))
;; Since `cl-generic-combine-methods' is itself a generic function,
;; there is a chicken and egg problem when computing a combined
;; method for `cl-generic-combine-methods'.
;; We break such infinite recursion by detecting it and falling
;; back to `cl--generic-standard-method-combination' when it happens.
;; FIXME: Since the fields of `generic' are modified, the
;; `cl--generic-combined-method-memoization' hash-table won't work
;; right, because the hashes will change! It's not terribly serious,
;; but reduces the effectiveness of the table.
(let ((key (cons generic methods)))
(pcase (gethash key cl--generic-combined-method-memoization)
(:cl--generic--under-construction
;; Fallback to the standard method combination.
(setf (gethash key cl--generic-combined-method-memoization)
(cl--generic-standard-method-combination generic methods)))
('nil
(setf (gethash key cl--generic-combined-method-memoization)
:cl--generic--under-construction)
(let ((f nil))
(unwind-protect
(setq f (cl-generic-combine-methods generic methods))
(setf (gethash key cl--generic-combined-method-memoization) f))))
(f f))))
(oclosure-define (cl--generic-nnm)
(oclosure-define cl--generic-nnm
"Special type for `call-next-method's that just call `no-next-method'.")
(defun cl-generic-call-method (generic method &optional fun)
@ -1002,11 +1031,11 @@ The code which extracts the tag should be as fast as possible.
The tags should be chosen according to the following rules:
- The tags should not be too specific: similar objects which match the
same list of specializers should ideally use the same (`eql') tag.
This insures that the cached computation of the applicable
This ensures that the cached computation of the applicable
methods for one object can be reused for other objects.
- Corollary: objects which don't match any of the relevant specializers
should ideally all use the same tag (typically nil).
This insures that this cache does not grow unnecessarily large.
This ensures that this cache does not grow unnecessarily large.
- Two different generalizers G1 and G2 should not use the same tag
unless they use it for the same set of objects. IOW, if G1.tag(X1) =
G2.tag(X2) then G1.tag(X1) = G2.tag(X1) = G1.tag(X2) = G2.tag(X2).
@ -1028,8 +1057,7 @@ those methods.")
(unless (ignore-errors (cl-generic-generalizers t))
;; Temporary definition to let the next defmethod succeed.
(fset 'cl-generic-generalizers
(lambda (specializer)
(if (eq t specializer) (list cl--generic-t-generalizer))))
(lambda (_specializer) (list cl--generic-t-generalizer)))
(fset 'cl-generic-combine-methods #'cl--generic-standard-method-combination))
(cl-defmethod cl-generic-generalizers (specializer)

View file

@ -327,15 +327,16 @@ FORM is of the form (ARGS . BODY)."
;; "manual" parsing.
(let ((slen (length simple-args))
(usage-str
;; Macro expansion can take place in the middle of
;; apparently harmless computation, so it should not
;; touch the match-data.
(save-match-data
(help--docstring-quote
(let ((print-gensym nil) (print-quoted t)
(print-escape-newlines t))
(format "%S" (cons 'fn (cl--make-usage-args
orig-args))))))))
;; Macro expansion can take place in the middle of
;; apparently harmless computation, so it should not
;; touch the match-data.
(save-match-data
(require 'help)
(help--docstring-quote
(let ((print-gensym nil) (print-quoted t)
(print-escape-newlines t))
(format "%S" (cons 'fn (cl--make-usage-args
orig-args))))))))
(when (memq '&optional simple-args)
(decf slen))
(setq header

View file

@ -296,10 +296,11 @@
(cl-defstruct (built-in-class
(:include cl--class)
(:conc-name built-in-class--)
(:noinline t)
(:constructor nil)
(:constructor built-in-class--make
(name docstring parent-types
(name docstring parent-types &optional non-abstract-supertype
&aux (parents
(mapcar (lambda (type)
(or (get type 'cl--class)
@ -308,7 +309,9 @@
(:copier nil))
"Type descriptors for built-in types.
The `slots' (and hence `index-table') are currently unused."
)
;; As a general rule, built-in types are abstract if-and-only-if they have
;; other built-in types as subtypes. But there are a few exceptions.
(non-abstract-supertype nil :read-only t))
(defmacro cl--define-built-in-type (name parents &optional docstring &rest slots)
;; `slots' is currently unused, but we could make it take
@ -322,19 +325,22 @@ The `slots' (and hence `index-table') are currently unused."
(let ((predicate (intern-soft (format
(if (string-match "-" (symbol-name name))
"%s-p" "%sp")
name))))
name)))
(nas nil))
(unless (fboundp predicate) (setq predicate nil))
(while (keywordp (car slots))
(let ((kw (pop slots)) (val (pop slots)))
(pcase kw
(:predicate (setq predicate val))
(:non-abstract-supertype (setq nas val))
(_ (error "Unknown keyword arg: %S" kw)))))
`(progn
,(if predicate `(put ',name 'cl-deftype-satisfies #',predicate)
;; (message "Missing predicate for: %S" name)
nil)
(put ',name 'cl--class
(built-in-class--make ',name ,docstring ',parents)))))
(built-in-class--make ',name ,docstring ',parents
,@(if nas '(t)))))))
;; FIXME: Our type DAG has various quirks:
;; - Some `keyword's are also `symbol-with-pos' but that's not reflected
@ -381,6 +387,7 @@ regardless if `funcall' would accept to call them."
"Abstract supertype of both `number's and `marker's.")
(cl--define-built-in-type symbol atom
"Type of symbols."
:non-abstract-supertype t
;; 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
@ -411,7 +418,8 @@ 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 boolean (symbol)
"Type of the canonical boolean values, i.e. either nil or t.")
"Type of the canonical boolean values, i.e. either nil or t."
:non-abstract-supertype 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))
@ -450,9 +458,9 @@ The fields are used as follows:
5 [iform] The interactive form (if present)")
(cl--define-built-in-type byte-code-function (compiled-function closure)
"Type of functions that have been byte-compiled.")
(cl--define-built-in-type subr (atom)
"Abstract type of functions compiled to machine code.")
(cl--define-built-in-type module-function (function)
(cl--define-built-in-type subr (atom) ;Beware: not always a function.
"Abstract type of functions and special forms compiled to machine code.")
(cl--define-built-in-type module-function (compiled-function)
"Type of functions provided via the module API.")
(cl--define-built-in-type interpreted-function (closure)
"Type of functions that have not been compiled.")

View file

@ -272,7 +272,7 @@ Used to modify the compiler environment."
(member (function (t list) list))
(memq (function (t list) list))
(memql (function (t list) list))
(message (function (string &rest t) string))
(message (function ((or string null) &rest t) (or string null)))
(min (function ((or number marker) &rest (or number marker)) number))
(minibuffer-selected-window (function () (or window null)))
(minibuffer-window (function (&optional frame) window))

View file

@ -254,11 +254,7 @@ with empty strings removed."
(let* ((map (if require-match
crm-local-must-match-map
crm-local-completion-map))
(map (if minibuffer-visible-completions
(make-composed-keymap
(list minibuffer-visible-completions-map
map))
map))
(map (minibuffer-visible-completions--maybe-compose-map map))
(buffer (current-buffer))
input)
(minibuffer-with-setup-hook

View file

@ -134,7 +134,7 @@ After VARS is handled, BODY is evaluated in the new environment."
This is halfway between `defmacro' and `defun'. BODY is used as a blueprint
both for the body of the function and for the body of the compiler-macro
used to generate the code inlined at each call site.
See Info node `(elisp)Inline Functions for more details.
See Info node `(elisp)Inline Functions' for more details.
A (noinline t) in the `declare' form prevents the definition of the
compiler macro. This is for the rare case in which you want to use this

View file

@ -50,7 +50,7 @@ This affects `insert-parentheses' and `insert-pair'."
(goto-char (or (scan-sexps (point) arg) (buffer-end arg)))
(if (< arg 0) (backward-prefix-chars)))
(defvar forward-sexp-function nil
(defvar forward-sexp-function #'forward-sexp-default-function
;; FIXME:
;; - for some uses, we may want a "sexp-only" version, which only
;; jumps over a well-formed sexp, rather than some dwimish thing
@ -79,9 +79,9 @@ report errors as appropriate for this kind of usage."
"No next sexp"
"No previous sexp"))))
(or arg (setq arg 1))
(if forward-sexp-function
(funcall forward-sexp-function arg)
(forward-sexp-default-function arg))))
(funcall (or forward-sexp-function
#'forward-sexp-default-function)
arg)))
(defun backward-sexp (&optional arg interactive)
"Move backward across one balanced expression (sexp).
@ -147,7 +147,7 @@ This command assumes point is not in a string or comment."
"Default function for `forward-list-function'."
(goto-char (or (scan-lists (point) arg 0) (buffer-end arg))))
(defvar forward-list-function nil
(defvar forward-list-function #'forward-list-default-function
"If non-nil, `forward-list' delegates to this function.
Should take the same arguments and behave similarly to `forward-list'.")
@ -169,9 +169,9 @@ report errors as appropriate for this kind of usage."
"No next group"
"No previous group"))))
(or arg (setq arg 1))
(if forward-list-function
(funcall forward-list-function arg)
(forward-list-default-function arg))))
(funcall (or forward-list-function
#'forward-list-default-function)
arg)))
(defun backward-list (&optional arg interactive)
"Move backward across one balanced group of parentheses.
@ -250,6 +250,8 @@ defined by the current language mode. With ARG, do this that
many times. A negative argument means move backward but still to
a less deep spot.
Calls `up-list-function' to do the work, if that is non-nil.
If ESCAPE-STRINGS is non-nil (as it is interactively), move out
of enclosing strings as well.
@ -289,7 +291,9 @@ On error, location of point is unspecified."
(scan-error (point-max)))
(forward-comment 1)
(point)))))))
(if (null forward-sexp-function)
;; FIXME: Comparing functions is a code smell.
(if (memq forward-sexp-function
'(nil forward-sexp-default-function))
(goto-char (or (scan-lists (point) inc 1)
(buffer-end arg)))
(condition-case err

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