emacs.git
19 months ago; Fix whitespace
Michael Albinus [Tue, 14 May 2024 08:18:04 +0000 (10:18 +0200)]
; Fix whitespace

19 months ago; * etc/NEWS: Fix wording, again.
Eli Zaretskii [Tue, 14 May 2024 07:53:40 +0000 (10:53 +0300)]
; * etc/NEWS: Fix wording, again.

19 months ago; * etc/NEWS: Fix wording.
Eli Zaretskii [Tue, 14 May 2024 07:52:17 +0000 (10:52 +0300)]
; * etc/NEWS: Fix wording.

19 months agoAdd documentation about sorting Imenu completions (bug#70846)
Juri Linkov [Tue, 14 May 2024 06:55:52 +0000 (09:55 +0300)]
Add documentation about sorting Imenu completions (bug#70846)

* doc/emacs/programs.texi (Imenu): Document how Imenu completions
can be sorted.

* lisp/imenu.el (imenu-sort-function): Explain in the docstring
how to sort Imenu completions.

19 months ago; Fix documentation of recently-installed changes
Eli Zaretskii [Tue, 14 May 2024 05:51:13 +0000 (08:51 +0300)]
; Fix documentation of recently-installed changes

* lisp/emacs-lisp/bytecomp.el (compilation-safety): Doc fix.

* etc/NEWS: Fix wording of the 'compilation-safety' entry.

* doc/lispref/functions.texi (Declare Form): Fix cross-reference
and wording.
* doc/lispref/compile.texi (Native-Compilation Variables): Add the
missing @anchor.  Fix wording.

19 months agoFix failure of `restart-emacs' to restart Emacs on Android
Po Lu [Tue, 14 May 2024 02:16:18 +0000 (10:16 +0800)]
Fix failure of `restart-emacs' to restart Emacs on Android

* src/emacs.c (Fkill_emacs) [HAVE_ANDROID && !ANDROID_STUBIFY]:
Arrange to terminate Emacs upon receipt of a bus error.

19 months ago* etc/NEWS (Safety compilation parameter): Add entry.
Andrea Corallo [Tue, 7 May 2024 08:19:22 +0000 (10:19 +0200)]
* etc/NEWS (Safety compilation parameter): Add entry.

19 months agoAdd some 'compilation-safety' documentation
Andrea Corallo [Sat, 4 May 2024 06:55:56 +0000 (08:55 +0200)]
Add some 'compilation-safety' documentation

* lisp/emacs-lisp/bytecomp.el (compilation-safety): Better doc.
* doc/lispref/functions.texi (Declare Form): Add 'safety'.
* doc/lispref/compile.texi (Native-Compilation Variables): Add
'compilation-safety'.

19 months agoAdd 'safety' function declaration
Andrea Corallo [Fri, 3 May 2024 20:45:04 +0000 (22:45 +0200)]
Add 'safety' function declaration

* lisp/emacs-lisp/comp.el (comp-known-predicates): Use
'comp-func-safety'.
(comp-ctxt, comp-mvar-type-hint-match-p): New 'safety' slot.
(comp-c-func-name): New function.
(comp--spill-lap-function, comp--intern-func-in-ctxt): Update.
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Spill safety.
* lisp/emacs-lisp/byte-run.el (byte-run--set-completion): New alias.
(defun-declarations-alist): Update.

19 months agoIntroduce 'compilation-safety' variable
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'.

19 months ago* lisp/emacs-lisp/comp.el (comp--get-function-cstr): Fix it.
Andrea Corallo [Mon, 13 May 2024 14:41:25 +0000 (16:41 +0200)]
* lisp/emacs-lisp/comp.el (comp--get-function-cstr): Fix it.

19 months ago; Fix the xref--group-name-for-display tests
Dmitry Gutov [Mon, 13 May 2024 13:16:22 +0000 (16:16 +0300)]
; Fix the xref--group-name-for-display tests

19 months agoAvoid resizing mutation in subst-char-in-string, take two
Mattias Engdegård [Mon, 13 May 2024 08:44:05 +0000 (10:44 +0200)]
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.

19 months agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Mon, 13 May 2024 08:31:45 +0000 (10:31 +0200)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

19 months ago* doc/misc/tramp.texi: Adapt some markups.
Michael Albinus [Mon, 13 May 2024 08:31:13 +0000 (10:31 +0200)]
* doc/misc/tramp.texi: Adapt some markups.

19 months ago; Tweak last docstring addition in lisp/imenu.el.
Basil L. Contovounesios [Mon, 13 May 2024 07:58:50 +0000 (09:58 +0200)]
; Tweak last docstring addition in lisp/imenu.el.

19 months agoFix bug#70900
Michael Albinus [Mon, 13 May 2024 07:23:58 +0000 (09:23 +0200)]
Fix bug#70900

* lisp/net/tramp.el (tramp-handle-unlock-file): Be quiet if user
isn't interested in lock files.  Bug#70900

19 months agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Mon, 13 May 2024 07:23:32 +0000 (09:23 +0200)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

19 months ago* lisp/imenu.el: Support more values for imenu-flatten (bug#70846)
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'.

19 months agoCommunicate frame titles to the window manager on Android
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/android.h (struct android_emacs_service): Delete unused
entries.

* src/androidfns.c (android_set_name_internal, android_set_name)
(android_implicitly_set_name, android_explicitly_set_name)
(android_set_title): Port from X.

* src/androidterm.c (android_term_init): Compute default frame
title.

* src/androidterm.h (struct android_display_info) <x_id_name>:
New field.

19 months agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Mon, 13 May 2024 05:24:30 +0000 (07:24 +0200)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

19 months agoruby-rubocop-use-bundler: New user option
Dmitry Gutov [Mon, 13 May 2024 02:36:28 +0000 (05:36 +0300)]
ruby-rubocop-use-bundler: New user option

* lisp/progmodes/ruby-mode.el (ruby-rubocop-use-bundler):
New user option.
(ruby-flymake-rubocop--use-bundler-p): Use it.

* etc/NEWS: Mention it.

19 months ago; * src/epaths.in: Declare and use android_game_path.
Po Lu [Mon, 13 May 2024 00:26:04 +0000 (08:26 +0800)]
; * src/epaths.in: Declare and use android_game_path.

19 months agoComplete pacification of build warnings on Android
Po Lu [Mon, 13 May 2024 00:25:39 +0000 (08:25 +0800)]
Complete pacification of build warnings on Android

* build-aux/makecounter.sh: Introduce extern declaration of
emacs_shortlisp_counter.

* src/android.c (android_class_path): Declare static.

* src/androidfont.c (font_driver_class, font_spec_class)
(integer_class, font_metrics_class, font_object_class): Declare
static.

* src/androidterm.c (android_frame_parm_handlers): Move
declaration...

* src/androidterm.h (android_frame_parm_handlers): ... here.

19 months agoFix 'C-u C-x p g' globally and 'A' in dired-mode
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.

19 months agoAdd Tramp method "nspawn"
Michael Albinus [Sun, 12 May 2024 17:40:08 +0000 (19:40 +0200)]
Add Tramp method "nspawn"

* doc/misc/tramp.texi: Adapt some markups.
(Inline methods) <nspawn>: Add.
(Default Host): Mention default host for "nspawn".
(Customizing Methods): Remove tramp-nspawn.
(Password handling): Add "nspawn".

* etc/NEWS: New Tramp method "nspawn".

* 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.

* lisp/net/tramp.el (tramp-local-host-regexp): Add OpenSUSE host names.

19 months agocompletion--replace: Fix completion cycling
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).

19 months agoFix offset of reported conversion regions
Po Lu [Sun, 12 May 2024 13:42:52 +0000 (21:42 +0800)]
Fix offset of reported conversion regions

* src/androidterm.c (request_class, text_class): Pacify new
warning.
(android_update_selection): Don't redundantly subtract 1 from
compose region start.

19 months agoRevert "Avoid resizing mutation in subst-char-in-string"
Mattias Engdegård [Sun, 12 May 2024 13:18:19 +0000 (15:18 +0200)]
Revert "Avoid resizing mutation in subst-char-in-string"

This reverts commit 184d6e8c02345583264b053bb59ae031bb1c5a00.

It wasn't quite correct: the path through `string-replace` would not
preserve text properties in the input string, which broke Gnus.

19 months agoSilence some macOS build warnings
Mattias Engdegård [Sun, 12 May 2024 12:55:55 +0000 (14:55 +0200)]
Silence some macOS build warnings

* src/image.c (native_image_type): Declare static.
* src/keyboard.c (lispy_function_keys): Declare static on NS.
* src/nsmenu.m (context_menu_value):
* src/nsterm.m (ns_frame_parm_handlers): Move extern declarations...
* src/nsterm.h: ...here.
* test/src/emacs-module-resources/mod-test.c: Add extern declaration.

19 months agoSafer and faster string sorting
Mattias Engdegård [Sun, 12 May 2024 09:22:23 +0000 (11:22 +0200)]
Safer and faster string sorting

* 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.

19 months agoProperly deinitialize directory cursors on closedir
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.

19 months agoAdditional changes to processing of Num Lock on Android
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.

19 months agoCorrect earlier changes to processing of Num Lock on Android
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.

19 months ago; Fix a recent change in fns.c
Eli Zaretskii [Sun, 12 May 2024 06:51:51 +0000 (09:51 +0300)]
; Fix a recent change in fns.c

* src/fns.c (value_cmp): Use 'subprocesses', not 'MSDOS', as
conditional for process-related functionalities.

19 months agoPacify warnings in gmalloc.c
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.

19 months ago* oldXMenu/Activate.c (x_menu_grab_keyboard): Declare static.
Po Lu [Sun, 12 May 2024 05:21:09 +0000 (13:21 +0800)]
* oldXMenu/Activate.c (x_menu_grab_keyboard): Declare static.

19 months agoFix the DJGPP build
Po Lu [Sun, 12 May 2024 02:38:26 +0000 (10:38 +0800)]
Fix the DJGPP build

* src/fns.c (value_cmp) [MSDOS]: Consider processes unordered
on DOS.

19 months ago* src/keyboard.c (lispy_function_keys): Define as static on Android.
Po Lu [Sun, 12 May 2024 02:18:02 +0000 (10:18 +0800)]
* src/keyboard.c (lispy_function_keys): Define as static on Android.

19 months ago; Update last change
Po Lu [Sun, 12 May 2024 02:16:56 +0000 (10:16 +0800)]
; Update last change

* msdos/sedlibmk.inp (STDDEF_NOT_IDEMPOTENT): Define to 1.

19 months agoFix the DJGPP build
Po Lu [Sun, 12 May 2024 02:13:41 +0000 (10:13 +0800)]
Fix the DJGPP build

* msdos/sedlibmk.inp (HAVE_STRTOF, NULLPTR_T_NEEDS_STDDEF):
Define to 1.

19 months agoPacify gcc -Wmissing-variable-declarations
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.

19 months agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sat, 11 May 2024 20:16:48 +0000 (13:16 -0700)]
Update from Gnulib by running admin/merge-gnulib

19 months agoAdjust to recent Gnulib changes
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.

19 months ago; * lisp/cus-edit.el (custom-save-all): Remove offensive commentary.
Eli Zaretskii [Sat, 11 May 2024 17:13:17 +0000 (20:13 +0300)]
; * lisp/cus-edit.el (custom-save-all): Remove offensive commentary.

19 months agoFix test of whether to insert lexical-binding cookies in custom files
Po Lu [Sat, 11 May 2024 14:24:23 +0000 (22:24 +0800)]
Fix test of whether to insert lexical-binding cookies in custom files

* lisp/cus-edit.el (custom-save-all): Test whether the buffer is
empty, not whether point is at EOB.

19 months ago; More coding style fixes
Po Lu [Sat, 11 May 2024 13:35:42 +0000 (21:35 +0800)]
; More coding style fixes

* src/sort.c (reverse_sortslice, tim_sort): Correct not-so
egregious misformattings.

19 months ago; Fix coding style in timsort.c
Po Lu [Sat, 11 May 2024 13:34:30 +0000 (21:34 +0800)]
; Fix coding style in timsort.c

* src/sort.c (reverse_slice, sortslice): Fix egregious coding
style inconsistencies.

19 months ago; Fix byte-compilation warnings in lua-ts-mode.el
Eli Zaretskii [Sat, 11 May 2024 10:54:35 +0000 (13:54 +0300)]
; Fix byte-compilation warnings in lua-ts-mode.el

* lisp/progmodes/lua-ts-mode.el (treesit-node-eq)
(treesit-node-prev-sibling): Declare.

19 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 11 May 2024 10:50:56 +0000 (06:50 -0400)]
Merge from origin/emacs-29

