]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 months agoFurther time decoding tidying
Mattias Engdegård [Sun, 14 Jul 2024 11:01:57 +0000 (13:01 +0200)]
Further time decoding tidying

* src/timefns.c (enum timeform): Reorder.
(decode_time_components, decode_lisp_time): Simplify and clean up.

(cherry picked from commit a44376432de78374017c2009163a9242acbf6355)

3 months agoMinor improvement in 'rmail-redecode-body'
Eli Zaretskii [Sun, 14 Jul 2024 08:41:30 +0000 (11:41 +0300)]
Minor improvement in 'rmail-redecode-body'

* lisp/mail/rmail.el (rmail-redecode-body): Signal user-error if
'rmail-enable-mime' is non-nil; doc fix.

(cherry picked from commit 159f3f59b1d6ca57cff6f0628458908b62639e30)

3 months agoFix decoding 'display' properties with SVG images in Enriched mode
Eli Zaretskii [Sun, 14 Jul 2024 06:06:55 +0000 (09:06 +0300)]
Fix decoding 'display' properties with SVG images in Enriched mode

* lisp/textmodes/enriched.el (enriched-next-annotation): Reject
matches of 'enriched-annotation-regexp' inside strings.  Reported
by Christopher Howard <christopher@librehacker.com> in
https://lists.gnu.org/archive/html/help-gnu-emacs/2024-06/msg00178.html.

(cherry picked from commit 33ba72f52fd2138a7c2d6c065236fd459b8c659d)

3 months ago* configure.ac (D8): Fix typo.
Pip Cet [Sun, 14 Jul 2024 05:41:17 +0000 (05:41 +0000)]
* configure.ac (D8): Fix typo.

(cherry picked from commit 174a0b7642bd2d8bc397a73afc647a799e873e20)

3 months agoMinor renaming in timefns.c
Paul Eggert [Sun, 14 Jul 2024 05:16:26 +0000 (22:16 -0700)]
Minor renaming in timefns.c

* src/timefns.c (current_time_in_cform): Rename this static
function from current_time_in_form, since this is about enum cform
not enum timeform.  Use changed.

(cherry picked from commit 62fdcfd4842693f436acd5b729d20934d12ca708)

3 months ago; * src/android.c (setEmacsParams): Delete unused variable.
Po Lu [Sun, 14 Jul 2024 04:51:48 +0000 (12:51 +0800)]
; * src/android.c (setEmacsParams): Delete unused variable.

(cherry picked from commit c56e837a10eb34cbe04da8f2c16ebcae7f70704b)

3 months agoDo not set LD_LIBRARY_PATH during Android initialization
Po Lu [Sun, 14 Jul 2024 04:46:23 +0000 (12:46 +0800)]
Do not set LD_LIBRARY_PATH during Android initialization

* doc/emacs/android.texi (Android Environment): Adjust
documentation to match.

