]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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)

4 months ago* lib/timespec-sub.c: Copy manually from Gnulib.
Paul Eggert [Wed, 10 Jul 2024 16:18:07 +0000 (18:18 +0200)]
* lib/timespec-sub.c: Copy manually from Gnulib.

(cherry picked from commit 831539542f90c2844418c8b0657f4c050a3d9dfb)

4 months agoExtend dbus-test04-call-method-authorizable
Michael Albinus [Wed, 10 Jul 2024 07:50:09 +0000 (09:50 +0200)]
Extend dbus-test04-call-method-authorizable

* test/lisp/net/dbus-tests.el
(dbus--test-method-authorizable-handler): New defun.
(dbus-test04-call-method-authorizable): Extend test.

(cherry picked from commit a29a385ee5ea938ed17d94622c7bfd0a10e84830)

4 months ago* configure.ac: Fix typo in commentary of strlen substitute.
Po Lu [Wed, 10 Jul 2024 02:39:33 +0000 (10:39 +0800)]
* configure.ac: Fix typo in commentary of strlen substitute.

(cherry picked from commit 338337ec32a210c611231313b3da70a815b2af0f)

4 months agoImprove Eshell's behavior when waiting for processes
Jim Porter [Sat, 6 Jul 2024 21:09:08 +0000 (14:09 -0700)]
Improve Eshell's behavior when waiting for processes

This has a few benefits.  First, it fixes a race condition when killing
old processes in 'eshell-command'.  Second, the "wait" built-in command
is now more useful.  Finally, killing processes when exiting Eshell (via
'eshell-round-robin-kill') should be much faster.

* lisp/eshell/esh-proc.el (esh-opt): Require.
(eshell-wait-for-process): Make obsolete in favor of...
(eshell-wait-for-processes): ... this.  Accept a timeout and support
PIDs.  Update callers.
(eshell/wait): New implementation accepting -t/--timeout.
(eshell-round-robin-kill): Use 'eshell-wait-for-processes'.

* lisp/eshell/eshell.el (eshell-command): Use 'eshell-round-robin-kill'.

* doc/misc/eshell.texi (List of Built-ins): Document the new "wait"
behavior.

* etc/NEWS: Announce this change.

(cherry picked from commit 8e46f44ea0eb761e24beda8c5cdbc8fcca87307a)

4 months agoDon't use the Lisp implementation of "kill" in remote Eshell directories
Jim Porter [Wed, 10 Jul 2024 00:19:26 +0000 (17:19 -0700)]
Don't use the Lisp implementation of "kill" in remote Eshell directories