0ec9a02a0d5 ; Fix doc strings of two scroll-bar functions.
2f8bccf9d8c ; * doc/emacs/frames.texi (Scroll Bars): Improve formatting.
f9832e80b89 ; * lisp/textmodes/ispell.el (ispell-message): Add commen...
a7d247be90c ; * etc/PROBLEMS: Document macOS problems with Emacs.clr ...
8560ee7b5ca ; * doc/misc/auth.texi (The Unix password store): Fix var...
74c6b59af15 ; Advertise scroll bars some more
3d65d4306b9 Avoid errors in 'image-dired-tag-thumbnail'

19 months agoSupport Python 3 in 'package-test-update-archives-async'
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)

Co-authored-by: Lin Sun <sunlin7@hotmail.com>
19 months agoFix Rmail summary by thread
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>.

19 months ago; * lisp/net/dictionary.el (dictionary-default-strategy): Doc fix.
Eli Zaretskii [Sat, 11 May 2024 08:17:34 +0000 (11:17 +0300)]
; * lisp/net/dictionary.el (dictionary-default-strategy): Doc fix.

19 months agoNew Tramp method "run0"
Michael Albinus [Sat, 11 May 2024 08:03:45 +0000 (10:03 +0200)]
New Tramp method "run0"

* doc/misc/tramp.texi (Quick Start Guide, Inline methods)
(Password handling, Predefined connection information)
(Ad-hoc multi-hops): Add "run0".
(Remote processes): Mention tramp-use-connection-share.