* java/org/gnu/emacs/EmacsNoninteractive.java (main1): New
function.  Remove initialization of EmacsNative hither.
(main): Acquire an ApplicationInfo or LoadedApk, as the case may
be on the host system, derive a ClassLoader from the result, and
load and call `main1' from within this class loader.

* src/android-emacs.c (main):

* src/android.c (setEmacsParams): Do not override
LD_LIBRARY_PATH or set EMACS_LD_LIBRARY_PATH.  This enables
Emacs to execute subprocesses in certain "fortified" Android
systems, amongst other things.

(cherry picked from commit b00fc31dd1d4543f8b017e8d7fef7686cd430bcc)

3 months ago; Set Transient's version
Jonas Bernoulli [Sat, 13 Jul 2024 19:59:20 +0000 (21:59 +0200)]
; Set Transient's version

(cherry picked from commit 04bf3172f03497eef6985311c90fd6557ace42b2)

3 months ago; Fix typos in 'which-key-mode' (bug#72093)
john muhl [Wed, 10 Jul 2024 22:13:58 +0000 (17:13 -0500)]
; Fix typos in 'which-key-mode' (bug#72093)

* lisp/which-key.el (which-key-preserve-window-configuration):
Correct spelling of "taken".
(which-key--create-pages): Correct spelling of "widths".
(which-key--start-paging-timer): Correct spelling of
"secondary".

(cherry picked from commit e6f78485aa66ff762376702fc97a14a4dfe9b258)

3 months agoFix 'customize-group' minibuffer action
Eshel Yaron [Wed, 17 Jul 2024 15:47:18 +0000 (17:47 +0200)]
Fix 'customize-group' minibuffer action

4 months agorefactor.el: Fix typos
Eshel Yaron [Tue, 16 Jul 2024 17:53:54 +0000 (19:53 +0200)]
refactor.el: Fix typos

4 months agoFix some minibuffer bindings
Eshel Yaron [Tue, 16 Jul 2024 17:27:37 +0000 (19:27 +0200)]
Fix some minibuffer bindings

4 months agoAdd minibuffer alternative actions for 'C-h f' and 'C-h v'
Eshel Yaron [Tue, 16 Jul 2024 17:27:16 +0000 (19:27 +0200)]
Add minibuffer alternative actions for 'C-h f' and 'C-h v'

4 months agoNew function 'completing-read-case-insensitive'
Eshel Yaron [Mon, 15 Jul 2024 18:48:11 +0000 (20:48 +0200)]
New function 'completing-read-case-insensitive'

4 months agoCease copying 'completion-ignore-case' buffer-local value
Eshel Yaron [Mon, 15 Jul 2024 17:40:06 +0000 (19:40 +0200)]
Cease copying 'completion-ignore-case' buffer-local value

4 months agoRemove 'completion-tab-width'
Eshel Yaron [Mon, 15 Jul 2024 17:38:23 +0000 (19:38 +0200)]
Remove 'completion-tab-width'

Manually align annotations in only place this variable is used.

4 months agoSimplify 'xref-etags-mode'
Eshel Yaron [Mon, 15 Jul 2024 17:36:04 +0000 (19:36 +0200)]
Simplify 'xref-etags-mode'

4 months ago; Fix bug#72080
Eshel Yaron [Sun, 14 Jul 2024 15:38:53 +0000 (17:38 +0200)]
; Fix bug#72080

4 months ago(ispell-lookup-words): Cease emitting message
Eshel Yaron [Sun, 14 Jul 2024 12:57:43 +0000 (14:57 +0200)]
(ispell-lookup-words): Cease emitting message

4 months agoImprove '[un]trace-function'
Eshel Yaron [Sun, 14 Jul 2024 12:55:07 +0000 (14:55 +0200)]
Improve '[un]trace-function'

4 months agoOptionally group imenu completions when flattened
Eshel Yaron [Sun, 14 Jul 2024 10:14:33 +0000 (12:14 +0200)]
Optionally group imenu completions when flattened

4 months ago(flymake-go-to-diagnostic): Add 'export-function'
Eshel Yaron [Sun, 14 Jul 2024 08:48:18 +0000 (10:48 +0200)]
(flymake-go-to-diagnostic): Add 'export-function'

4 months ago; Update ldefs-boot.el
Eshel Yaron [Sun, 14 Jul 2024 05:56:23 +0000 (07:56 +0200)]
; Update ldefs-boot.el

4 months ago; Fix bootstrap
Eshel Yaron [Sat, 13 Jul 2024 20:56:23 +0000 (22:56 +0200)]
; Fix bootstrap

4 months agoTreat SVG images like other image types in 'shr-put-image'
Jim Porter [Thu, 11 Jul 2024 23:29:37 +0000 (16:29 -0700)]
Treat SVG images like other image types in 'shr-put-image'

For both SVG and no-SVG builds, this works as expected (in the no-SVG
case, it would raise an error which subsequently gets ignored).
However, compared to the previous implementation, this lets users resize
SVG images just like every other image type (bug#71913).

* lisp/net/shr.el (shr-put-image): Don't special-case SVGs.

(cherry picked from commit f38c42d1c7a8413f63b1e56261850d3dbe8abef8)

4 months agoFix renaming symlinks on MS-Windows
Eli Zaretskii [Sat, 13 Jul 2024 12:52:38 +0000 (15:52 +0300)]
Fix renaming symlinks on MS-Windows

* src/w32.c (sys_rename_replace): Handle renames of a symlink.
This makes 'wdired-tests' succeed on MS-Windows.

(cherry picked from commit 5389b6a856b39427846e38b06fa398bafc04836a)

4 months ago; * src/w32fns.c (Fw32_notification_close): Fix typo (bug#72091).
Raffael Stocker [Sat, 13 Jul 2024 11:26:23 +0000 (13:26 +0200)]
; * src/w32fns.c (Fw32_notification_close): Fix typo (bug#72091).

(cherry picked from commit a6c78ccf5f297e612ff0f2159a7bed3a70637168)

4 months ago* test/lisp/wdired-tests.el (wdired-test-bug34915): Fix for MS-Windows.
Eli Zaretskii [Sat, 13 Jul 2024 12:06:43 +0000 (15:06 +0300)]
* test/lisp/wdired-tests.el (wdired-test-bug34915): Fix for MS-Windows.

(cherry picked from commit febafe37884823d5ac6a63a57c7500f4a0a8a792)

4 months agoFix 'wdired-test-unfinished-edit-01'
Peter Oliver [Fri, 12 Jul 2024 09:52:23 +0000 (10:52 +0100)]
Fix 'wdired-test-unfinished-edit-01'

* test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01):
Don't modify the random directory name if, by chance, it happens
to contain the substring "foo" anywhere but immediately after the
slash.  (Bug#72073)

(cherry picked from commit 846b79b6d02faf188f0131c57a49a60bb8f71d64)

4 months ago; * src/search.c (Fre_search_forward): Clarify doc string (bug#71879).
Eli Zaretskii [Sat, 13 Jul 2024 10:22:01 +0000 (13:22 +0300)]
; * src/search.c (Fre_search_forward): Clarify doc string (bug#71879).

(cherry picked from commit bc154cba13024d2c159f6cadd324a8ef3f6dddcc)

4 months ago; Fix last change
Eli Zaretskii [Sat, 13 Jul 2024 10:16:42 +0000 (13:16 +0300)]
; Fix last change

* lisp/progmodes/java-ts-mode.el (java-ts-mode):
* lisp/progmodes/c-ts-mode.el (c-ts-mode, c++-ts-mode): Load the
Doxygen grammar quietly, so that if it isn't available, the user
is not annoyed.  (Bug#71874)

(cherry picked from commit 3a26a51c69b064546fd4647a94cdfc2656b201ec)

4 months agoFontify doxygen support to 'c-ts-mode', 'c++-ts-mode' and 'java-ts-mode'
Vincenzo Pupillo [Mon, 1 Jul 2024 10:34:01 +0000 (12:34 +0200)]
Fontify doxygen support to 'c-ts-mode', 'c++-ts-mode' and 'java-ts-mode'

Add doxygen support to 'c-ts-mode', 'c++-ts-mode' and
'java-ts-mode' using tree-sitter-doxygen from
github.com/tree-sitter-grammars.
* lisp/progmodes/c-ts-common.el
(c-ts-mode-doxygen-comment-font-lock-settings): Add font locking
rules for doxygen comment.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--feature-list): Add
'document' feature.
(c-ts-mode--doxygen-comment-regex): New regular expression for
doxygen comments.
(c-ts-mode, c++-ts-mode): Add support for doxygen parser.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Add support for
doxygen parser.  (Bug#71874)

(cherry picked from commit c77a9b934bc1120c7726d271bbd4ada178cf8c2d)

4 months agoFontify destructor in c++-ts-mode
Vincenzo Pupillo [Mon, 1 Jul 2024 09:52:18 +0000 (11:52 +0200)]
Fontify destructor in c++-ts-mode

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

(cherry picked from commit 53291e3d46ee81b2b0fb7594496d938eab61bc0f)

4 months agoSimplify timestamp decoding
Mattias Engdegård [Fri, 12 Jul 2024 10:16:22 +0000 (12:16 +0200)]
Simplify timestamp decoding

* src/timefns.c (current_time_in_form, time_spec_invalid): New.
(enum timeform): Remove TIMEFORM_INVALID.
(decode_time_components): Move handling of TIMEFORM_INVALID,
TIMEFORM_TICKS_HZ and TIMEFORM_NIL...
(decode_lisp_time): ...here, avoiding the detour.

(cherry picked from commit b23ab371756b5f77f62020cdfda5fe7b6fb04470)

4 months agoFix invalid defcustom type for erc-buffers option
F. Jason Park [Fri, 12 Jul 2024 21:41:54 +0000 (14:41 -0700)]
Fix invalid defcustom type for erc-buffers option

* lisp/erc/erc.el (erc-ensure-target-buffer-on-privmsg): Change
invalid inner `choice' to a `const' for the third-state `status'
variant, which is new in ERC 5.6 and Emacs 30.  Thanks to Mattias
Engdegård for catching this.

(cherry picked from commit d77f8a347500da4c1ce7553332a481c5507412fc)

4 months agoFix infloop in 'shell-resync-dirs'
Eli Zaretskii [Fri, 12 Jul 2024 06:58:53 +0000 (09:58 +0300)]
Fix infloop in 'shell-resync-dirs'

* lisp/shell.el (shell-eval-command): Fix detection of newline
after last output line.  (Bug#71896)
(shell-resync-dirs): Make sure the inner loop never infloops.
Suggested by Troy Hinckley <troyhinckley@dabrev.com>.

(cherry picked from commit 8b1a0f8695a43e74daa5275559267e96c14aba03)

4 months ago; * src/image.c (free_image_cache): Add assertion. (Bug#71929)
Eli Zaretskii [Fri, 12 Jul 2024 06:39:39 +0000 (09:39 +0300)]
; * src/image.c (free_image_cache): Add assertion.  (Bug#71929)

(cherry picked from commit ce13eee5ab73e73ffd5d8e67a1dd21fc667ab7e1)

4 months agoNew command 'search-from-isearch'
Eshel Yaron [Sat, 13 Jul 2024 19:41:23 +0000 (21:41 +0200)]
New command 'search-from-isearch'

4 months ago* lisp/mode-face.el: New file.
Eshel Yaron [Sat, 13 Jul 2024 19:21:47 +0000 (21:21 +0200)]
* lisp/mode-face.el: New file.

4 months ago* lisp/rainbow-delimiters.el: New file.
Eshel Yaron [Sat, 13 Jul 2024 19:10:04 +0000 (21:10 +0200)]
* lisp/rainbow-delimiters.el: New file.

From https://github.com/Fanael/rainbow-delimiters

4 months ago* lisp/rainbow.el: New file.
Eshel Yaron [Sat, 13 Jul 2024 18:46:26 +0000 (20:46 +0200)]
* lisp/rainbow.el: New file.

Extracted from https://github.com/emacsmirror/rainbow-mode

4 months agoFurther integrate minibuffer alternative actions
Eshel Yaron [Sat, 13 Jul 2024 17:19:11 +0000 (19:19 +0200)]
Further integrate minibuffer alternative actions

4 months agoIndicate completion strictness in minibuffer prompt
Eshel Yaron [Sat, 13 Jul 2024 16:16:43 +0000 (18:16 +0200)]
Indicate completion strictness in minibuffer prompt

4 months ago(minibuffer-add-completion-predicate): Add minibuffer action
Eshel Yaron [Sat, 13 Jul 2024 16:03:09 +0000 (18:03 +0200)]
(minibuffer-add-completion-predicate): Add minibuffer action

4 months ago* lisp/bindings.el (search-map): Bind 'search', 'search-lines'
Eshel Yaron [Sat, 13 Jul 2024 15:53:32 +0000 (17:53 +0200)]
* lisp/bindings.el (search-map): Bind 'search', 'search-lines'

4 months agocus-edit: Add minibuffer actions, and mark mode-specific commands
Eshel Yaron [Sat, 13 Jul 2024 15:50:51 +0000 (17:50 +0200)]
cus-edit: Add minibuffer actions, and mark mode-specific commands

4 months ago(completion-pcm-word-delimiters): Add parentheses
Eshel Yaron [Sat, 13 Jul 2024 14:26:05 +0000 (16:26 +0200)]
(completion-pcm-word-delimiters): Add parentheses

4 months ago(search-read-target): Fix off-by-one in group-function
Eshel Yaron [Sat, 13 Jul 2024 14:22:54 +0000 (16:22 +0200)]
(search-read-target): Fix off-by-one in group-function

4 months agoNew command 'flymake-go-to-diagnostic'
Eshel Yaron [Sat, 13 Jul 2024 14:22:12 +0000 (16:22 +0200)]
New command 'flymake-go-to-diagnostic'

4 months agoImprove some docstrings in minibuffer.el
Eshel Yaron [Sat, 13 Jul 2024 11:24:44 +0000 (13:24 +0200)]
Improve some docstrings in minibuffer.el

4 months ago(minibuffer-read-predicate-description): Add completion category
Eshel Yaron [Sat, 13 Jul 2024 11:01:27 +0000 (13:01 +0200)]
(minibuffer-read-predicate-description): Add completion category

4 months agoFix 'minibuffer-read-predicate-description' with sole candidate
Eshel Yaron [Sat, 13 Jul 2024 10:53:07 +0000 (12:53 +0200)]
Fix 'minibuffer-read-predicate-description' with sole candidate

4 months ago* lisp/minibuffer.el (minibuffer-message): Be async.
Eshel Yaron [Fri, 12 Jul 2024 18:43:50 +0000 (20:43 +0200)]
* lisp/minibuffer.el (minibuffer-message): Be async.

4 months ago* lisp/gnus/mm-uu.el (mm-uu-type-alist): Fix end-regexp of git-format-patch.
Juri Linkov [Fri, 12 Jul 2024 17:54:53 +0000 (20:54 +0300)]
* lisp/gnus/mm-uu.el (mm-uu-type-alist): Fix end-regexp of git-format-patch.

Replace git-format-patch end-regexp "^-- " with "^$".
The regexp "^-- " was intended to mark the end
of the git-formatted patch.  However, git-format-patch
can produce patches without a signature.  Also often
patches are just copy-pasted from the output of 'C-x v d'.
Therefore, now an empty line marks the end of the patch
since properly formatted patches don't contain an empty line
and properly configured MUAs don't strip whitespace from patches.
Suggested by Luis Henriques <henrix@camandro.org> and
Kévin Le Gouguec <kevin.legouguec@gmail.com> in bug#72059.

(cherry picked from commit 900f135b68b4e9830eac5d7500b3175f160f6c34)

4 months agoRender more Android functions safe to execute in a batch session
Po Lu [Fri, 12 Jul 2024 06:31:33 +0000 (14:31 +0800)]
Render more Android functions safe to execute in a batch session

* src/androidfns.c (Fx_display_mm_width, Fx_display_mm_height)
(Fandroid_display_monitor_attributes_list)
(Fandroid_external_storage_available_p)
(Fandroid_request_storage_access): Verify that a display
connection or service object is available.

* src/androidselect.c (Fandroid_get_clipboard)
(Fandroid_browse_url_internal, Fandroid_get_clipboard_targets)
(Fandroid_get_clipboard_data, Fandroid_notifications_notify):
Moderate tone of error messages.

(cherry picked from commit b22ab99f0a85f73a1aec582f7aba0e6b5101b953)

4 months agoDocument means of executing Emacs from unrelated Android applications
Po Lu [Fri, 12 Jul 2024 03:59:09 +0000 (11:59 +0800)]
Document means of executing Emacs from unrelated Android applications

* doc/emacs/android.texi (Android Environment): Document
significance, effect and purpose of EMACS_CLASS_PATH and
EMACS_LD_LIBRARY_PATH, and the utility of `pm path
org.gnu.emacs'.