* lisp/eshell/esh-proc.el (eshell/kill): When in a remote directory,
fall back to the external "kill" program (bug#72013).

(cherry picked from commit 342998511add79c594a170dc04ecda2f2db0fd36)

4 months ago* test/src/comp-tests.el (compile-forms): Simplify test.
Andrea Corallo [Tue, 9 Jul 2024 20:31:34 +0000 (22:31 +0200)]
* test/src/comp-tests.el (compile-forms): Simplify test.

(cherry picked from commit 57defada883c7b93117246c52a383d417f77c765)

4 months agoSupport interpreted functions as input for 'native-compile' (bug#71934)
Andrea Corallo [Tue, 9 Jul 2024 19:11:43 +0000 (21:11 +0200)]
Support interpreted functions as input for 'native-compile' (bug#71934)

* lisp/emacs-lisp/comp.el (comp--spill-lap-single-function): New function.
(comp--spill-lap-function): Make use of and do not accept
'(closure ...' as input.
(comp--spill-lap-function): Specialize on interpreted functions as
well.
(native-compile): Update doc.
* test/src/comp-tests.el (compile-interpreted-functions): New test.

(cherry picked from commit b9b9322a8e62299a223ff6673ed33de90d513bc4)

4 months agoNew commands for filtering minibuffer completions
Eshel Yaron [Wed, 10 Jul 2024 19:56:52 +0000 (21:56 +0200)]
New commands for filtering minibuffer completions

4 months agoNew function 'refactor-query-apply-edits'
Eshel Yaron [Wed, 10 Jul 2024 14:30:11 +0000 (16:30 +0200)]
New function 'refactor-query-apply-edits'

4 months ago; Update ldefs-boot.el
Eshel Yaron [Tue, 9 Jul 2024 18:26:01 +0000 (20:26 +0200)]
; Update ldefs-boot.el

4 months ago; * lisp/net/shr.el (shr-image-zoom-levels): Fix wrong type.
Mattias Engdegård [Tue, 9 Jul 2024 16:30:48 +0000 (18:30 +0200)]
; * lisp/net/shr.el (shr-image-zoom-levels): Fix wrong type.

(cherry picked from commit ac797f60160848fb625db4855befc68352d6cbd2)

4 months agoUse cheaper string constructors
Mattias Engdegård [Tue, 9 Jul 2024 08:01:03 +0000 (10:01 +0200)]
Use cheaper string constructors

* src/coding.c (make_string_from_utf8):
* src/fileio.c (file_name_directory):
* src/lread.c (Fintern):
* src/gnutls.c (Fgnutls_format_certificate):
Use `make_multibyte_string` and `make_unibyte_string` instead of
more expensive `make_specified_string` and `make_string_from_bytes`.

(cherry picked from commit 7e358aa706f9dbfce24304e8a05904538615537f)

4 months agoWarn if D-Bus error "InteractiveAuthorizationRequired" occurs
Michael Albinus [Tue, 9 Jul 2024 15:37:50 +0000 (17:37 +0200)]
Warn if D-Bus error "InteractiveAuthorizationRequired" occurs

* lisp/net/dbus.el
(dbus-error-interactive-authorization-required): New defconst.
(dbus-warn-interactive-authorization-required): New defun.
(dbus-event-error-functions): Add it.

(cherry picked from commit acfc3884bf58f7b407c42c8751affbcb365eb105)

4 months agoFix bug#71929
Po Lu [Tue, 9 Jul 2024 14:00:39 +0000 (22:00 +0800)]
Fix bug#71929

* src/image.c (free_image_cache): Unconditionally release image
cache, as this function is only called with its existence
already established.

* src/xfaces.c (free_frame_faces): Clear FRAME_IMAGE_CACHE (f).
(bug#71929)

(cherry picked from commit 8350ebd22e983df5eb9ad33d427bd3d6a09ffe7f)

4 months ago; * src/dbusbind.c (Fdbus_message_internal): Fix coding style.
Po Lu [Tue, 9 Jul 2024 13:16:47 +0000 (21:16 +0800)]
; * src/dbusbind.c (Fdbus_message_internal): Fix coding style.

(cherry picked from commit 4ca35cbb6ebe9b2bd0690d73b9ff722be7e07b2c)

4 months ago; Change `imap-shell-host` docstring to mention SSH
Stefan Kangas [Tue, 9 Jul 2024 12:09:20 +0000 (14:09 +0200)]
; Change `imap-shell-host` docstring to mention SSH

* lisp/net/imap.el (imap-shell-host): Doc fix; mention SSH instead of
rlogin.

(cherry picked from commit 8f96e0064fa701655413bdeb4612b5b2a63102c4)

4 months agoAdapt dbus-tests.el
Michael Albinus [Tue, 9 Jul 2024 12:01:07 +0000 (14:01 +0200)]
Adapt dbus-tests.el

* test/lisp/net/dbus-tests.el
(dbus-test04-call-method-authorizable): New test.
(dbus--test-signal-handler): Remove debug message.

(cherry picked from commit 813ca8c214a7105190d359edcbedcf30aafb0bfa)

4 months agoSupport interactive D-Bus authorization
Steven Allen [Tue, 9 Jul 2024 11:16:43 +0000 (13:16 +0200)]
Support interactive D-Bus authorization

When invoking D-Bus methods, let the user enable interactive
authorization by passing an :authorizable t parameter.  This makes
it possible to D-Bus methods that require polkit authorization.

* configure.ac (HAVE_DBUS_MESSAGE_SET_ALLOW_INTERACTIVE_AUTHORIZATION):
Set a new variable if `dbus_message_set_allow_interactive_authorization'
is available.

* src/dbusbind.c (dbus-message-internal): Allow interactive
authorization by passing :authorizable t.

* doc/misc/dbus.texi (Synchronous Methods, Asynchronous Methods):
* etc/NEWS:
* lisp/net/dbus.el (dbus-call-method-asynchronously): Document the
new parameter.

(cherry picked from commit 551a71c313be26d067e59fa11c79e4ef5c550e92)

4 months agoMake D-Bus tests stable
Michael Albinus [Tue, 9 Jul 2024 10:11:13 +0000 (12:11 +0200)]
Make D-Bus tests stable

* test/lisp/net/dbus-tests.el (dbus-debug): Declare, not define.
(dbus--test-event-expected): New defvar.
(dbus--test-signal-handler): Check for `dbus--test-event-expected'.
(dbus-test05-register-signal-with-nils)
(dbus-test08-register-monitor): Adapt tests.

(cherry picked from commit 24cad0e2e773a6f9cbd4a9721694a44246a7c974)

4 months ago; Skip commit d883f9a1f35c5daed877e4a96ecd7e31c259dc40
Eshel Yaron [Tue, 9 Jul 2024 17:50:48 +0000 (19:50 +0200)]
; Skip commit d883f9a1f35c5daed877e4a96ecd7e31c259dc40

4 months ago* etc/TODO (Native compiler improvements): Add entry.
Andrea Corallo [Tue, 9 Jul 2024 09:03:04 +0000 (11:03 +0200)]
* etc/TODO (Native compiler improvements): Add entry.

(cherry picked from commit e53f0f4869600f698e9d8c9527aaf5fba9ec1243)

4 months agoFix bug#70697 with respect to fringe bitmaps
Po Lu [Tue, 9 Jul 2024 06:10:07 +0000 (14:10 +0800)]
Fix bug#70697 with respect to fringe bitmaps

* src/pgtkterm.c (pgtk_draw_fringe_bitmap): Always call
`fill_background_by_face' for clearing backgrounds of fringe
bitmaps.  (bug#70697)

(cherry picked from commit 671ad83026e0f9727a809311d43fd7a57403b33b)

4 months agoFix byte-compiler warning in calc.el
Po Lu [Tue, 9 Jul 2024 01:35:16 +0000 (09:35 +0800)]
Fix byte-compiler warning in calc.el

* lisp/calc/calc.el
(calc-embedded-open-close-new-formula-alist): Remove previously
introduced quotation marks, as they bring the width of the doc
string past 80.

(cherry picked from commit 15c591bad6282824adf33fa195733da416d3fef2)

4 months agoeditorconfig-core-handle.el: Fix regressions in fnmatch handling
Stefan Monnier [Mon, 8 Jul 2024 21:09:31 +0000 (17:09 -0400)]
editorconfig-core-handle.el: Fix regressions in fnmatch handling

* lisp/editorconfig-core-handle.el
(editorconfig-core-handle-get-properties-hash): Fix computation of
relative file name.
(editorconfig-core-handle--fnmatch-p): Handle the case when `pattern`
doesn't have a `/` but does match the `/` character.

(cherry picked from commit dce31372a60a9d37591671b8570169c9117e416a)

4 months agoCheckdoc fixes in `url/*.el`
Stefan Kangas [Mon, 8 Jul 2024 15:49:14 +0000 (17:49 +0200)]
Checkdoc fixes in `url/*.el`

* lisp/url/url-util.el (url-query-key-value-allowed-chars):
* lisp/url/url.el (url-retrieve-synchronously): Checkdoc fixes.

(cherry picked from commit ed2986494c7c3fb6aaeb7647c6812c4091500222)