* etc/NEWS: New Tramp method "run0".

* lisp/net/tramp.el (tramp-completion-dissect-file-name):
* lisp/net/tramp-cmds.el (tramp-list-remote-buffers):
* lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
Use `tramp-compat-keep-seq'.

* lisp/net/tramp-cmds.el (tramp-file-name-with-method): Add "run0".

* lisp/net/tramp-sh.el (tramp-enable-run0-method): New defun.
(tramp-sh-handle-expand-file-name): Add "run0".
(tramp-maybe-open-connection): Simplify setting timeout.

19 months agoImprove documentation of p-s-p-scroll-down-page
Po Lu [Sat, 11 May 2024 06:38:54 +0000 (14:38 +0800)]
Improve documentation of p-s-p-scroll-down-page

* lisp/pixel-scroll.el
(pixel-scroll-precision-scroll-down-page): Document unit in
which the height of the window is measured, and what manner of
height applies.  Reported by Eli Zaretskii <eliz@gnu.org>.

19 months agoDelete unused functions
Po Lu [Sat, 11 May 2024 06:34:32 +0000 (14:34 +0800)]
Delete unused functions

* java/org/gnu/emacs/EmacsNative.java (dup, close):

* src/android.c (dup, close): Delete functions no longer
referenced.

19 months ago; Fix doc strings of two scroll-bar functions.
Eli Zaretskii [Sat, 11 May 2024 05:29:22 +0000 (08:29 +0300)]
; Fix doc strings of two scroll-bar functions.

* lisp/scroll-bar.el (toggle-horizontal-scroll-bar): Fix typo and
wording.  (Bug#70864).
(toggle-scroll-bar): Fix wording.

19 months agoUpdate gnus-draft-check-draft-articles to use find-buffer-visiting
Eric Abrahamsen [Fri, 10 May 2024 19:38:57 +0000 (12:38 -0700)]
Update gnus-draft-check-draft-articles to use find-buffer-visiting

* lisp/gnus/gnus-draft.el (gnus-draft-check-draft-articles): Don't loop
through all the buffers; this removes the need for the `file-remote-p'
check. Also give the user some nicer feedback about what's going on.