(cherry picked from commit a5ef9e25680d490e2a453e5ed518aba8f4560b2d)

4 months agoDon't emit a prompt in Eshell when a background command is killed
Jim Porter [Tue, 9 Jul 2024 17:45:35 +0000 (10:45 -0700)]
Don't emit a prompt in Eshell when a background command is killed

* lisp/eshell/esh-cmd.el (eshell-resume-command): Check for
background-ness before resetting the prompt.

* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/background/simple-command): Make the regexp a bit
stricter.
(esh-cmd-test/background/kill): New test.

(cherry picked from commit 0de0056fd6b3b70dde54884db5d9ffc013c49efc)

4 months agoFix reference from buffer-stale-function docstring
Daniel Martín [Wed, 10 Jul 2024 23:22:04 +0000 (01:22 +0200)]
Fix reference from buffer-stale-function docstring

* lisp/files.el (buffer-stale-function): Fix reference to a
non-existent Info node in doc string.  (Bug#72049)

(cherry picked from commit ec1e300a215504bb9905a31145924d7f3d2cb9ab)

4 months agoOnly say that minor mode function is interactive if it is so
Eshel Yaron [Fri, 12 Jul 2024 17:57:45 +0000 (19:57 +0200)]
Only say that minor mode function is interactive if it is so

4 months agoAllow replacing 'search' matches via minibuffer alt action
Eshel Yaron [Fri, 12 Jul 2024 14:31:39 +0000 (16:31 +0200)]
Allow replacing 'search' matches via minibuffer alt action

4 months agoAdd minibuffer alternative actions
Eshel Yaron [Fri, 12 Jul 2024 17:48:35 +0000 (19:48 +0200)]
Add minibuffer alternative actions

4 months ago(completion-all-sorted-completions): Sync with *Completions*
Eshel Yaron [Fri, 12 Jul 2024 17:46:07 +0000 (19:46 +0200)]
(completion-all-sorted-completions): Sync with *Completions*

4 months agoMore improvements for new search commands
Eshel Yaron [Fri, 12 Jul 2024 10:43:46 +0000 (12:43 +0200)]
More improvements for new search commands

4 months agoImprovements for new search commands
Eshel Yaron [Fri, 12 Jul 2024 08:30:08 +0000 (10:30 +0200)]
Improvements for new search commands

4 months ago* lisp/search.el: New file.
Eshel Yaron [Fri, 12 Jul 2024 06:27:10 +0000 (08:27 +0200)]
* lisp/search.el: New file.

4 months agoAdd a type-check--optim test
Andrea Corallo [Wed, 10 Jul 2024 21:50:18 +0000 (23:50 +0200)]
Add a type-check--optim test

* test/src/comp-tests.el (comp-tests-type-branch-optim-checker): New function.
(comp-tests-type-branch-optim): Add new test.

(cherry picked from commit dc8cde2b6f3e7c55a85439c771284df2b4fa0e37)

4 months agoSome clean-up in comp-tests.el
Andrea Corallo [Wed, 10 Jul 2024 21:48:19 +0000 (23:48 +0200)]
Some clean-up in comp-tests.el

* test/src/comp-tests.el (comp-tests-cond-rw-checked-function)
(comp-tests-cond-rw-checker-val)
(comp-tests-cond-rw-expected-type)
(comp-tests-cond-rw-checker-type): Remove.

(cherry picked from commit ffaf1cb235c8b399cd9fb704f9b5879db2f5d6a6)

4 months agoFix 'comp--type-check-optim-block' it using 'comp-cstr-type-p'
Andrea Corallo [Fri, 31 May 2024 08:24:11 +0000 (10:24 +0200)]
Fix 'comp--type-check-optim-block' it using 'comp-cstr-type-p'

* lisp/emacs-lisp/comp.el (comp--type-check-optim-block): Better
condition.

(cherry picked from commit baf74968f9704b6354fff7a254172f72f0ebb747)

4 months agoGeneralize 'comp-cstr-symbol-p'
Andrea Corallo [Fri, 31 May 2024 08:08:18 +0000 (10:08 +0200)]
Generalize 'comp-cstr-symbol-p'

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-symbol-p): Make use of
'comp-cstr-type-p'.

