Eli Zaretskii [Sat, 18 May 2024 09:15:21 +0000 (12:15 +0300)]
Document :box attribute caveats when used on display strings
* doc/lispref/display.texi (Replacing Specs, Face Attributes):
Mention special considerations when a display string has a
':box' face attribute identical to the surrounding buffer text.
Suggested by JD Smith <jdtsmith@gmail.com>. (Bug#70637)
Joost Kremers [Tue, 7 May 2024 09:52:27 +0000 (11:52 +0200)]
Make 'vtable-insert-object' more versatile
* lisp/emacs-lisp/vtable.el (vtable-insert-object): Rename
argument AFTER-OBJECT to LOCATION; allow use of index to
refer to the insertion position; add argument BEFORE.
(Bug#70664).
* etc/NEWS:
* doc/misc/vtable.texi (Interface Functions): Document the
change.
* test/lisp/emacs-lisp/vtable-tests.el
(test-vtable-insert-object): New test.
Eli Zaretskii [Sat, 18 May 2024 06:12:54 +0000 (09:12 +0300)]
Improve documentation of 'movemail'
* doc/emacs/rmail.texi (Movemail): Fix the name of the Mailutils
manual in the printed version. Add index entries. Move the
description of remote mailboxes to...
(Remote Mailboxes): ...here, to avoid duplication.
Dmitry Gutov [Sat, 18 May 2024 00:24:56 +0000 (03:24 +0300)]
Fix project-find-regexp in remote projects
* lisp/progmodes/xref.el (xref--hits-file-prefix):
New variable. Something to prepend to each file name (bug#69233).
(xref--convert-hits): Use it to also store the "default directory"
part of the filename conditionally on whether it's remote.
(xref--collect-matches): Use the new variable here.
Dmitry Gutov [Sat, 18 May 2024 00:00:29 +0000 (03:00 +0300)]
xref--group-name-for-display: Undo most of the latest change
* lisp/progmodes/xref.el (xref--group-name-for-display):
Remove the DD-SUFFIX parameter, returning the function more like
to how it was (bug#69233).
(xref--analyze, xref--add-log-current-defun):
Revert the previous change accordingly.
* test/lisp/progmodes/xref-tests.el: Undo the last change.
Po Lu [Fri, 17 May 2024 11:21:05 +0000 (19:21 +0800)]
Port to certain Android environments with no GUI
* configure.ac (USER_FULL_NAME): Define to
android_user_full_name only when a GUI system is being built.
Otherwise, set to pw->pw_gecos or NULL consistently with the
presence of pw->pw_gecos.
* src/editfns.c (Fuser_full_name): Adjust to match. Accept NULL
values from USER_FULL_NAME.
Harald Jörg [Thu, 16 May 2024 20:22:37 +0000 (22:22 +0200)]
; cperl-mode.el: prevent Emacs from "freezing" (Bug#70948)
* cperl-mode.el (defconst): Replace the rx expression for
`cperl--basic-identifier-rx' with its actual macro expansion.
This makes it efficient under Emacs 29.3, where the expansion
by rx.el could make Emacs freeze with a crafted Perl source
(Bug#70948).
Harald Jörg [Thu, 16 May 2024 19:55:07 +0000 (21:55 +0200)]
;cperl-mode.el: Allow running under Emacs >=27
I would like to advertise cperl-mode.el from the repository as a
workaround for bug#70948. This can be achieved by safeguarding
the call to derived-mode-add-parents with a version check.
* lisp/progmodes/cperl-mode.el: Call derived-mode-add-parents only
if it is available.
Stefan Monnier [Thu, 16 May 2024 15:01:11 +0000 (11:01 -0400)]
(describe-package-1): Handle (nil . "string") in `:maintainer`
* lisp/emacs-lisp/package.el (describe-package-1): Refine the
check to distinguish the old single-maintainer format from the
new multi-maintainer format. (bug#69712)
Jim Porter [Fri, 10 May 2024 19:22:52 +0000 (12:22 -0700)]
Use "/local:" prefix in Eshell to run local commands when cwd is remote
* lisp/eshell/esh-ext.el (eshell-explicit-remote-commands)
(eshell-explicit-command): Update docstrings.
(eshell--local-prefix): New constant.
(eshell-handle-remote-command): Remove.
(eshell-quoted-file-command): New function...
(eshell-ext-initialize): ... add it as a hook.
(eshell-remote-command): Support running commands on localhost.
(eshell-connection-local-command): Rename from
'eshell-external-command'.
(eshell-external-command): New implementation calling
'eshell-remote-command' or 'eshell-connection-local-command' as
appropriate.
* lisp/progmodes/eglot.el (eglot--managed-mode): Unregister from
track-changes after `eglot-shutdown` since that function may
call `eglot--signal-textDocument/didChange`. (bug#70927)
Stefan Monnier [Wed, 15 May 2024 17:57:11 +0000 (13:57 -0400)]
control.texi: Be a bit more explicit about the behavior of `pcase-let`
* doc/lispref/control.texi (Destructuring with pcase Patterns):
Clarify the kind of "unspecified" behavior that can occur when
the destructing pattern does not match the value.
Stefan Monnier [Tue, 14 May 2024 21:09:39 +0000 (00:09 +0300)]
(xref--collect-matches): Move inhibit-modification-hooks binding down
* lisp/progmodes/xref.el (xref--collect-matches): Move the
inhibit-modification-hooks binding a little down (bug#53749).
(xref--show-common-initialize): Add sharp-quoting.
Robert Pluim [Fri, 19 Apr 2024 13:14:11 +0000 (15:14 +0200)]
Document 'use-default-font-for-symbols' more
"why does my set-fontset-font call not work for symbols" is a common
question, and it's because 'use-default-font-for-symbols' is not
discoverable enough.
* doc/emacs/mule.texi (Modifying Fontsets): Mention it here.
* doc/lispref/display.texi (Fontsets): And here.
* src/fontset.c (Fset_fontset_font): And most importantly here.
Use proper smime-keys entry for S/MIME signatures using OpenSSL
bug#67931
* doc/misc/emacs-mime.texi (MML Definition):
* lisp/gnus/mml.el (mml-parse-1): Add chainfile parameter to sign tags.
* lisp/gnus/mml-smime.el (mml-smime-openssl-sign-query): Include the
additional certificates from smime-keys in MML tag generation as
chainfile parameters.
(mml-smime-openssl-sign): Forward chainfile entries from the parsed tag
alist to smime-sign-buffer.
; * lisp/gnus/smime.el (smime-sign-region): Fix typo in documentation.
; (smime-sign-buffer): Improve documentation to match smime-sign-region.
Po Lu [Tue, 14 May 2024 08:13:58 +0000 (16:13 +0800)]
Port tramp-androidsu to a wider variety of systems
* lisp/net/tramp-androidsu.el
(tramp-androidsu-maybe-open-connection): Search for `su' when
the connection is initiated; replace PATH of inferior shell with
trap-androidsu-remote-path.
(tramp-androidsu-handle-make-process): Do not provide username
if root.
Andrea Corallo [Fri, 3 May 2024 20:21:20 +0000 (22:21 +0200)]
Introduce 'compilation-safety' variable
* lisp/emacs-lisp/bytecomp.el (compilation-safety): New customize.
* src/comp.c (comp_t): Add func_safety.
(emit_call_with_type_hint, emit_call2_with_type_hint): Make use of.
(compile_function): Set 'comp.func_safety'.
Avoid resizing mutation in subst-char-in-string, take two
This time we take care to preserve properties, and add a test.
* lisp/subr.el (subst-char-in-string):
Use string-replace to avoid resizing mutation and O(n^2) time.
* test/lisp/subr-tests.el (subr--subst-char-in-string): New test.
Juri Linkov [Mon, 13 May 2024 06:59:07 +0000 (09:59 +0300)]
* lisp/imenu.el: Support more values for imenu-flatten (bug#70846)
(imenu-flatten): Change type boolean to choice
of more values for prefix/suffix section names.
(imenu--completion-buffer): Add :annotation-function if
'imenu-flatten' is 'annotation'.
(imenu--flatten-index-alist): Put property 'imenu-section' if
'imenu-flatten' is 'annotation'.
Po Lu [Mon, 13 May 2024 06:40:15 +0000 (14:40 +0800)]
Communicate frame titles to the window manager on Android
* java/org/gnu/emacs/EmacsActivity.java (detachWindow)
(attachWindow): Call updateWmName.
(updateWmName): New function; transfer wm name from the window
attached to the task's description.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow)
<wmName>: New field.
(setWmName): New function.
* src/android.c (android_init_emacs_window): Link to new
function.
(android_set_wm_name): New function.
* src/androidfns.c (android_set_name_internal, android_set_name)
(android_implicitly_set_name, android_explicitly_set_name)
(android_set_title): Port from X.
Dmitry Gutov [Sun, 12 May 2024 17:42:08 +0000 (20:42 +0300)]
Fix 'C-u C-x p g' globally and 'A' in dired-mode
* lisp/progmodes/project.el (project-find-regexp): Ensure the
DEFAULT-DIRECTORY is set correctly for the 'C-u' case (bug#70888).
* lisp/progmodes/project.el (project--files-in-directory):
Ensure that the DIR argument ends with a slash --
'dired-do-find-regexp' passes it differently, for example.
* lisp/progmodes/xref.el (xref--group-name-for-display): Ensure
the project-relative and absolute display modes work well for
groups with "relative" file names.
(xref--analyze, xref--add-log-current-defun): Change accordingly.
* test/lisp/progmodes/project-tests.el
(project-find-regexp-with-prefix): New test.
* lisp/net/tramp-compat.el (tramp-nspawn): Warn, if that package is used.
* lisp/net/tramp-container.el (tramp-nspawn-program): New defcustom.
(tramp-nspawn-method): New defconst.
(tramp-nspawn--completion-function, tramp-enable-nspawn-method):
New defuns.
Dmitry Gutov [Sun, 12 May 2024 02:57:10 +0000 (05:57 +0300)]
completion--replace: Fix completion cycling
* lisp/minibuffer.el (completion--replace):
Don't "insert before markers" after all because in some cases
(https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg00701.html)
- like cycling - BEG can be denoted by a marker as well.
(minibuffer-completion-help): Make FIELD-END simply a fixnum. And
adjust its value manually inside the local
completion-list-insert-choice-function (bug#48356).
* lisp/emacs-lisp/cl-seq.el (cl-sort):
Don't use string mutation when sorting the characters in a string.
This avoids O(n^2) run time and makes it future-safe.
Po Lu [Sun, 12 May 2024 12:24:19 +0000 (20:24 +0800)]
Properly deinitialize directory cursors on closedir
* src/androidvfs.c (android_saf_tree_closedir): Call
cursor.close, for deleting the local reference to enable its
garbage collection is not sufficient to release all related
resources.
Po Lu [Sun, 12 May 2024 07:46:38 +0000 (15:46 +0800)]
Additional changes to processing of Num Lock on Android
* java/org/gnu/emacs/EmacsView.java (onKeyDown, onKeyMultiple)
(onKeyDown): Disregard Num and Scroll Lock keys, and return
value of window functions to the system.
* java/org/gnu/emacs/EmacsWindow.java (eventModifiers): Return
normalized meta state, not only those bits the system considers
modifiers.
(onKeyDown, onKeyUp): Ignore numpad keys to which no base
characters are assigned, so that the system may generate the
proper action keys instead.
Po Lu [Sun, 12 May 2024 06:13:27 +0000 (14:13 +0800)]
Correct earlier changes to processing of Num Lock on Android
* java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp):
Cease stripping META_NUM_LOCK_ON and META_SCROLL_LOCK_ON from
meta masks reported to getUnicodeChar.
Po Lu [Sun, 12 May 2024 05:27:43 +0000 (13:27 +0800)]
Pacify warnings in gmalloc.c
* src/gmalloc.c (__malloc_initialize_hook): Also declare in
advance on Glibc 2.24 and later.
(__after_morecore_hook, __morecore): Likewise on Glibc 2.34 and
later.
Paul Eggert [Sat, 4 May 2024 17:08:48 +0000 (10:08 -0700)]
Pacify gcc -Wmissing-variable-declarations
This is a new warning diagnostic in GCC 14.
* lib-src/etags.c (mercury_heuristics_ratio):
* src/pgtkselect.c, src/xselect.c (selection_request_stack):
* src/xselect.c (outstanding_transfers):
* src/xterm.c (pending_selection_requests)
(x_dnd_waiting_for_motif_finish_display):
Now static.
* lib-src/make-docfile.c (close_emacs_globals):
Arrange for lispsym to be declared with extern first,
when compiling lread.c.
* src/alloc.c (gdb_make_enums_visible) [__GNUC__]:
* src/emacs.c (RCS_Id):
* src/keyboard.c (stop_character):
* src/print.c (print_output_debug_flag):
Now declared with extern first.
* src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN) [MAIN_PROGRAM]:
Arrange for ID to be declared extern first.
* src/lisp.h (garbage_collection_inhibited):
* src/xterm.h (x_frame_parm_handlers):
Declare here, so that its interface is properly checked. Other decls
removed.
Paul Eggert [Sat, 4 May 2024 16:55:27 +0000 (09:55 -0700)]
Adjust to recent Gnulib changes
* admin/merge-gnulib: Also remove the new Gnulib file
m4/off64_t.m4, as Emacs doesn’t need off64_t.
* configure.ac (gl_TYPE_OFF64_T): Define a nearly no-op.
kobarity [Thu, 9 May 2024 15:39:10 +0000 (00:39 +0900)]
Support Python 3 in 'package-test-update-archives-async'
* test/lisp/emacs-lisp/package-resources/package-test-server.py:
Support Python 3.
* test/lisp/emacs-lisp/package-tests.el
(package-test-update-archives-async): Search for an executable
named "python", "python3", or "python2". (Bug#70722)
Eli Zaretskii [Sat, 11 May 2024 09:16:48 +0000 (12:16 +0300)]
Fix Rmail summary by thread
* lisp/mail/rmailsum.el (rmail-summary-by-thread): Use value of
'rmail-total-messages' local to 'rmail-buffer'. Patch by Andrea
Monaco <andrea.monaco@autistici.org>.