19 months agoRemove extra message-set-auto-save-file-name call in Gnus drafts
Eric Abrahamsen [Fri, 10 May 2024 15:49:57 +0000 (08:49 -0700)]
Remove extra message-set-auto-save-file-name call in Gnus drafts

Bug#70579

* lisp/gnus/gnus-draft.el (gnus-draft-setup): This function is already
being called as part of the message-mail -> message-mode call
above. Running it twice results in a jump in assigned article numbers,
and the corresponding active value of the drafts group.

19 months agoSupport customization of sorting order for Imenu completion candidates
Juri Linkov [Fri, 10 May 2024 16:45:21 +0000 (19:45 +0300)]
Support customization of sorting order for Imenu completion candidates

* lisp/imenu.el (imenu--completion-buffer):
Set completion-extra-properties to '(:category imenu).
(imenu--flatten-index-alist): Use imenu--subalist-p to handle
newer format (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...)
as well (bug#70846).

* doc/emacs/misc.texi (DocView Navigation): Fix typo.

19 months ago; Clean up some 'require' and 'declare-function' calls in Eshell
Jim Porter [Fri, 10 May 2024 16:27:30 +0000 (09:27 -0700)]
; Clean up some 'require' and 'declare-function' calls in Eshell

* lisp/eshell/em-ls.el:
* lisp/eshell/esh-cmd.el:
* lisp/eshell/esh-mode.el:
* lisp/eshell/esh-ext.el: Remove superfluous 'declare-function' calls.

* lisp/eshell/esh-proc.el (pcomplete): Require this explicitly instead
of transitively.

19 months agoAvoid resizing mutation in subst-char-in-string
Mattias Engdegård [Fri, 10 May 2024 08:35:39 +0000 (10:35 +0200)]
Avoid resizing mutation in subst-char-in-string

* lisp/subr.el (subst-char-in-string):
Use string-replace to avoid resizing mutation and O(n^2) time.

19 months ago; * etc/NEWS: Announce user-level change in dictionary.el.
Eli Zaretskii [Fri, 10 May 2024 12:59:24 +0000 (15:59 +0300)]
; * etc/NEWS: Announce user-level change in dictionary.el.

19 months agoFix 'dictionary-tooltip-mode'
Eli Zaretskii [Fri, 10 May 2024 12:56:30 +0000 (15:56 +0300)]
Fix 'dictionary-tooltip-mode'

* lisp/tooltip.el (tooltip-event-buffer): Make sure 'posn-window'
returns a window before calling 'window-buffer'.

* lisp/net/dictionary.el (dictionary-default-dictionary)
(dictionary-tooltip-dictionary): Doc fixes.
(dictionary-tooltip-dictionary): Change default value to t, which
means the same dictionary as 'dictionary-default-dictionary'.
(dictionary-do-search): If NOMATCHING is non-nil, do not insert
anything into the current buffer, as that is unexpected when
showing definitions in tooltips.
(dictionary-word-at-mouse-event): Be defensive about the values
returned by 'tooltip-event-buffer' and 'posn-point': they can be
unexpected when the mouse pointer is on the tool bar or mode line
etc.
(dictionary-display-tooltip): Ignore errors in this function.
(dictionary-tooltip-mode): Ignore mouse-movement events on tool
bar and tab-bar.
(dictionary-dictionaries): Decode the server response to present
dictionaries in human-readable form.  Document in the doc string
the format of the return value.

19 months agoImplement dots and dashes on MS-Windows
Po Lu [Fri, 10 May 2024 08:44:35 +0000 (16:44 +0800)]
Implement dots and dashes on MS-Windows

* src/haikuterm.c (haiku_draw_dash): Correct whitespace error.

* src/w32term.c (w32_draw_dash, w32_fill_underline)
(w32_draw_glyph_string): Port display of dash and dot underline
styles from X.

19 months ago* lisp/imenu.el (imenu-flatten): New defcustom (bug#70846).
Juri Linkov [Fri, 10 May 2024 06:52:09 +0000 (09:52 +0300)]
* lisp/imenu.el (imenu-flatten): New defcustom (bug#70846).

(imenu-level-separator): Adjust the docstring.
(imenu--flatten-index-alist): New function revived
from the initial implementation of this package.
(imenu-choose-buffer-index): Use imenu--flatten-index-alist
when imenu-flatten is non-nil.
(imenu-buffer-menubar): Remove obsolete variable.

* doc/emacs/programs.texi (Imenu): Document imenu-flatten.

19 months ago; * doc/emacs/frames.texi (Scroll Bars): Improve formatting.
Eli Zaretskii [Fri, 10 May 2024 05:52:33 +0000 (08:52 +0300)]
; * doc/emacs/frames.texi (Scroll Bars): Improve formatting.

19 months ago; Remove unnecessary defvars defined in a file we already 'require'
Jim Porter [Fri, 10 May 2024 05:02:00 +0000 (22:02 -0700)]
; Remove unnecessary defvars defined in a file we already 'require'

* lisp/eshell/esh-cmd.el (eshell-output-handle, eshell-error-handle):
Remove superfluous declarations.

19 months agoRemove redundant encoding of strings in androidvfs.c
Po Lu [Fri, 10 May 2024 03:42:37 +0000 (11:42 +0800)]
Remove redundant encoding of strings in androidvfs.c

* java/org/gnu/emacs/EmacsService.java (getDocumentTrees):
Accept PROVIDER as a String.

* src/android.c (android_init_emacs_service):

* src/androidvfs.c (android_saf_root_opendir): Adjust to match.

19 months agoDocument a problem with Microsoft SwiftKey
Po Lu [Fri, 10 May 2024 03:32:42 +0000 (11:32 +0800)]
Document a problem with Microsoft SwiftKey

* etc/PROBLEMS (Runtime problems specific to Android): Document
incompatibility with Microsoft Swiftkey.

19 months agoFix bug#70856
Po Lu [Fri, 10 May 2024 03:01:29 +0000 (11:01 +0800)]
Fix bug#70856

* lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down)
(pixel-scroll-precision-scroll-up): Apply finer threshold for
the minimum unit of scrolling.
(pixel-scroll-precision-scroll-down-page): Document true
restrictions on DELTA.  (bug#70856)

19 months agoFix earlier change to content URI resolution on Android
Po Lu [Fri, 10 May 2024 01:05:54 +0000 (09:05 +0800)]
Fix earlier change to content URI resolution on Android

* java/org/gnu/emacs/EmacsService.java (openContentUri): Return
-1 if fd be NULL.

* src/androidvfs.c (android_authority_open): Detect
SecurityException and suchlike.
(android_vfs_init): Initialize exception classes on Android 4.4.

19 months agoDon't limit gnus thread searches to a single message
Andrew G Cohen [Sun, 7 Apr 2024 23:36:17 +0000 (07:36 +0800)]
Don't limit gnus thread searches to a single message

* lisp/gnus/gnus-search.el (gnus-search-single-p): Searches for a
single message id finish after finding this one message; thread searches
continue until all messages are found.

19 months agoImprove doc-type determination in doc-view
Andrew G Cohen [Fri, 6 Oct 2023 06:34:28 +0000 (14:34 +0800)]
Improve doc-type determination in doc-view

* lisp/doc-view.el (doc-view-set-doc-type): If buffer-file-name is not
set try the buffer-name to identify the doc type.

19 months agoFind correct parent for articles in gnus
Andrew G Cohen [Sat, 27 Apr 2024 01:10:44 +0000 (09:10 +0800)]
Find correct parent for articles in gnus

* lisp/gnus/gnus-sum.el (gnus-summary-refer-parent-article): When an
article's headers have been altered, use the altered headers to find the
parent.

19 months ago; Provide documentation example for gnus-alter-header-function
Andrew G Cohen [Thu, 9 May 2024 08:44:21 +0000 (16:44 +0800)]
; Provide documentation example for gnus-alter-header-function

* doc/misc/gnus.texi (Low-Level Threading): Provide an example of using
gnus-alter-header-function to remove unwanted items in References
header.

19 months ago; * lisp/mail/smtpmail.el (smtpmail-try-auth-method): quote symbol.
Andrew G Cohen [Fri, 10 May 2024 00:01:15 +0000 (08:01 +0800)]
; * lisp/mail/smtpmail.el (smtpmail-try-auth-method): quote symbol.

19 months ago; Fix an edge case with Eshell globs when the directory part is quoted
Jim Porter [Fri, 10 May 2024 00:15:14 +0000 (17:15 -0700)]
; Fix an edge case with Eshell globs when the directory part is quoted

* lisp/eshell/esh-util.el (eshell-split-filename): Escaping shouldn't
matter for splitting the name (no other shells handle it like this).

* test/lisp/eshell/em-glob-tests.el
(em-glob-test/convert/quoted-start-directory): New test.

19 months ago; Reference the xoauth2 method in nnimap-authenticator docstring
Jakub Ječmínek [Tue, 19 Mar 2024 20:34:57 +0000 (21:34 +0100)]
; Reference the xoauth2 method in nnimap-authenticator docstring

* lisp/gnus/nnimap.el (nnimap-authenticator): Update variable
documentation to include xoauth2 method.

19 months agoImprove static checking when using upcoming GCC 13.3
Paul Eggert [Thu, 9 May 2024 19:24:18 +0000 (12:24 -0700)]
Improve static checking when using upcoming GCC 13.3

* src/lisp.h: In GCC 13.3 and later, do not ignore
-Wanalyzer-allocation-size.
* src/marker.c: In GCC 13.3 and later, do not ignore
-Wanalyzer-deref-before-check.

19 months ago; * lisp/textmodes/ispell.el (ispell-message): Add commentary.
Eli Zaretskii [Thu, 9 May 2024 17:44:52 +0000 (20:44 +0300)]
; * lisp/textmodes/ispell.el (ispell-message): Add commentary.

19 months ago; Fix example code in nnfeed
Daniel Semyonov [Mon, 29 Apr 2024 20:40:50 +0000 (23:40 +0300)]
; Fix example code in nnfeed

* lisp/gnus/nnfeed.el: Backend declaration example was incorrect.

19 months agoTramp code cleanup
Michael Albinus [Thu, 9 May 2024 08:38:37 +0000 (10:38 +0200)]
Tramp code cleanup

* lisp/net/tramp-compat.el (tramp-compat-seq-keep): New defalias.

* lisp/net/tramp.el (tramp-enable-method):
* lisp/net/tramp-adb.el (tramp-adb-parse-device-names):
* lisp/net/tramp-cache.el (tramp-list-connections):
* lisp/net/tramp-cmds.el (tramp-bug, tramp-append-tramp-buffers):
* lisp/net/tramp-container.el (tramp-container--completion-function)
(tramp-toolbox--completion-function)
(tramp-flatpak--completion-function)
(tramp-apptainer--completion-function):
* lisp/net/tramp-rclone.el (tramp-rclone-parse-device-names): Use it.

19 months agoFix 'srecode-all-template-hash' always returning nil
Charalampos Mitrodimas [Sat, 4 May 2024 19:45:15 +0000 (22:45 +0300)]
Fix 'srecode-all-template-hash' always returning nil

The issue was that the function always returned nil because
the closing parentheses were in the wrong position.  This
meant that the function couldn't give back the data it was
supposed to, making the whole srecode system not work
properly.
By moving the parentheses to the correct place, the function
now returns a hash table with all the templates it finds.
* lisp/cedet/srecode/find.el (srecode-all-template-hash):
Adjusted the position of closing parentheses so that the mhash
variable is returned correctly.  (Bug#70765)

Copyright-paperwork-exempt: yes

19 months ago; Check process in 'python-shell-completion-at-point'
Lin Sun [Wed, 1 May 2024 06:55:31 +0000 (06:55 +0000)]
; Check process in 'python-shell-completion-at-point'

* lisp/progmodes/python.el (python-shell-completion-at-point):
Check the PROCESS argument at the beginning of the function.
(Bug#70707)

19 months agoAdd bitwise assignment operators to 'python--treesit-operators'
Noah Peart [Tue, 30 Apr 2024 10:19:11 +0000 (03:19 -0700)]
Add bitwise assignment operators to 'python--treesit-operators'

* lisp/progmodes/python.el (python--treesit-operators): Add
bitwise assignment operators.  (Bug#70666)

19 months agoIntern additional symbols ahead-of-time
Po Lu [Thu, 9 May 2024 07:02:06 +0000 (15:02 +0800)]
Intern additional symbols ahead-of-time

* src/gnutls.c (Fgnutls_available_p, syms_of_gnutls):

* src/minibuf.c (Fread_buffer, syms_of_minibuf): Define and
intern symbols overlooked in the previous change.

19 months agoReplace calls to intern with a constant string with DEFSYMs
Po Lu [Thu, 9 May 2024 06:58:45 +0000 (14:58 +0800)]
Replace calls to intern with a constant string with DEFSYMs

* src/alloc.c (display_malloc_warning, syms_of_alloc):

* src/buffer.c (Fmake_indirect_buffer, Fbuffer_local_variables)
(Frename_buffer, Fkill_buffer, Fset_buffer_major_mode)
(Fset_buffer_multibyte, syms_of_buffer):

* src/callint.c (read_file_name, Fcall_interactively)
(syms_of_callint):

* src/callproc.c (call_process, create_temp_file)
(syms_of_callproc):

* src/charset.c (Fdefine_charset_internal, syms_of_charset):

* src/cmds.c (internal_self_insert, syms_of_cmds):

* src/coding.c (record_conversion_result)
(Fdefine_coding_system_internal, syms_of_coding):

* src/dbusbind.c (xd_signature, Fdbus_message_internal)
(syms_of_dbusbind):

* src/dispnew.c (init_faces_initial):

* src/doc.c (Fsnarf_documentation, syms_of_doc):

* src/dosfns.c (system_process_attributes, syms_of_dosfns):

* src/emacs.c (init_cmdargs, Fdump_emacs, decode_env_path)
(syms_of_emacs):

* src/eval.c (call_debugger, Fdefvaralias, syms_of_eval):

* src/fileio.c (barf_or_query_if_file_exists)
(Finsert_file_contents, auto_save_error, Fdo_auto_save)
(syms_of_fileio):

* src/filelock.c (lock_file_1, syms_of_filelock):

* src/fontset.c (fontset_from_font, syms_of_fontset):

* src/frame.c (make_frame_without_minibuffer, syms_of_frame):

* src/gnutls.c (emacs_gnutls_certificate_details)
(Fgnutls_peer_status_warning_describe, Fgnutls_peer_status)
(gnutls_verify_boot, syms_of_gnutls):

* src/gtkutil.c (style_changed_cb, find_rtl_image):

* src/image.c (imagemagick_filename_hint, gs_load)
(syms_of_image):

* src/keyboard.c (command_loop_1, read_char, timer_start_idle)
(read_char_minibuf_menu_prompt, Fsuspend_emacs)
(syms_of_keyboard):

* src/keymap.c (Fmap_keymap, Flookup_key, Fdescribe_vector)
(describe_vector, syms_of_keymap):

* src/lread.c (Fread, Fread_positioning_symbols, syms_of_lread):

* src/minibuf.c (Fabort_minibuffers, Fread_buffer)
(Fcompleting_read, syms_of_minibuf):

* src/msdos.c (XMenuActivate, run_msdos_command, syms_of_msdos):

* src/nsfns.m (Fx_display_backing_store, Fx_display_visual_class)
(Fns_hide_emacs, Fsystem_move_file_to_trash, ns_create_tip_frame)
(x_hide_tip, Fx_show_tip, syms_of_nsfns):

* src/nsfont.m (ns_spec_to_descriptor, ns_descriptor_to_entity)
(syms_of_nsfont):

* src/pdumper.c (Fdump_emacs_portable):

* src/pgtkfns.c (Fx_display_visual_class, x_create_tip_frame)
(Fx_show_tip, syms_of_pgtkfns):

* src/pgtkterm.c (syms_of_pgtkterm, pgtk_cr_export_frames):

* src/term.c (term_get_fkeys_1, set_tty_color_mode, Fsuspend_tty)
(Fresume_tty, tty_menu_activate, syms_of_term):

* src/terminal.c (create_terminal, syms_of_terminal):

* src/w32fns.c (Fx_display_backing_store)
(Fx_display_visual_class, Fset_message_beep, Fx_open_connection)
(Fx_show_tip, Fx_file_dialog, Fsystem_move_file_to_trash)
(Fw32_toggle_lock_key, syms_of_w32fns):

* src/w32font.c (w32_enumfont_pattern_entity, syms_of_w32font):

* src/w32term.c (w32_bitmap_icon, syms_of_w32term):

* src/xdisp.c (message_dolog, define_frame_cursor1)
(syms_of_xdisp):

* src/xfaces.c (tty_lookup_color, syms_of_xfaces):

* src/xml.c (make_dom, syms_of_xml):

* src/xterm.c (syms_of_xterm):

* src/xwidget.c (store_xwidget_download_callback_event)
(store_xwidget_js_callback_event, syms_of_xwidget): Define
symbols for symbols interned with `intern' from a constant
string, delete duplicate DEFSYM directives, and substitute them
for such calls to intern.  This excludes only those symbols
which are interned and referenced only once during Emacs's
initialization, the timing of whose interning is
inconsequential, and symbols in w32.c, which would need to be
transferred to a new syms_of_w32 function that I cannot test.

19 months ago* lisp/treesit.el (treesit-outline-search): Handle bobp specially.
Juri Linkov [Thu, 9 May 2024 06:28:50 +0000 (09:28 +0300)]
* lisp/treesit.el (treesit-outline-search): Handle bobp specially.

At the beginning of the buffer call 'treesit-outline-search'
recursively with the `looking-at' argument set to t, since
`treesit-navigate-thing' can't find a thing at bobp (bug#70789).

19 months ago; * etc/PROBLEMS: Document macOS problems with Emacs.clr (bug#70836).
Eli Zaretskii [Thu, 9 May 2024 06:05:22 +0000 (09:05 +0300)]
; * etc/PROBLEMS: Document macOS problems with Emacs.clr (bug#70836).

19 months agoFontify for_statement variable in python-ts-mode (bug#70718)
Noah Peart [Thu, 2 May 2024 13:58:34 +0000 (06:58 -0700)]
Fontify for_statement variable in python-ts-mode (bug#70718)

* lisp/progmodes/python.el (python--treesit-settings): Add
font-lock query for for_statement variable in assignment feature.

19 months agoFontify namespace in c++-ts-mode
Yuan Fu [Thu, 9 May 2024 04:25:40 +0000 (21:25 -0700)]
Fontify namespace in c++-ts-mode

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Add a
rule for namespace.

19 months agoFix #if defined directive fontification in c-ts-mode
Yuan Fu [Thu, 9 May 2024 03:50:24 +0000 (20:50 -0700)]
Fix #if defined directive fontification in c-ts-mode

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Fontify
each part separately so the identifier isn't overriden.

19 months agoImprove indentation in 'lua-ts-mode' (bug#70785)
john muhl [Fri, 3 May 2024 20:51:01 +0000 (15:51 -0500)]
Improve indentation in 'lua-ts-mode' (bug#70785)

* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
- Ignore comments when aligning arguments, parameters and fields.
- Apply simpler rules to simpler usage of anonymous functions.
- Better handling of table as a function argument.
(lua-ts--comment-first-sibling-matcher):
(lua-ts--first-real-sibling-anchor):
(lua-ts--last-arg-function-call-matcher):
(lua-ts--top-level-function-call-matcher): New function.
(lua-ts--g-parent):
(lua-ts--g-g-parent): New function.
(lua-ts--g-g-g-parent): Use it.
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts:
Add tests.

19 months ago; Quietly skip 'lua-ts-mode' tests (bug#70786)
john muhl [Sat, 27 Apr 2024 23:52:41 +0000 (18:52 -0500)]
; Quietly skip 'lua-ts-mode' tests (bug#70786)

* test/lisp/align-tests.el (align-lua):
* test/lisp/progmodes/lua-ts-mode-tests.el
(lua-ts-test-indentation):
(lua-ts-test-movement):
(lua-ts-test-font-lock):
(lua-ts-test-which-function): Suppress warnings when the grammar is not
installed.

19 months agoFontify doc comment in c-ts-mode with doc-face
Yuan Fu [Thu, 9 May 2024 03:27:12 +0000 (20:27 -0700)]
Fontify doc comment in c-ts-mode with doc-face

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Add
rule for /** comments.

19 months agoxref--collect-matches: Fix the application of syntax-propertize
Dmitry Gutov [Thu, 9 May 2024 02:57:07 +0000 (05:57 +0300)]
xref--collect-matches: Fix the application of syntax-propertize

* lisp/progmodes/xref.el (xref--collect-matches):
Add syntax-ppss-flush-cache call when needed (bug#53749).

19 months agochoose-completion: Retain the suffix after completion boundary
Dmitry Gutov [Thu, 9 May 2024 02:30:32 +0000 (05:30 +0300)]
choose-completion: Retain the suffix after completion boundary

* lisp/minibuffer.el (completion-base-suffix):
Remove as not optimal after all (bug#48356).
(completion--replace): Use insert-before-markers-and-inherit.
(minibuffer-completion-help): Don't set completion-base-affixes,
implement the same logic more optimally by local search and
querying for field boundaries.  Also fix the problem with
completion table, predicate and extra-props being looked up in the
wrong buffer.
(minibuffer-next-completion, minibuffer-choose-completion):
Don't bind completion-use-base-affixes anymore.

* lisp/simple.el (completion-base-affixes)
(completion-use-base-affixes): Remove.
(completion-list-insert-choice-function):
Don't pass them through anymore.

19 months agoDon't report erroneous /content directory on Android 4.3 and earlier
Po Lu [Thu, 9 May 2024 01:00:02 +0000 (09:00 +0800)]
Don't report erroneous /content directory on Android 4.3 and earlier

* src/androidvfs.c (android_content_opendir): Skip two, not one,
elements on Android <= 4.4.

19 months agoPrefer erc--skip property to erc-track--skipped-msgs
F. Jason Park [Tue, 7 May 2024 04:59:48 +0000 (21:59 -0700)]
Prefer erc--skip property to erc-track--skipped-msgs

* lisp/erc/erc-stamp.el (erc-add-timestamp): Honor an overriding
`erc--ts' "msg prop".
(erc-stamp--defer-date-insertion-on-post-modify): Add `erc--skip'
for the `track' module.
* lisp/erc/erc-track.el (erc-track--skipped-msgs): Remove unused
variable.  Originally added as part of bug#60936.
(erc-track-modified-channels): Rely on the `erc--skip' "msg prop"
instead of the now defunct `erc-track--skipped-msgs' variable for
detecting requests to omit `track' mode-line updates during
`erc-display-message'.