(cherry picked from commit 0d6f3f134e4e9e41df86e015ea5cfc0a990b62e5)

4 months agoAdd 'comp-type-check-optim' pass
Andrea Corallo [Tue, 23 May 2023 09:18:07 +0000 (11:18 +0200)]
Add 'comp-type-check-optim' pass

* lisp/emacs-lisp/comp.el (comp-passes): Add 'comp--type-check-optim'.
(comp--type-check-optim-block, comp--type-check-optim): New functions.

(cherry picked from commit a1775552cef5a8bc0ba13e802ecf343423a53364)

4 months agoSplit 'comp--ssa' code
Andrea Corallo [Sun, 7 Apr 2024 12:35:53 +0000 (14:35 +0200)]
Split 'comp--ssa' code

* lisp/emacs-lisp/comp.el (comp--ssa-function): New function.
(comp--ssa): Update.

(cherry picked from commit 8538a281f53107b69ed4a4b0d21f237cd79de400)

4 months agoRename timefns static function lisp_time_struct
Paul Eggert [Thu, 11 Jul 2024 13:40:47 +0000 (15:40 +0200)]
Rename timefns static function lisp_time_struct

* src/timefns.c (lisp_time_cform): Rename from lisp_time_struct,
since it no longer returns a struct, and now accepts CFORM.
All uses changed.

