Merge from origin/emacs-29

0d8b69e0ad Don't ding when completion succeeded
f11e2d3699 ; * admin/git-bisect-start: Update failing commits
9855a3ea74 ; * src/xdisp.c (redisplay_tool_bar): Fix a typo in a com...
f4ee696b88 Improve documentation of color-related functions
90eadc3e23 Revert "* package.el (package--get-activatable-pkg): Pref...
65f355ea0a ; Update my mail address
a3a69ec234 Fix connection-local user options handling (bug#63300)
240803cc3e Document 'startup-redirect-eln-cache'
026afb2298 ; * etc/PROBLEMS: Entry about crashes due to anti-virus (...
bcc222251e Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#5...
07c8211ca3 Add 'infer' as a keyword to typescript-ts-mode (bug#63880)
dd2d8ff2f5 ; * etc/NEWS: Mention the issue with PGTK on WSL (bug#633...
fa8135f891 Revert changes to the order in which package descs are lo...
27fcfa2c0a ; * etc/NEWS: Improve instructions for grammar libraries.
2a84ab905c Handle point in last file-name component in minibuffer co...
05f25238b7 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
4bc043ff45 Avoid asking redundant question in emacsbug.el
2eadf328d0 * test/infra/Dockerfile.emba (emacs-base): Don't install ...
583ba1db7e typescript-ts-mode: Add a rule for function_signature

# Conflicts:
#	etc/NEWS
#	lisp/minibuffer.el
This commit is contained in:
Eli Zaretskii 2023-06-10 06:42:43 -04:00
commit acfd261a61
21 changed files with 179 additions and 64 deletions

View file

@ -82,7 +82,7 @@ done
# SKIP-BRANCH 58cc931e92ece70c3e64131ee12a799d65409100
## The list below is the exhaustive list of all commits between Dec 1
## 2016 and Apr 30 2023 on which building Emacs with the default
## 2016 and Jun 8 2023 on which building Emacs with the default
## options, on a GNU/Linux computer and with GCC, fails. It is
## possible (though unlikely) that building Emacs with non-default
## options, with other compilers, or on other platforms, would succeed
@ -1723,3 +1723,15 @@ $REAL_GIT bisect skip $(cat $0 | grep '^# SKIP-SINGLE ' | sed 's/^# SKIP-SINGLE
# SKIP-SINGLE 9686b015a0d71d08828afb0cfe6e477bbc4909ae
# SKIP-SINGLE 621e732ade0f3dc165498ebde4d55d5aacb05b56
# SKIP-SINGLE 200dbf7d302e659e618f74bde81c7b3ccd795639
# SKIP-SINGLE 03663b8798a06bf18ff1e235ac0fb87870f8fe77
# SKIP-SINGLE 4897c98b6c496801aad2477c289a40a300eee27f
# SKIP-SINGLE e6585e0be2efc3f2eaec7210b036169fbdffa9ce
# SKIP-SINGLE 8ec786349e18068bff39b1387bc4a88d62265e34
# SKIP-SINGLE 0eba9cf65119a68596c4bf3689086a517d51ce72
# SKIP-SINGLE ede3535051a8f3b209b830adcaba9cb1ddf58685
# SKIP-SINGLE 2f94f6de9d64f9fd89284dac171e166e7d721dcd
# SKIP-SINGLE ab5258b19255ebff04df01d6f55888f43c42dcb9
# SKIP-SINGLE dc7acb1aafe9b0b84481ac51a5bd5125d263537e
# SKIP-SINGLE 348e4504c6d5588443809ec28da3c3c693368e16
# SKIP-SINGLE 970f94a2dd8bc4be4d71f1075421093ca6f87d28
# SKIP-SINGLE 6b2c8dc9050c5c0514fa404733ce1d4a37d00e39

View file

@ -854,7 +854,10 @@ that the latter technique might still produce a small number of
@file{*.eln} files if Emacs needs to generate @dfn{trampolines}, which
are used if Lisp primitives are advised or redefined in your Lisp code
that is being natively compiled. @xref{Native-Compilation Variables,
trampolines}.
trampolines}. Alternatively, you can specify that the @file{*.eln}
files are written to a non-default directory using the
@code{startup-redirect-eln-cache} function; @pxref{Native-Compilation
Functions}.
@menu
* Native-Compilation Functions:: Functions to natively-compile Lisp.
@ -977,6 +980,22 @@ the native-compilation support compiled into it. On systems that load
@file{libgccjit} dynamically, it also makes sure that library is
available and can be loaded. Lisp programs that need to know up front
whether native-compilation is available should use this predicate.
@end defun
By default, asynchronous native compilation writes the @file{*.eln}
files it produces to a subdirectory of the first writable directory
specified by the @code{native-comp-eln-load-path} variable
(@pxref{Native-Compilation Variables}). You can change this by using
the following function in your startup files:
@defun startup-redirect-eln-cache cache-directory
This function arranges for the asynchronous native compilation to
write the produced @file{*.eln} files to @var{cache-directory}, which
must be a single directory, a string. It also destructively modifies
@code{native-comp-eln-load-path} such that its first element is
@var{cache-directory}. If @var{cache-directory} is not an absolute
file name, it is interpreted relative to @code{user-emacs-directory}
(@pxref{Init File}).
@end defun
@node Native-Compilation Variables

View file

@ -4518,6 +4518,20 @@ This function used to be called @code{x-color-values},
and that name is still supported as an alias.
@end defun
@defun color-name-to-rgb color &optional frame
This function does the same as @code{color-values}, but it returns
color values as floating-point numbers between 0.0 and 1.0 inclusive.
@end defun
@defun color-dark-p rgb
This function returns non-@code{nil} if the color described by its RGB
triplet @var{rgb} is more readable against white background than
against dark background. The argument @var{rgb} should be a list of
the form @w{@code{(@var{r} @var{g} @var{b})}}, with each component a
floating-point number in the range 0.0 to 1.0 inclusive. You can use
@code{color-name-to-rgb} to convert a color's name to such a list.
@end defun
@node Text Terminal Colors
@section Text Terminal Colors
@cindex colors on text terminals

View file

@ -65,12 +65,13 @@ cloning its Git repository, compile the files "scanner.c" and
"parser.c" (sometimes named "scanner.cc" and "parser.cc") in the "src"
subdirectory of the library's source tree using the C or C++ compiler,
then link these two files into a shared library named
"libtree-sitter-LANG.so", where LANG is the name of the language
supported by the grammar as it is expected by the Emacs major mode
(for example, "c" for 'c-ts-mode', "cpp" for 'c++-ts-mode', "python"
for 'python-ts-mode', etc.). Then place the shared library you've
built in the same directory where you keep the other shared libraries
used by Emacs, or in the "tree-sitter" subdirectory of your
"libtree-sitter-LANG.so" ("libtree-sitter-LANG.dll" on MS-Windows,
"libtree-sitter-LANG.dylib" on macOS), where LANG is the name of the
language supported by the grammar as it is expected by the Emacs major
mode (for example, "c" for 'c-ts-mode', "cpp" for 'c++-ts-mode',
"python" for 'python-ts-mode', etc.). Then place the shared library
you've built in the same directory where you keep the other shared
libraries used by Emacs, or in the "tree-sitter" subdirectory of your
'user-emacs-directory', or in a directory mentioned in the variable
'treesit-extra-load-path'.
@ -79,6 +80,11 @@ Emacs modes you will use, as Emacs loads these libraries only when the
corresponding mode is turned on in some buffer for the first time in
an Emacs session.
We generally recommend to use the latest versions of grammar libraries
available from their sites, as these libraries are in constant
development and occasionally add features and fix important bugs to
follow the advances in the programming languages they support.
+++
** Emacs can be built with built-in support for accessing SQLite databases.
This uses the popular sqlite3 library, and can be disabled by using
@ -129,7 +135,7 @@ use this configuration only if you are running a window system other
than X that's supported by GDK. Running this configuration on X is
known to have problems, such as undesirable frame positioning and
various issues with keyboard input of sequences such as 'C-;' and
'C-S-u'.
'C-S-u'. Running this on WSL is also known to have problems.
Note that, unlike the X build of Emacs, the PGTK build cannot
automatically switch to text-mode interface (thus emulating '-nw') if
@ -220,7 +226,7 @@ ones for the current Emacs version). Note that subdirectories of the
system directory where the "*.eln" files are installed (usually, the
last entry in 'native-comp-eln-load-path') are not deleted.
---
+++
*** New function 'startup-redirect-eln-cache'.
This function can be called in your init files to change the
user-specific directory where Emacs stores the "*.eln" files produced

View file

@ -2750,6 +2750,44 @@ C-r C-t, to toggle whether C-x gets through to Emacs.
* Runtime problems specific to MS-Windows
** Emacs with native compilation crashes/signals errors accessing *.eln files
This is known to be caused by some flavors of Windows anti-virus
software. The problem could manifest itself in several ways:
. Emacs crashes when it tries to load certain *.eln files
. Emacs signals an error when it tries to load some *.eln files,
claiming they are "not GPL compatible"
. Emacs crashes during GC when it calls unload_comp_unit
This was specifically reported to happen with *.eln files in
directories under the C:\Users directory, which is where Emacs on
Windows places the emulated HOME directory, and thus also the
~/.emacs.d/eln-cache directory holding the *.eln files compiled during
Emacs sessions (as opposed to those that came precompiled and were
installed with the rest of Emacs distribution).
If you cannot disable such anti-virus software or switch to another
one, you could use the following workarounds:
. Define the HOME environment variable to point to a directory
outside of the C:\Users tree, then copy/move your ~/.emacs.d
directory to that new home directory.
. Move all the *.eln files from ~/.emacs.d/eln-cache to a directory
out of the C:\Users tree, and customize Emacs to use that
directory for *.eln files. This requires to call the function
startup-redirect-eln-cache in your init file, to force Emacs to
write *.eln files compiled at run time to that directory.
. Delete all *.eln files in your ~/.emacs.d/eln-cache directory, and
then disable run-time native compilation. To disable native
compilation, set the variables native-comp-jit-compilation and
native-comp-enable-subr-trampolines to nil.
. Install Emacs built without native compilation.
With any of the above methods, you'd need to restart Emacs (and
preferably also your Windows system) after making the changes, to have
them take effect.
** Emacs on Windows 9X requires UNICOWS.DLL
If that DLL is not available, Emacs will display an error dialog

View file

@ -2,7 +2,7 @@
;; Copyright (C) 2020-2023 Free Software Foundation, Inc.
;; Author: Andrea Corallo <akrl@sdf.org>
;; Author: Andrea Corallo <acorallo@gnu.org>
;; Keywords: lisp
;; Package: emacs

View file

@ -2,7 +2,7 @@
;; Copyright (C) 2019-2023 Free Software Foundation, Inc.
;; Author: Andrea Corallo <akrl@sdf.org>
;; Author: Andrea Corallo <acorallo@gnu.org>
;; Keywords: lisp
;; Package: emacs
@ -4367,6 +4367,26 @@ last directory in `native-comp-eln-load-path')."
else
collect (byte-compile-file file))))
(defun comp-write-bytecode-file (eln-file)
"After native compilation write the bytecode file for ELN-FILE.
Make sure that eln file is younger than byte-compiled one and
return the filename of this last.
This function can be used only in conjuntion with
`byte+native-compile' `byte-to-native-output-buffer-file' (see
`batch-byte+native-compile')."
(pcase byte-to-native-output-buffer-file
(`(,temp-buffer . ,target-file)
(unwind-protect
(progn
(byte-write-target-file temp-buffer target-file)
;; Touch the .eln in order to have it older than the
;; corresponding .elc.
(when (stringp eln-file)
(set-file-times eln-file)))
(kill-buffer temp-buffer))
target-file)))
;;;###autoload
(defun batch-byte+native-compile ()
"Like `batch-native-compile', but used for bootstrap.
@ -4382,16 +4402,7 @@ variable \"NATIVE_DISABLED\" is set, only byte compile."
(let* ((byte+native-compile t)
(byte-to-native-output-buffer-file nil)
(eln-file (car (batch-native-compile))))
(pcase byte-to-native-output-buffer-file
(`(,temp-buffer . ,target-file)
(unwind-protect
(progn
(byte-write-target-file temp-buffer target-file)
;; Touch the .eln in order to have it older than the
;; corresponding .elc.
(when (stringp eln-file)
(set-file-times eln-file)))
(kill-buffer temp-buffer))))
(comp-write-bytecode-file eln-file)
(setq command-line-args-left (cdr command-line-args-left)))))
;;;###autoload

View file

@ -737,7 +737,7 @@ description file containing a call to `define-package', which
updates `package-alist'."
(dolist (dir (cons package-user-dir package-directory-list))
(when (file-directory-p dir)
(dolist (pkg-dir (directory-files dir t "\\`[^.]" t))
(dolist (pkg-dir (directory-files dir t "\\`[^.]"))
(when (file-directory-p pkg-dir)
(package-load-descriptor pkg-dir))))))
@ -916,22 +916,14 @@ correspond to previously loaded files."
(defun package--get-activatable-pkg (pkg-name)
;; Is "activatable" a word?
(let ((pkg-descs (sort (cdr (assq pkg-name package-alist))
(lambda (p1 p2)
(let ((v1 (package-desc-version p1))
(v2 (package-desc-version p2)))
(or
;; Prefer VC packages.
(package-vc-p p1)
(package-vc-p p2)
;; Prefer builtin packages.
(package-disabled-p p1 v1)
(not (package-disabled-p p2 v2))))))))
(let ((pkg-descs (cdr (assq pkg-name package-alist))))
;; Check if PACKAGE is available in `package-alist'.
(while
(when pkg-descs
(let ((available-version (package-desc-version (car pkg-descs))))
(package-disabled-p pkg-name available-version)))
(or (package-disabled-p pkg-name available-version)
;; Prefer a builtin package.
(package-built-in-p pkg-name available-version))))
(setq pkg-descs (cdr pkg-descs)))
(car pkg-descs)))

View file

@ -674,15 +674,21 @@ variables for a connection profile are defined using
(dolist (profile profiles)
(unless (assq profile connection-local-profile-alist)
(error "No such connection profile `%s'" (symbol-name profile))))
(let* ((criteria (connection-local-normalize-criteria criteria))
;; Avoid saving the changed user option to file unless triggered
;; explicitly by user. This workaround can be removed once there is
;; a solution for bug#63891.
(let* ((saved-value (get 'connection-local-criteria-alist 'saved-value))
(criteria (connection-local-normalize-criteria criteria))
(slot (assoc criteria connection-local-criteria-alist)))
(if slot
(setcdr slot (delete-dups (append (cdr slot) profiles)))
(setq connection-local-criteria-alist
(cons (cons criteria (delete-dups profiles))
connection-local-criteria-alist))))
(custom-set-variables
`(connection-local-criteria-alist ',connection-local-criteria-alist now)))
connection-local-criteria-alist)))
(custom-set-variables
`(connection-local-criteria-alist ',connection-local-criteria-alist now))
(unless saved-value
(put 'connection-local-criteria-alist 'saved-value nil))))
(defsubst connection-local-get-profile-variables (profile)
"Return the connection-local variable list for PROFILE."
@ -701,9 +707,15 @@ connection profile using `connection-local-set-profiles'. Then
variables are set in the server's process buffer according to the
VARIABLES list of the connection profile. The list is processed
in order."
(setf (alist-get profile connection-local-profile-alist) variables)
(custom-set-variables
`(connection-local-profile-alist ',connection-local-profile-alist now)))
;; Avoid saving the changed user option to file unless triggered
;; explicitly by user. This workaround can be removed once there is
;; a solution for bug#63891.
(let ((saved-value (get 'connection-local-profile-alist 'saved-value)))
(setf (alist-get profile connection-local-profile-alist) variables)
(custom-set-variables
`(connection-local-profile-alist ',connection-local-profile-alist now))
(unless saved-value
(put 'connection-local-profile-alist 'saved-value nil))))
;;;###autoload
(defun connection-local-update-profile-variables (profile variables)

View file

@ -455,12 +455,16 @@ and send the mail again%s."
(setq send-mail-function (sendmail-query-user-about-smtp))
(when (derived-mode-p 'message-mode)
(setq message-send-mail-function (message-default-send-mail-function))
(add-hook 'message-sent-hook
(lambda ()
(when (y-or-n-p "Save this mail sending choice?")
(customize-save-variable 'send-mail-function
send-mail-function)))
nil t)))
;; Don't ask the question below if we are going to ignore it in
;; 'customize-save-variable' anyway.
(unless (or (null user-init-file)
(and (null custom-file) init-file-had-error))
(add-hook 'message-sent-hook
(lambda ()
(when (y-or-n-p "Save this mail sending choice?")
(customize-save-variable 'send-mail-function
send-mail-function)))
nil t))))
(or report-emacs-bug-no-confirmation
;; mailclient.el does not need a valid From
(eq send-mail-function 'mailclient-send-it)

View file

@ -2384,9 +2384,11 @@ These include:
;; If there are no completions, or if the current input is already
;; the sole completion, then hide (previous&stale) completions.
(minibuffer-hide-completions)
(ding)
(completion--message
(if completions "Sole completion" "No completions")))
(if completions
(completion--message "Sole completion")
(unless completion-fail-discreetly
(ding)
(completion--message "No match"))))
(let* ((last (last completions))
(base-size (or (cdr last) 0))
@ -4504,7 +4506,7 @@ of `completion-no-auto-exit'.
If NO-QUIT is non-nil, insert the completion at point to the
minibuffer, but don't quit the completions window."
(interactive "P")
(with-minibuffer-completions-window
(with-minibuffer-completions-window
(let ((completion-use-base-affixes t))
(choose-completion nil no-exit no-quit))))

View file

@ -215,6 +215,8 @@ All commands in `lisp-mode-shared-map' are inherited by this map."
(load (byte-compile-dest-file buffer-file-name)))
(declare-function native-compile "comp")
(declare-function comp-write-bytecode-file "comp")
(defun emacs-lisp-native-compile-and-load ()
"Native-compile synchronously the current file (if it has changed).
Load the compiled code when finished.
@ -224,8 +226,10 @@ Use `emacs-lisp-byte-compile-and-load' in combination with
native compilation."
(interactive nil emacs-lisp-mode)
(emacs-lisp--before-compile-buffer)
(when-let ((out (native-compile buffer-file-name)))
(load out)))
(let ((byte+native-compile t)
(byte-to-native-output-buffer-file nil))
(when-let ((eln (native-compile buffer-file-name)))
(load (file-name-sans-extension (comp-write-bytecode-file eln))))))
(defun emacs-lisp-macroexpand ()
"Macroexpand the form after point.

View file

@ -128,7 +128,7 @@ Argument LANGUAGE is either `typescript' or `tsx'."
"case" "catch" "class" "const" "continue" "debugger"
"declare" "default" "delete" "do" "else" "enum"
"export" "extends" "finally" "for" "from" "function"
"get" "if" "implements" "import" "in" "instanceof" "interface" "is"
"get" "if" "implements" "import" "in" "instanceof" "interface" "is" "infer"
"keyof" "let" "namespace" "new" "of" "private" "protected"
"public" "readonly" "return" "set" "static" "switch"
"target" "throw" "try" "type" "typeof" "var" "void"
@ -173,9 +173,10 @@ Argument LANGUAGE is either `typescript' or `tsx'."
:feature 'declaration
`((function
name: (identifier) @font-lock-function-name-face)
(function_declaration
name: (identifier) @font-lock-function-name-face)
(function_signature
name: (identifier) @font-lock-function-name-face)
(method_definition
name: (property_identifier) @font-lock-function-name-face)

View file

@ -1,7 +1,7 @@
/* Compile Emacs Lisp into native code.
Copyright (C) 2019-2023 Free Software Foundation, Inc.
Author: Andrea Corallo <akrl@sdf.org>
Author: Andrea Corallo <acorallo@gnu.org>
This file is part of GNU Emacs.

View file

@ -15367,7 +15367,7 @@ redisplay_tool_bar (struct frame *f)
0, 0, 0, STRING_MULTIBYTE (f->desired_tool_bar_string));
/* FIXME: This should be controlled by a user option. But it
doesn't make sense to have an R2L tool bar if the menu bar cannot
be drawn also R2L, and making the menu bar R2L is tricky due
be drawn also R2L, and making the menu bar R2L is tricky due to
toolkit-specific code that implements it. If an R2L tool bar is
ever supported, display_tool_bar_line should also be augmented to
call unproduce_glyphs like display_line and display_string

View file

@ -29,7 +29,7 @@ FROM debian:bullseye as emacs-base
RUN apt-get update && \
apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \
libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev \
libdbus-1-dev libacl1-dev acl git texinfo gawk gdb \
libdbus-1-dev libacl1-dev acl git texinfo gdb \
&& rm -rf /var/lib/apt/lists/*
FROM emacs-base as emacs-inotify

View file

@ -2,7 +2,7 @@
;; Copyright (C) 2020-2023 Free Software Foundation, Inc.
;; Author: Andrea Corallo <akrl@sdf.org>
;; Author: Andrea Corallo <acorallo@gnu.org>
;; This file is part of GNU Emacs.

View file

@ -2,7 +2,7 @@
;; Copyright (C) 2020-2023 Free Software Foundation, Inc.
;; Author: Andrea Corallo <akrl@sdf.org>
;; Author: Andrea Corallo <acorallo@gnu.org>
;; This file is part of GNU Emacs.

View file

@ -2,7 +2,7 @@
;; Copyright (C) 2019-2023 Free Software Foundation, Inc.
;; Author: Andrea Corallo <akrl@sdf.org>
;; Author: Andrea Corallo <acorallo@gnu.org>
;; This file is part of GNU Emacs.

View file

@ -2,7 +2,7 @@
;; Copyright (C) 2020-2023 Free Software Foundation, Inc.
;; Author: Andrea Corallo <akrl@sdf.org>
;; Author: Andrea Corallo <acorallo@gnu.org>
;; This file is part of GNU Emacs.

View file

@ -2,7 +2,7 @@
;; Copyright (C) 2019-2023 Free Software Foundation, Inc.
;; Author: Andrea Corallo <akrl@sdf.org>
;; Author: Andrea Corallo <acorallo@gnu.org>
;; This file is part of GNU Emacs.