(cherry picked from commit c3e6923b0043711a688a677edb52b31fa1640f0e)

4 months agoAvoid mpz for some common timestamp cases
Paul Eggert [Thu, 11 Jul 2024 13:28:58 +0000 (15:28 +0200)]
Avoid mpz for some common timestamp cases

Performance problem reported by Gerd Möllmann and Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2024-06/msg00530.html
https://lists.gnu.org/r/emacs-devel/2024-06/msg00539.html
* src/timefns.c (CFORM_SECS_ONLY): The exact tv_nsec value is now
ignored if nonnegative (i.e., the only thing that matters is that
it’s nonnegative).
(decode_time_components): Use intmax_t instead of mpz arithmetic
if the tick count fits.  Add another ‘default: eassume (false);’
so that the revised code pacifies --enable-gcc-warnings with GCC
11.4.0 on x86-64.

(cherry picked from commit e30706fd12bce459b56123ad36a4e8c1c9d374e1)

4 months agoDecode current time directly to timespec
Paul Eggert [Thu, 11 Jul 2024 13:03:50 +0000 (15:03 +0200)]
Decode current time directly to timespec

* src/timefns.c (decode_time_components): If FASTER_TIMEFNS, when
returning the current time and the desired form is struct timespec
or time_t, return it directly rather than converting it to struct
ticks_hz and then to struct timespec.  This can avoid some mpz
calculations and/or bignums.

(cherry picked from commit e8b3c4cb58ce6e78b9bcfb9146f0ac6ece0d3055)

4 months agoIn timefns.c avoid by-hand overflow checking
Paul Eggert [Thu, 11 Jul 2024 10:57:01 +0000 (12:57 +0200)]
In timefns.c avoid by-hand overflow checking

Prefer functions like ckd_add to do overflow checking, instead of
doing it by hand, to simplify and I hope to make things a bit less
error prone.
* src/timefns.c (TIME_T_MIN, TIME_T_MAX): Remove.  All by-hand
overflow checking replaced with calls to ckd_add or ckd_mul.
(s_ns_to_timespec): New static function, that uses ckd_add
instead of by-hand overflow checking.
(ticks_hz_to_timespec): Use it.
(check_tm_member): Use mpz_fits_sint_p and mpz_get_si rather
than mpz_to_intmax and by-hand overflow checking.

(cherry picked from commit 75f53d7c2c1f6706d1d4c1f3eed3aa675464c62f)

4 months agoOptimize smallish mpz to native int conversion
Paul Eggert [Thu, 11 Jul 2024 10:42:57 +0000 (12:42 +0200)]
Optimize smallish mpz to native int conversion

* src/bignum.c (make_integer_mpz, mpz_to_intmax):
If FASTER_BIGNUM, optimize the common case where the value fits in
long int.  In this case we can use mpz_fits_slong_p and mpz_get_si
instead of looping with mpz_getlimbn.
(mpz_to_uintmax): Likewise for unsigned long int and mpz_get_ui.

(cherry picked from commit 0c850df888ebb68096a82ab32089e809de591620)

4 months agoNew FASTER_BIGNUM macro to test slow-path code
Paul Eggert [Thu, 11 Jul 2024 10:27:36 +0000 (12:27 +0200)]
New FASTER_BIGNUM macro to test slow-path code

* src/bignum.h (FASTER_BIGNUM): New macro.
(mpz_set_intmax, mpz_set_uintmax): Optimize only if FASTER_BIGNUM.
Also, use ckd_add to test for overflow instead of doing it by hand.

(cherry picked from commit 1c8e64a9536ed092af27279fa3f044cf031a4324)

4 months agoIn timefns, call natnump only for non-fixnums
Paul Eggert [Wed, 10 Jul 2024 09:04:18 +0000 (11:04 +0200)]
In timefns, call natnump only for non-fixnums

* src/timefns.c (decode_time_components): Call Fnatnump only
for non-fixnums, as we need to special-case 0 anyway.

(cherry picked from commit 2fb7bb41bee5e39391c9abc8013bcef39782e88d)

4 months agoIn timefns, do gcd reduction more often
Paul Eggert [Wed, 10 Jul 2024 08:36:35 +0000 (10:36 +0200)]
In timefns, do gcd reduction more often

* src/timefns.c (ticks_hz_hz_ticks): Reduce by gcd
even if t.ticks is not a fixnum, since that’s easy.

(cherry picked from commit b6cbf0cbb66fa4c1a7f351350d5f9aed9c93cd26)

4 months agoIn timefns, prefer ui mul and div
Paul Eggert [Wed, 10 Jul 2024 08:23:31 +0000 (10:23 +0200)]
In timefns, prefer ui mul and div

* src/timefns.c (ticks_hz_hz_ticks): If the multiplier
is a fixnum that fits in unsigned long, use mpz_mul_ui
instead of the more-expensive mpz_mul.  Similarly, if the
divisor is a fixnum that fits in unsigned long, use
mpz_fdiv_q_ui instead of mpz_fdiv_q.

(cherry picked from commit abafc6ca01444de7aad9856b4901aa82a68dff32)

4 months agoReduce size of integer product in timefns
Paul Eggert [Wed, 10 Jul 2024 00:37:55 +0000 (02:37 +0200)]
Reduce size of integer product in timefns

* src/timefns.c (emacs_gcd): New static function.
(ticks_hz_hz_ticks): Use it to reduce the size of the integer
product in the common case when converting from ns to ps.  For
that, we need to multiply t.ticks only by 10³, not multiply by
10¹² and then divide by 10⁹.  This avoids the need to use bignums
in a significant number of cases.

(cherry picked from commit 6ef052d9b23aef3f34d19e5d93d97884215d1465)

4 months agoRename timefns internals
Paul Eggert [Mon, 8 Jul 2024 07:26:14 +0000 (09:26 +0200)]
Rename timefns internals

The old names didn’t fit in the conventions used for newer names.
* src/timefns.c (struct ticks_hz): Rename from struct lisp_time.
(union c_time): Rename lt to th.
(ticks_hz_hz_ticks): Rename from lisp_time_hz_ticks.
(ticks_hz_seconds): Rename from lisp_time_seconds.
All uses changed.

(cherry picked from commit 5e8a38ecb2a78c0e318892683dc0195084197c57)

4 months agoSpeed up decode-time when not doing subseconds
Paul Eggert [Sun, 7 Jul 2024 19:34:23 +0000 (21:34 +0200)]
Speed up decode-time when not doing subseconds

* src/timefns.c (Fdecode_time): Avoid some unnecessary conversions
in the common case where subsecond resolution is not required.

(cherry picked from commit a6a3f322453d35074a4866f2fda08781722cbc72)

4 months agoPush some time conversions down
Paul Eggert [Sun, 7 Jul 2024 18:50:47 +0000 (20:50 +0200)]
Push some time conversions down

* src/timefns.c: Push some time conversions down to lower level fns.
This is a win in its own right and should allow for further speedups.
(lisp_to_timespec): Remove; this convenience function is no longer
needed now that there would be only one caller.  Remaining caller
changed to use definiens.
(enum cform): New constant CFORM_TIMESPEC.  Also, CFORM_SECS_ONLY
now generates a struct timespec instead of a struct lisp_time.
(union c_time.ts): New member.
(decode_ticks_hz): Handle new struct timespec cases.
(decode_float_time, lisp_time_struct): New arg cform, and return
union c_time rather than struct lisp_time.  All callers changed.
(list4_to_timespec, lisp_time_argument, lisp_seconds_argument):
Let lower-level function do the conversion, to allow for better
optimization.

(cherry picked from commit 34bde2f790decfff61f03c5ab92ad0436958bacf)

4 months agoSplit lisp_to_timespec in two
Paul Eggert [Sun, 7 Jul 2024 14:18:18 +0000 (16:18 +0200)]
Split lisp_to_timespec in two

* src/timefns.c (ticks_hz_to_timespec): New function,
which is almost all the old lisp_to_timespec but with
a 2-arg API.  This should help further changes.
(lisp_to_timespec): Use it.

(cherry picked from commit 22a3a90f7636a9cb55a463a8149d6e3ec12d1b81)

4 months agoRefactor decode_ticks_hz via switch
Paul Eggert [Sun, 7 Jul 2024 14:05:52 +0000 (16:05 +0200)]
Refactor decode_ticks_hz via switch

* src/timefns.c (decode_ticks_hz): Change ?: to ‘switch’,
for benefit of future changes.

(cherry picked from commit c45ae286b540f1fc4e424a04eb1d423037cab19c)

4 months agoRefactor timefns order
Paul Eggert [Sun, 7 Jul 2024 13:42:10 +0000 (15:42 +0200)]
Refactor timefns order

Move definitions around in timefns.c.  This does not affect the
implementation; it merely makes future changes easier to follow.
* src/timefns.c (frac_to_double, mpz_time, lisp_to_timespec)
(enum cform, union c_time, decode_ticks_hz): Move earlier.

(cherry picked from commit 0e221d3789a40d22bd4a9489985aebeb86f43e01)

4 months agoRefactor timefns more functionally
Paul Eggert [Sat, 6 Jul 2024 19:52:08 +0000 (21:52 +0200)]
Refactor timefns more functionally

Use a more-functional style in timefns.c, rather than passing
pointers to objects that are filled in.  Although this does not
change behavior, it should help future improvements to the code.
* src/keyboard.c (decode_timer): Return a possibly-invalid struct
timespec instead of storing a timespec into a location specified
by an arg, and returning bool.  All callers changed.
* src/systime.h (struct lisp_time): Move from here to src/timefns.c,
since the type is private to timefns.c.
* src/timefns.c (decode_float_time, decode_ticks_hz):
Return timestamp instead of storing it into a location specified
by an arg.  All callers changed.
(enum cform, union c_time, struct err_time, struct form_time):
New types, to aid functional style.
(decode_time_components): Return struct err_time
instead of returning err and storing timestamp into a location
specified by an arg.  New arg cform.  All callers changed.
(decode_lisp_time): Return struct form_time instead of returning
form and storing timestamp into a location specified by an arg.
New arg cform, replacing decode_secs_only.  All callers changed.
(list4_to_timespec): Return possibly-invalid timestamp instead
of returning a bool and storing timestamp into a location specified
by an arg.  All callers changed.
(lisp_time_struct): Omit no-longer-needed arg PFORM.
All callers changed.

(cherry picked from commit 35365620e4c4c2560e13eba1f03332970129d7f8)

4 months agoTake precautions against ill-formed content URIs
Po Lu [Thu, 11 Jul 2024 03:38:41 +0000 (11:38 +0800)]
Take precautions against ill-formed content URIs

* java/org/gnu/emacs/EmacsService.java (openContentUri)
(checkContentUri): Verify that URIs derived from user-provided
file names can be parsed before attempting to open them.

(cherry picked from commit e0b271e279ba5b606330908604ac4fa42a389b30)

4 months agoetags-regen-mode: Handle TAGS buffer being killed
Dmitry Gutov [Thu, 11 Jul 2024 00:49:06 +0000 (03:49 +0300)]
etags-regen-mode: Handle TAGS buffer being killed

* lisp/progmodes/etags-regen.el (etags-regen--visit-table):
Use kill-buffer-hook to ensure a refresh if the TAGS buffer is
killed manually (bug#71727).
(etags-regen--tags-cleanup):
Bind the hook var to nil to avoid an infloop.

(cherry picked from commit 9331ab056a426b334d46c38659c9de2053eb45f3)

4 months ago; Tag ERC multiline blanks test as :expensive
F. Jason Park [Wed, 10 Jul 2024 22:36:38 +0000 (15:36 -0700)]
; Tag ERC multiline blanks test as :expensive

* test/lisp/erc/erc-tests.el
(erc--check-prompt-input-for-multiline-blanks): Move message-capturing
business outside of primary fixture.  Extend subprocess sleep duration
to 5m.  Delete some unreachable code.  (Bug#72004)

(cherry picked from commit ef3f26ec02d49f00a14e8744ba06208773588c62)

4 months agoImprove 'put-image' documentation
Robert Pluim [Tue, 9 Jul 2024 15:14:45 +0000 (17:14 +0200)]
Improve 'put-image' documentation

* doc/lispref/display.texi (Showing Images): Mention that it returns the
created overlay.
* lisp/image.el (put-image): And here.

(cherry picked from commit 945335fec1e9349d05291c9abe0730777840f5b9)

4 months agoImprove 'set-fontset-font' documentation
Robert Pluim [Fri, 19 Apr 2024 13:16:34 +0000 (15:16 +0200)]
Improve 'set-fontset-font' documentation

* doc/emacs/mule.texi (Modifying Fontsets): Add an 'emoji' example.

(cherry picked from commit c38d5cc3b280394bbbb9b579cbc82455077ac9b1)

4 months agoAdapt Tramp's "run0" method
Michael Albinus [Wed, 10 Jul 2024 09:58:22 +0000 (11:58 +0200)]
Adapt Tramp's "run0" method

* doc/misc/tramp.texi (Inline methods):
* etc/NEWS: Adapt "run0" entry.

* lisp/net/tramp-sh.el (tramp-enable-run0-method): Adapt "run0"
arguments.

(cherry picked from commit 7de4dbea08f43bcbcfa0f6103356ed444af1a2c3)

4 months ago* test/src/sqlite-tests.el (sqlite-execute-batch): Declare to wave warning.
Andrea Corallo [Tue, 9 Jul 2024 19:17:48 +0000 (21:17 +0200)]
* test/src/sqlite-tests.el (sqlite-execute-batch): Declare to wave warning.

(cherry picked from commit 871585db4ca71371e577e521d94caacc1b473e59)

4 months agoCapitalize "Dired" and "Lisp" in docstrings
Stefan Kangas [Tue, 9 Jul 2024 22:26:22 +0000 (00:26 +0200)]
Capitalize "Dired" and "Lisp" in docstrings

* lisp/desktop.el (desktop-no-desktop-file-hook):
* lisp/dired-x.el (dired-mark-sexp):
* lisp/dired.el (dired-make-directory-clickable)
(dired-map-over-marks, dired-file-name-at-point)
(dired-save-positions, dired-buffers-for-dir)
(dired-buffers-for-dir-or-subdir, dired-fun-in-all-buffers)
(dired-remove-entry, dired-delete-entry, dired-jump):
* lisp/files.el (save-buffer):
* lisp/find-dired.el (find-ls-option):
* lisp/hilit-chg.el:
* lisp/locate.el (locate-mode):
* lisp/msb.el (msb-dired-item-handler, msb-sort-by-directory):
* lisp/printing.el (pr-ps-printer-alist, pr-ps-utility-alist):
* lisp/uniquify.el (uniquify-trailing-separator-p):
* lisp/wdired.el (wdired, wdired-change-to-dired-mode, wdired-exit):
* lisp/woman.el (woman-dired-define-keys, woman-dired-find-file):
Capitalize "Dired" and "Lisp" in docstrings.  Found with checkdoc.

(cherry picked from commit 5cf8d60e0dec5606a94749d17a5d678455b7a437)

4 months agoDocument Eshell entry points
Jim Porter [Mon, 8 Jul 2024 04:24:47 +0000 (21:24 -0700)]
Document Eshell entry points

* doc/misc/eshell.texi (Entry Points): New chapter.
(Scripts): Move under Entry Points.  Expand documentation.

(cherry picked from commit 37475c9af7a72932c271395ce4681822c792ba34)

4 months ago; Fix bug#69809
Eshel Yaron [Thu, 11 Jul 2024 09:50:03 +0000 (11:50 +0200)]
; Fix bug#69809

4 months agoRemove 'enable-recursive-minibuffers'
Eshel Yaron [Wed, 10 Jul 2024 20:38:29 +0000 (22:38 +0200)]
Remove 'enable-recursive-minibuffers'

Thus fixing the very first change in the Emacs ChangeLog:

1985-05-11  Richard M. Stallman  (rms@mit-prep)

        ...

* minibuf.c: Don't allow entry to minibuffer
while minibuffer is selected.

4 months ago; * test/lisp/net/dbus-tests.el: Fix thinko.
Michael Albinus [Wed, 10 Jul 2024 16:28:43 +0000 (18:28 +0200)]
; * test/lisp/net/dbus-tests.el: Fix thinko.

(cherry picked from commit 29aeed7218c77180eef8afac6056af103069b4b2)