]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 weeks agoCheck for end-of-file when reading character escapes (bug#79097)
Mattias Engdegård [Fri, 25 Jul 2025 19:53:37 +0000 (21:53 +0200)]
Check for end-of-file when reading character escapes (bug#79097)

* src/lread.c (read_char_escape): Add check.
* test/src/lread-tests.el (lread-char-escape-eof): New test.

(cherry picked from commit 33161e51e539eadeb11282c06df73a5d76afdff2)

2 weeks agoVC: New support for other working trees
Sean Whitton [Fri, 25 Jul 2025 18:34:04 +0000 (19:34 +0100)]
VC: New support for other working trees

* lisp/vc/vc-git.el (vc-git--read-start-point): New function,
factored out of vc-git-create-tag.
(vc-git-create-tag): Use it.
(vc-git--worktrees, vc-git-known-other-working-trees)
(vc-git-add-working-tree, vc-git-delete-working-tree)
(vc-git-move-working-tree):
* lisp/vc/vc-hg.el (vc-hg-known-other-working-trees)
(vc-hg-add-working-tree, vc-hg--shared-p)
(vc-hg-delete-working-tree, vc-hg-move-working-tree): New
functions.
* lisp/vc/vc.el: Define API for known-other-working-tree,
add-working-tree, delete-working-tree and move-working-tree
backend functions.
(vc-dir-status-files): New function.
(project-current-directory-override): Declare.
(dired-rename-subdir): Autoload.
(vc-add-working-tree, vc-switch-working-tree)
(vc-delete-working-tree, vc-move-working-tree): New commands.
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind them under C-x v.

* doc/emacs/vc1-xtra.texi (Other Working Trees): New node.
* etc/NEWS: Announce the new commands.

* test/lisp/vc/vc-tests/vc-tests.el
(vc-test--other-working-trees): New function.
(vc-test-git07-other-working-trees)
(vc-test-hg07-other-working-trees): New tests.

* lisp/ldefs-boot.el: Regenerate.

(cherry picked from commit 50ffb29d0bbb92a7c6569c83d2e3e4868c4e867b)

2 weeks agovc-test--version-diff: Bind vc-async-checkin
Sean Whitton [Fri, 25 Jul 2025 18:04:07 +0000 (19:04 +0100)]
vc-test--version-diff: Bind vc-async-checkin

* test/lisp/vc/vc-tests/vc-tests.el (vc-test--version-diff):
Bind vc-async-checkin to disable async checkins during test.

(cherry picked from commit 08ca6caa0a081cd67d253b09896c3789268da7a1)

2 weeks ago; * doc/emacs/vc-xtra.texi (Advanced VC Usage): Fix menu.
Sean Whitton [Fri, 25 Jul 2025 17:59:46 +0000 (18:59 +0100)]
; * doc/emacs/vc-xtra.texi (Advanced VC Usage): Fix menu.

(cherry picked from commit 4187320263390a5badf7d141f71d19ffed20662d)

2 weeks agoBind vc-rename-file to C-x v R
Sean Whitton [Fri, 25 Jul 2025 17:45:59 +0000 (18:45 +0100)]
Bind vc-rename-file to C-x v R

* lisp/vc/vc-hooks.el (vc-prefix-map): Bind vc-rename-file to
C-x v R.
* doc/emacs/files.texi (Copying and Naming):
* doc/emacs/vc1-xtra.texi (VC Delete/Rename, Revision Tags):
* etc/NEWS (bindings): Document the new binding.

(cherry picked from commit 09e205fe60f074e143298e306431cb62b60a890c)

2 weeks ago; * lisp/international/quail.el (quail-insert-kbd-layout): Commentary.
Eli Zaretskii [Fri, 25 Jul 2025 12:25:40 +0000 (15:25 +0300)]
; * lisp/international/quail.el (quail-insert-kbd-layout): Commentary.

(cherry picked from commit 5f3cbd62b1cfc853987ef7a163d6dffe029cfa07)

2 weeks ago; Skip commit 2143969580eb3ddcc0bda180800cb90cbe468c7c
Eshel Yaron [Sat, 26 Jul 2025 13:45:17 +0000 (15:45 +0200)]
; Skip commit 2143969580eb3ddcc0bda180800cb90cbe468c7c

2 weeks ago; face-font-family-alternatives, fixed-pitch: Comments.
Sean Whitton [Fri, 25 Jul 2025 08:05:24 +0000 (09:05 +0100)]
; face-font-family-alternatives, fixed-pitch: Comments.

(cherry picked from commit 47deb38f2143bd981a7d3f1988d5cae6a7d2c64c)

2 weeks agoStreamline init_callproc a bit
Paul Eggert [Fri, 25 Jul 2025 02:44:48 +0000 (19:44 -0700)]
Streamline init_callproc a bit

* src/callproc.c (init_callproc): Don’t bother testing for the
existence of ../src/ and NEWS if installation-directory is
non-nil, because in that case we will test for ../etc/NEWS anyway.
Simplify by using AUTO_STR.

(cherry picked from commit c403bc4d51e8466833ff728fddcca7ffe69740ee)

2 weeks agoRefactor to allow nameless auto strings
Paul Eggert [Fri, 25 Jul 2025 02:41:01 +0000 (19:41 -0700)]
Refactor to allow nameless auto strings

* src/lisp.h (AUTO_STR, AUTO_STR_WITH_LEN): New macros.
Long ago this sort of thing would have been a no-no
because we needed to GCPRO the strings.
However, GCPRO went away a decade ago.

(cherry picked from commit d7e818608027552aa084eb37e3bf39deedff4921)

2 weeks agoDiagnose load-path only if interactive
Paul Eggert [Thu, 24 Jul 2025 22:02:49 +0000 (15:02 -0700)]
Diagnose load-path only if interactive

* lisp/startup.el (command-line): Warn about dubious
user-emacs-directory and load-path only if interactive, as that’s
where warning helps and the warnings just complicate batch usage
(e.g., -Q).

(cherry picked from commit b01b521717bed33323142aa791a22d46b8af11ad)

2 weeks agoFix Eshell call to 'string-suffix-p' when checking for trailing newline
Jim Porter [Mon, 21 Jul 2025 04:17:05 +0000 (21:17 -0700)]
Fix Eshell call to 'string-suffix-p' when checking for trailing newline

* lisp/eshell/esh-io.el (eshell--output-maybe-n): Fix call.

* test/lisp/eshell/esh-io-tests.el
(esh-io-test/output-newline/add-newline)
(esh-io-test/output-newline/no-newline)
(esh-io-test/output-newline/no-extra-newline): New tests (bug#79063).

(cherry picked from commit dd29b0ab66d63b3b8e890c8de8f8e5c3fb44217a)

2 weeks ago* etc/PROBLEMS: Describe how to work around screen reader TAB issue
Robert Pluim [Mon, 21 Jul 2025 13:44:49 +0000 (15:44 +0200)]
* etc/PROBLEMS: Describe how to work around screen reader TAB issue

(cherry picked from commit cbfc095ed42be5fd2b848cb837b3340670fe9ef6)

2 weeks ago(gnus)Scoring Tips: New tip regarding header continuation lines
Sean Whitton [Mon, 21 Jul 2025 08:54:02 +0000 (09:54 +0100)]
(gnus)Scoring Tips: New tip regarding header continuation lines

* doc/misc/gnus.texi (Scoring Tips): New "Continuation lines
when scoring on other headers" tip.

(cherry picked from commit 8f00d36b63dc6c57ad2fd4f387841e4ac9e68225)

2 weeks agoPATH defaults now act more like GNU and POSIX
Paul Eggert [Thu, 24 Jul 2025 21:49:52 +0000 (14:49 -0700)]
PATH defaults now act more like GNU and POSIX

When PATH is unset or empty, use the system default,
to be consistent with GNU/Linux and with POSIX.
If there is no system default do not default to "."
as that can be dangerous.
* src/callproc.c (init_callproc_1, init_callproc):
Default PATH to the null pointer, not the empty string.
* src/emacs.c (default_PATH): New function.
(find_emacs_executable, decode_env_path): Be consistent with POSIX
and with glibc about what to do when PATH is unset or empty.

(cherry picked from commit eb9ec79c13f17d610fcb6de49628b8a7686fbab7)

2 weeks ago; Fix file name in "Loading Files" doc.
Paul Eggert [Thu, 24 Jul 2025 21:37:20 +0000 (14:37 -0700)]
; Fix file name in "Loading Files" doc.

(cherry picked from commit 6a08a9a54d4ff5aafe795c7a079709993c08dff3)

2 weeks agoTreat ‘.../emacs’ like ‘emacs’ in realpath startup
Paul Eggert [Thu, 24 Jul 2025 12:32:37 +0000 (05:32 -0700)]
Treat ‘.../emacs’ like ‘emacs’ in realpath startup

* src/emacs.c (find_emacs_executable): If the executable name
contains a slash, use the same optimization for symlink resolution
that we already use when the executable name has no slash.

(cherry picked from commit d59fe6dad5667720b296569d2f6fe1b84d42fd0a)

2 weeks agoPrefer readlink to lstat in find_emacs_executable
Paul Eggert [Thu, 24 Jul 2025 12:17:35 +0000 (05:17 -0700)]
Prefer readlink to lstat in find_emacs_executable

* src/emacs.c (find_emacs_executable): Prefer readlink to lstat
when testing whether a file is a symlink.  This avoids EOVERFLOW
issues.

(cherry picked from commit 67ea9485a65dee4fb654f1bc177c71028d020607)

2 weeks agoFix minor memory leak in find_emacs_executable
Paul Eggert [Thu, 24 Jul 2025 12:15:15 +0000 (05:15 -0700)]
Fix minor memory leak in find_emacs_executable

* src/emacs.c (find_emacs_executable): Free candidate if unused.

(cherry picked from commit 670603533c35645fa732092b441faae55ddb1a6a)

2 weeks ago; Revert last change
Michael Albinus [Thu, 24 Jul 2025 16:48:26 +0000 (18:48 +0200)]
; Revert last change

* lisp/net/tramp-smb.el
(tramp-connection-local-default-system-variables): Add "" to
`exec-suffixes'.  (Bug#78886)

(cherry picked from commit ec96ea30ba8911c34a664d8d9989d9a64380e073)

2 weeks agoUse macro to reduce repetition in TLS tests
Robert Pluim [Tue, 22 Jul 2025 12:48:54 +0000 (14:48 +0200)]
Use macro to reduce repetition in TLS tests

* test/lisp/net/network-stream-tests.el (with-tls-params): New
macro, abstracts most of the boiler plate for TLS tests.
(connect-to-tls-ipv4-wait, connect-to-tls-ipv4-nowait)
(connect-to-tls-ipv6-nowait, open-network-stream-tls-wait)
(open-network-stream-tls-nowait, open-network-stream-tls)
(open-network-stream-tls-nocert)
(open-gnutls-stream-new-api-default)
(open-gnutls-stream-new-api-wait)
open-gnutls-stream-old-api-wait)
(open-gnutls-stream-new-api-nowait)
(open-gnutls-stream-old-api-nowait): Use it.

(cherry picked from commit 5cce567f20098fafa809fdefc468f493f95921fc)

2 weeks agoDisable setting connection-local variables in tramp-smb.el
Michael Albinus [Thu, 24 Jul 2025 13:30:13 +0000 (15:30 +0200)]
Disable setting connection-local variables in tramp-smb.el

* lisp/net/tramp-smb.el: Disable setting connection-local
variables.  (Bug#78886)

(cherry picked from commit 7ade5bd9fbbdf45906c46d5ac9bb2e10bb2e660b)

2 weeks ago(repeat-mode): Simplify.
Eshel Yaron [Fri, 25 Jul 2025 17:15:34 +0000 (19:15 +0200)]
(repeat-mode): Simplify.

2 weeks agoDon’t read before BEG in insert-file-contents
Paul Eggert [Thu, 24 Jul 2025 00:44:38 +0000 (17:44 -0700)]
Don’t read before BEG in insert-file-contents

* src/fileio.c (Finsert_file_contents): Don’t sample bytes before BEG.
Give up optimizing if the file size shrinks to less than BEG.

(cherry picked from commit e026b57f077e4a6dcce9c24e31dbf7107b88d409)

2 weeks agoSimplify file end finding in insert-file-contents
Paul Eggert [Thu, 24 Jul 2025 00:38:32 +0000 (17:38 -0700)]
Simplify file end finding in insert-file-contents

* src/fileio.c (Finsert_file_contents): Don’t give up finding the
file’s end merely because SEEK_END fails.  Try a small test read
anyway.  This might work in non-POSIX file systems where SEEK_END
is not allowed, and trying is easy and simplifies the code.

(cherry picked from commit 4c791549496d1edbed7ba792994381e6cdc01184)

2 weeks agoGCC bug 119085 fixed in GCC 16
Paul Eggert [Wed, 23 Jul 2025 19:55:13 +0000 (12:55 -0700)]
GCC bug 119085 fixed in GCC 16

* configure.ac (emacs_cv_gcc_bug_119085_CFLAGS):
Assume the bug is fixed starting in GCC 16.

(cherry picked from commit 69af0d4c856962abad975fed57abd20f893ce16e)

2 weeks ago* lisp/repeat.el (repeat-mode): Use 'called-interactively-p'.
Juri Linkov [Wed, 23 Jul 2025 17:56:05 +0000 (20:56 +0300)]
* lisp/repeat.el (repeat-mode): Use 'called-interactively-p'.

This logic is copied from 'define-minor-mode' that displays a message
about mode activation only when called interactively (bug#79081).

(cherry picked from commit 128e8311be5b2c65a106fe4ee96056751d600b0d)

2 weeks agoAdd consistent environment for local process calls in Tramp
Michael Albinus [Wed, 23 Jul 2025 14:22:26 +0000 (16:22 +0200)]
Add consistent environment for local process calls in Tramp

* lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection):
* lisp/net/tramp-androidsu.el (tramp-androidsu-maybe-open-connection):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch):
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band)
(tramp-maybe-open-connection):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-file-acl)
(tramp-smb-handle-file-notify-add-watch)
(tramp-smb-handle-set-file-acl, tramp-smb-maybe-open-connection):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-send-command):
Use `tramp-start-process'.  Do not call `tramp-post-process-creation'.

* lisp/net/tramp.el (with-tramp-local-environment): New defmacro.
(tramp-start-process): New defun.
(tramp-call-process, tramp-call-process-region)
(tramp-process-lines): Use `with-tramp-local-environment'.

(cherry picked from commit c142f0d246095b75bdb3a7d8bc3079a55e48f2b3)

2 weeks agoNS: Fix build with NSTRACE_ENABLED
Gerd Möllmann [Wed, 23 Jul 2025 09:54:38 +0000 (11:54 +0200)]
NS: Fix build with NSTRACE_ENABLED

* src/nsterm.h (NSTRACE_MSG_NO_DASHES): Use
nstrace_enabled_global.
* src/nsterm.m: ([EmacsView performDragOperation:]): Don't use
an NSString.

(cherry picked from commit 2d1d1f31df355bde96b9c033e49c9e2eb7274a1d)

2 weeks agoHandle Eshell prompts where stickiness properties are 't'
Jim Porter [Wed, 23 Jul 2025 05:24:15 +0000 (22:24 -0700)]
Handle Eshell prompts where stickiness properties are 't'

Previously, this signaled an error, breaking the prompt (bug#79059).

* lisp/eshell/em-prompt.el (eshell--append-text-property): Don't append
to non-list property values.

* test/lisp/eshell/em-prompt-tests.el
(em-prompt-test/field-properties/merge-stickiness): Adapt test.

(cherry picked from commit 0d752f15b86dd3e5329a3f6d4a92e9870a6b8437)

2 weeks agoNS: Use different window collection behavior for tooltips (bug#73037)
Gerd Möllmann [Tue, 22 Jul 2025 11:44:34 +0000 (13:44 +0200)]
NS: Use different window collection behavior for tooltips (bug#73037)

* src/nsterm.m ([EmacsView updateCollectionBehavior]):
Use NSWindowCollectionBehaviorFullScreenAuxiliary for non-native
tooltips which are not child frames.

(cherry picked from commit f177537f701fbd8fd2997cf15cbd4733f9ca1127)

2 weeks agoAdd function exec-suffixes
Michael Albinus [Tue, 22 Jul 2025 15:47:38 +0000 (17:47 +0200)]
Add function exec-suffixes

* doc/lispref/processes.texi (Subprocess Creation):
Add function exec-suffixes.

* etc/NEWS: New function 'exec-suffixes'.
Presentational fixes and improvements.

* lisp/files-x.el (exec-suffixes): New defun.  (Bug#78886)

* lisp/files.el (executable-find): Use function `exec-suffixes'.

* lisp/net/tramp-integration.el
(tramp-connection-local-default-system-variables): Add also
`exec-suffixes'.

* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection): Use
default values of `path-separator', `null-device' and
`exec-suffixes'.
(tramp-smb-connection-local-default-system-variables):
New defconst.  Add it to connection-local profiles.

(cherry picked from commit 5a7a12d7920a94edea175871235c5013f0c73e3c)

2 weeks ago* lisp/custom.el (defcustom): Remove empty doc string.
Mattias Engdegård [Tue, 22 Jul 2025 09:30:02 +0000 (11:30 +0200)]
* lisp/custom.el (defcustom): Remove empty doc string.

It is no longer needed because (lambda () "hello") has no doc string.

(cherry picked from commit b7f2d994c693f1dcd23c38aeeab8b178cb850174)

2 weeks ago* lisp/vc/vc-git.el (vc-git-diff): Don't pass --textconv.
Sean Whitton [Tue, 22 Jul 2025 10:34:44 +0000 (11:34 +0100)]
* lisp/vc/vc-git.el (vc-git-diff): Don't pass --textconv.

This reverts this change:

    Author:     Sean Whitton <spwhitton@spwhitton.name>
    AuthorDate: Mon Jul 21 09:26:59 2025 +0100

      * lisp/vc/vc-git.el (vc-git-diff): Pass --textconv (bug#79050).

(cherry picked from commit d381a7e79932f83aafb4de0340037f393ed031b5)

2 weeks agoinsert-file-contents respect END better
Paul Eggert [Mon, 21 Jul 2025 22:10:56 +0000 (15:10 -0700)]
insert-file-contents respect END better

This fixes some longstanding bugs, along with bugs recently
introduced as part of fixes for Bug#77315.
* src/fileio.c (Finsert_file_contents): Arrange for END_OFFSET
to never be less than BEG_OFFSET, to simplify the code.
Do not go past END_OFFSET when sampling or optimizing reading.
Avoid a few unnecessary lseeks.

(cherry picked from commit eb488e1bba091e745a951ef45069d01e2c49731f)

2 weeks agoinsert-file-contents shrinking Solaris file fix
Paul Eggert [Mon, 21 Jul 2025 21:56:43 +0000 (14:56 -0700)]
insert-file-contents shrinking Solaris file fix

This is related to recent fixes for Bug#77315.
* src/fileio.c (Finsert_file_contents): Defend against
a file shrinking to be smaller than its initial offset.
This can happen only on platforms like Solaris where
the initial offset can be positive.

(cherry picked from commit 8393e469e7f1771b4e167392eef169ab51c047b2)

2 weeks agoRefactor insert-file-contents overlap check
Paul Eggert [Sun, 20 Jul 2025 22:20:31 +0000 (15:20 -0700)]
Refactor insert-file-contents overlap check

* src/fileio.c (Finsert_file_contents):
Simplify and clarify file overlap check.

(cherry picked from commit e879533f4b9cd12a6847f4d69c866c29d5923541)

2 weeks agoinsert-file-contents refactor xlseek
Paul Eggert [Sun, 20 Jul 2025 21:52:46 +0000 (14:52 -0700)]
insert-file-contents refactor xlseek

* src/fileio.c (xlseek): New arg WHENCE.  All uses changed.
This generalizes xlseek and should simplify future changes.

(cherry picked from commit adbae4f92f91350028ff9f604c1e045c171c9cbb)

2 weeks agoSay why quit is captured in insert-file-contents
Paul Eggert [Sun, 20 Jul 2025 20:43:32 +0000 (13:43 -0700)]
Say why quit is captured in insert-file-contents

* src/fileio.c (Finsert_file_contents): Add comment.

(cherry picked from commit d04182d52ad275960bfacd7d9d3853f718c23a3b)

2 weeks agoinsert-file-contents read size increase
Paul Eggert [Sun, 20 Jul 2025 20:40:20 +0000 (13:40 -0700)]
insert-file-contents read size increase

This increases the max read size from 0.25 to 1 MiB, which is a
bit better for Emacs in my measurements.  The old value was taken
from coreutils, but was for a different purpose.
* src/fileio.c (INSERT_READ_SIZE_MAX): New constant, replacing
IO_BUFSIZE.  All uses changed.
(Finsert_file_contents): Do not use a read buffer that is larger
than INSERT_READ_SIZE_MAX.

(cherry picked from commit a8e46f11a89145390ee681e2dd14fbe6ab79b7f0)

2 weeks agoFix insert-file-contents infloop with unlucky END
Paul Eggert [Sun, 20 Jul 2025 19:38:43 +0000 (12:38 -0700)]
Fix insert-file-contents infloop with unlucky END

This partially reverts 55f41ca3aa8fe487d10730708a7396137a2c9d18,
which was a partial fix for Bug#77315.
* src/fileio.c (Finsert_file_contents): Go back to accepting
partial reads when doing the optimized way when code conversion is
not needed.  This avoids an unlikely bug when END happens to lie
at a buffer boundary, causing an infloop.  For consistency, do the
same when doing code conversion (though there’s no bug in then),
as there’s not a real need for emacs_full_read there either.

(cherry picked from commit 27e0f0f79b9c97796fc89fedf3c05517532f0475)

2 weeks agoRefactor by coalescing MAX_RW_COUNT definitions
Paul Eggert [Sun, 20 Jul 2025 16:37:51 +0000 (09:37 -0700)]
Refactor by coalescing MAX_RW_COUNT definitions

* src/emacs.c (read_full):
Simplify by assuming MAX_RW_COUNT is defined.
* src/lisp.h (MAX_RW_COUNT): Move here from src/sysdep.c.
* src/pdumper.c (dump_read_all):
Use MAX_RW_COUNT rather than defining our own equivalent.

(cherry picked from commit 46314aef87fbda25e0a7fb5055624dc1c6e90ad9)

2 weeks agoinsert-file-contents from seekable non-regular
Paul Eggert [Sun, 20 Jul 2025 15:59:16 +0000 (08:59 -0700)]
insert-file-contents from seekable non-regular

* src/fileio.c (Finsert_file_contents): Be more conservative
when reading from seekable non-regular files when END is given.
The code assumed that in this case, reads would succeed or fail
quickly so there was no need to call internal_condition_case_1.
However, in some cases, e.g., /dev/random, it could take a while.
This fixes a glitch introduced in commit
cb4579ed6ba45c81ee7ec627bf197e1def121f24 dated 2022-06-11.

(cherry picked from commit aaf9c5213f7102dca8da7b6aaf1d400419eda075)

2 weeks agoinsert-file-contents beware buffer relocation
Paul Eggert [Sun, 20 Jul 2025 01:04:38 +0000 (18:04 -0700)]
insert-file-contents beware buffer relocation

This fixes a potential (albeit quite unlikely) bug
introduced during recent fixes to Bug#77315.
* src/fileio.c (union read_non_regular.s.inserted):
Bring back this member.
(read_non_regular, Finsert_file_contents): Work in the unlikely
case when internal_condition_case_1 relocates the buffer before
calling read_non_regular.

(cherry picked from commit 49ca3a2151abb1188765c04ad6650b91c2494d1a)

2 weeks agoinsert-file-contents 1 KiB seek fix
Paul Eggert [Sat, 19 Jul 2025 00:29:25 +0000 (17:29 -0700)]
insert-file-contents 1 KiB seek fix

This improves on recent fixes to Bug#77315.
When sampling the first 1 KiB and last 3 KiB, do not seek before
BEG if given.  Instead, sample starting at BEG, to be consistent
with the non-optimized version.
* src/fileio.c (xlseek): Return POS, for convenience.
(Finsert_file_contents): Sample the first 1 KiB correctly when BEG.
In a CURPOS local, keep track of the input file offset, or for
nonseekable files the number of bytes read, while this value is
important.  This lets us avoid some unnecessary seeks.  Report an
error earlier if the file is not seekable and BEG is nonzero,
to save work and simplify the code.  When sampling, discard less
data, as this is simpler and there’s little point to discarding it.

(cherry picked from commit 2903b0b92cfdf87fbbb764c4f202479e9a1ac941)

2 weeks agoinsert-file-contents seek refactoring
Paul Eggert [Fri, 18 Jul 2025 20:56:53 +0000 (13:56 -0700)]
insert-file-contents seek refactoring

* src/fileio.c (xlseek): New function.
(Finsert_file_contents): Use it instead of doing things by hand.
(write_region): Match diagnostic wording to xlseek’s.

(cherry picked from commit ffe6d33ef4ef4afce98a1521a03acd6934cc53d2)

2 weeks agoFix insert-file-contents optimization glitch
Paul Eggert [Fri, 18 Jul 2025 06:00:38 +0000 (23:00 -0700)]
Fix insert-file-contents optimization glitch

This improves on recent fixes to Bug#77315.
* src/fileio.c (Finsert_file_contents): When optimizing
do not seek to 0 if the initial file offset is positive,
as that causes the optimized code to behave differently
from the nonoptimized.

(cherry picked from commit 5f4b71b0c4872b6bd9f8b4ced9f4715062db1bad)

2 weeks agoinsert-file-contents SEEK_END optimization
Paul Eggert [Thu, 17 Jul 2025 17:46:33 +0000 (10:46 -0700)]
insert-file-contents SEEK_END optimization

This improves on recent fixes to Bug#77315.
* src/fileio.c (Finsert_file_contents):
Do not give up on seeking merely because SEEK_END fails.
On some files (/proc/cpuinfo, say) SEEK_END can fail
even though SEEK_SET and SEEK_CUR succeed, and the
code still works in this case.

(cherry picked from commit 1b517a4fe0a8362160c5aee403baf29952d5d559)

2 weeks agoinsert-file-contents st_size cleanup
Paul Eggert [Thu, 17 Jul 2025 16:50:07 +0000 (09:50 -0700)]
insert-file-contents st_size cleanup

* src/fileio.c (Finsert_file_contents): Store st_size,
not file_size_hint, into current_buffer->modtime_size,
since modtime_size is compared to a later st_size, not
to the actual file size.  Simplify buffer overflow detection
from file size, since this occurred only on regular files.

(cherry picked from commit 8d83402edc96b5a88096ae707241f4e8cb59691b)

2 weeks agoImprove documentation of 'quit-window'
Eli Zaretskii [Mon, 21 Jul 2025 12:35:36 +0000 (15:35 +0300)]
Improve documentation of 'quit-window'

* lisp/window.el (quit-window): Mention 'quit-window-kill-buffer'.
(quit-window): Doc fix.

* doc/lispref/windows.texi (Quitting Windows):
* etc/NEWS: Improve documentation of 'quit-window-kill-buffer'.

(cherry picked from commit 5485bda52399a23d95ab593dcb748975ee0654d0)

2 weeks ago; * lisp/simple.el (shell-command): Fix last change (bug#79067).
Eli Zaretskii [Mon, 21 Jul 2025 10:41:18 +0000 (13:41 +0300)]
; * lisp/simple.el (shell-command): Fix last change (bug#79067).

(cherry picked from commit 527dc4fafff13a86cc1b9c6dfc174c592a29b566)

2 weeks ago; * lisp/vc/vc-cvs.el (vc-cvs-file-to-string): Simplify slightly.
Sean Whitton [Mon, 21 Jul 2025 10:04:34 +0000 (11:04 +0100)]
; * lisp/vc/vc-cvs.el (vc-cvs-file-to-string): Simplify slightly.

(cherry picked from commit 0a0ff0383906e519ed9b8f8c471b8ef5c44a3092)

2 weeks ago* lisp/vc/vc-git.el (vc-git-diff): Pass --textconv (bug#79050).
Sean Whitton [Mon, 21 Jul 2025 08:26:59 +0000 (09:26 +0100)]
* lisp/vc/vc-git.el (vc-git-diff): Pass --textconv (bug#79050).

(cherry picked from commit 90fc061fd2d2ca95c91c4db74c6f58ec95f9620b)

2 weeks agoAdd an example for the :authorizable `dbus-call-method' keyword
Steven Allen [Mon, 21 Jul 2025 07:50:33 +0000 (09:50 +0200)]
Add an example for the :authorizable `dbus-call-method' keyword

This was requested in bug#71969 over a year ago.

* doc/misc/dbus.texi (Synchronous Methods): Add example for
`dbus-call-method' with authorization.  (Bug#79062)

(cherry picked from commit 59575c32aa1e0d28c1c7113f1ce73cb64cec8e92)

2 weeks agoHandle an error of file-notify-add-watch in autorevert.el
Michael Albinus [Mon, 21 Jul 2025 07:24:23 +0000 (09:24 +0200)]
Handle an error of file-notify-add-watch in autorevert.el

* lisp/autorevert.el (auto-revert-notify-add-watch):
Disable `auto-revert-use-notify' in the buffer when
`file-notify-add-watch' fails.

(cherry picked from commit ef84a1b2d65e187988ae4e66306ac17244a68fc5)

2 weeks ago; * lisp/eshell/esh-cmd.el (eshell-lisp-command): Simplify.
Jim Porter [Sun, 20 Jul 2025 23:05:00 +0000 (16:05 -0700)]
; * lisp/eshell/esh-cmd.el (eshell-lisp-command): Simplify.

(cherry picked from commit cb2de766149e47a7ffe245f7c78ff414ead69d78)

2 weeks agoDisable track-changes while reloading pages in EWW
Jim Porter [Sun, 20 Jul 2025 20:11:32 +0000 (13:11 -0700)]
Disable track-changes while reloading pages in EWW

This makes sure 'eww--track-changes' doesn't interfere with the initial
rendering process.  Previously, this caused problems like <textareas>
consuming the rest of the page when reloading the document.

* lisp/net/eww.el (eww--change-tracker-id): New variable.
(eww-display-document): Temporarily unregister our change tracker.

* test/lisp/net/eww-tests.el (eww-test/tag/textarea/reload): New test.

(cherry picked from commit dc38f05757520f3cae61ae1b3c204728d8b1d6c7)

2 weeks agoFix EWW <textarea> properties when it's on the same line as other text
Jim Porter [Sun, 20 Jul 2025 19:49:40 +0000 (12:49 -0700)]
Fix EWW <textarea> properties when it's on the same line as other text

* lisp/net/eww.el (eww-tag-textarea): Set 'start' after ensuring
preceding newline.

* test/lisp/net/eww-tests.el (eww-test/tag/textarea/starts-on-new-line):
New test.

(cherry picked from commit 49376118a1cec24d185fdf1ed2d5bb5bfc116699)

2 weeks agoImprove error message for "C-u M-! something &"
Eli Zaretskii [Sun, 20 Jul 2025 08:36:35 +0000 (11:36 +0300)]
Improve error message for "C-u M-! something &"

* lisp/simple.el (shell-command): User-friendlier error message
when async shell command is invoked with a prefix argument.

(cherry picked from commit 852009b4f1c9a821ded0cc566d63395c6986ccaa)

2 weeks agoDefine setfunction for bibtex-generate-url-list (bug#78798)
Roland Winkler [Sun, 20 Jul 2025 06:01:12 +0000 (01:01 -0500)]
Define setfunction for bibtex-generate-url-list (bug#78798)

        * lisp/textmodes/bibtex.el
        (bibtex-generate-url-list-init): New function.

        * lisp/textmodes/bibtex.el (bibtex-generate-url-list)
        (bibtex-font-lock-url-regexp): Use it.

(cherry picked from commit e6c1ec71b729088769a2842525ff8df738fa99c6)

2 weeks agoMake sure we always set the ':readable' state when displaying EWW page
Jim Porter [Sun, 20 Jul 2025 03:24:32 +0000 (20:24 -0700)]
Make sure we always set the ':readable' state when displaying EWW page

* lisp/net/eww.el (eww-display-html): Always set ':readable'.
* test/lisp/net/eww-tests.el (eww-test/readable/reload-resets-readable):
New test.

(cherry picked from commit 49696b5cd178431b1975a1adef955a348c8b25b0)

2 weeks agolisp/vc: Try and avoid quoting lambdas
Stefan Monnier [Sat, 19 Jul 2025 18:42:12 +0000 (14:42 -0400)]
lisp/vc: Try and avoid quoting lambdas

* lisp/vc/pcvs.el (cvs-menu, cvs-minor-mode-map):
* lisp/vc/vc-hg.el (vc-hg--extract-headers):
* lisp/vc/vc-git.el (vc-git-show-stash): Don't quote lambdas.

(cherry picked from commit e35e18ac18cfa968978ec7fbfa59432fc1852178)

2 weeks ago; Avoid lexical-binding warning in lread-tests
Eli Zaretskii [Sat, 19 Jul 2025 17:50:57 +0000 (20:50 +0300)]
; Avoid lexical-binding warning in lread-tests

* test/src/lread-tests.el (lread-test-bug-31186)
(lread-tests--unescaped-char-literals): Avoid lexical-binding warning.

(cherry picked from commit 7300f5000785a942a14847fccb534748f53e0628)

2 weeks agoFix send-to on non-macOS platforms and macOS crash on "emacs -nw"
Alvaro Ramirez [Sat, 19 Jul 2025 15:08:25 +0000 (16:08 +0100)]
Fix send-to on non-macOS platforms and macOS crash on "emacs -nw"

* lisp/send-to.el: Both fixes included.

(cherry picked from commit bd5b1c6b085b17870415009cbf63171e3d2fc91f)

2 weeks ago; silence some compiler warnings in tests
Mattias Engdegård [Sat, 19 Jul 2025 15:02:28 +0000 (17:02 +0200)]
; silence some compiler warnings in tests

* test/lisp/savehist-tests.el (savehist-test-saved-variables):
(savehist-test-duplicated-saved-symbols):
* test/src/data-tests.el (binding-test-toplevel-values):
Suppress harmless warnings.

(cherry picked from commit c184ea24414e4940783dfd4a594cb0898d560b6e)

2 weeks agoSpeed up unintern, and fix symbol shorthand edge case (bug#79035)
Mattias Engdegård [Sat, 19 Jul 2025 14:15:47 +0000 (16:15 +0200)]
Speed up unintern, and fix symbol shorthand edge case (bug#79035)

Don't do a full lookup if the argument is a symbol, and only compute the
hash index once.  Fix a bug that occurred when there is another symbol
whose shorthand is equal to the true name of the symbol being removed.

* src/lread.c (Funintern): Rewrite for speed and correctness.
(oblookup_last_bucket_number, oblookup): Remove now unused variable.
* test/src/lread-tests.el (lread-unintern): New test.

(cherry picked from commit f4a9673f615aa8d1fad499784fdcd11ac0ec4042)

2 weeks agoRemove the variable load-convert-to-unibyte
Mattias Engdegård [Sat, 19 Jul 2025 10:40:03 +0000 (12:40 +0200)]
Remove the variable load-convert-to-unibyte

It has been ineffective since 2002.
Suggested by Lynn Winebarger.

* src/lread.c (Fload, readevalloop_1, readevalloop, Feval_buffer)
(Feval_region, syms_of_lread): Remove the variable and its propagation.
* etc/NEWS: Announce.

(cherry picked from commit e9deec70dac822f2f312497c6d7a7bd6b4e648bb)

2 weeks ago; * lisp/tab-line.el (tab-line-exclude-buffers): missing backslash
Mattias Engdegård [Sat, 19 Jul 2025 10:39:33 +0000 (12:39 +0200)]
; * lisp/tab-line.el (tab-line-exclude-buffers): missing backslash

(cherry picked from commit ce90f00feceb64f2dde9a4b4997b9e71a2d52387)

2 weeks agoUpdate Tramp manual
Michael Albinus [Sat, 19 Jul 2025 13:04:36 +0000 (15:04 +0200)]
Update Tramp manual

* doc/misc/tramp.texi (Frequently Asked Questions): Add new items
for Tramp speed up.

(cherry picked from commit a86e33663eb6f3d6146ce360c529ca21b6cd03b1)

2 weeks agoAdd "Send to..." context menu item to mouse.el
Alvaro Ramirez [Sat, 19 Jul 2025 12:30:08 +0000 (12:30 +0000)]
Add "Send to..." context menu item to mouse.el

* lisp/send-to.el: New package implements sending files/region.

* lisp/mouse.el (context-menu-send-to): Add "Send to..." context menu.

* lisp/term/ns-win.el (ns-send-items): Expose native macOS send API.

* src/nsfns.m (ns-send-items): Implement native macOS sending.

* etc/NEWS: Announce the new feature.

(cherry picked from commit 813013691a9997cbdd483e1e5cef39453ac07d6d)

2 weeks agoInclude shorter bindings in diff-mode docstring
Sean Whitton [Sat, 19 Jul 2025 10:17:25 +0000 (11:17 +0100)]
Include shorter bindings in diff-mode docstring

* lisp/vc/diff-mode.el (diff-read-only-map): New keymap,
factored out of code modifying minor-mode-map-alist.
(diff-mode): Include bindings from diff-read-only-map in
docstring (bug#34080).

(cherry picked from commit c56c56b3c68d274fda9cea171f1e530864ee634c)

2 weeks ago; Fix last change (bug#79042)
Eli Zaretskii [Sat, 19 Jul 2025 10:05:05 +0000 (13:05 +0300)]
; Fix last change (bug#79042)

(cherry picked from commit 3b2bfdfef63f051a36f4043c32596458ccae605f)

2 weeks ago; Fix last change
Eli Zaretskii [Sat, 19 Jul 2025 10:04:29 +0000 (13:04 +0300)]
; Fix last change

* lisp/image/image-dired-dired.el
(image-dired-dired-toggle-marked-thumbs): Doc fix (bug#79042),

(cherry picked from commit 740138b113ab420a90b70865ac6dfffcbbc444ee)

2 weeks ago; Update doc strings of Dired functions due to 'marked' value of ARG
Eli Zaretskii [Sat, 19 Jul 2025 09:50:43 +0000 (12:50 +0300)]
; Update doc strings of Dired functions due to 'marked' value of ARG

* lisp/dired-aux.el (dired-do-compress, dired-do-byte-compile)
(dired-do-load, dired-do-redisplay):
* lisp/dired.el (dired-map-over-marks, dired-get-marked-files)
(dired-mouse-drag, dired-do-delete): Doc fixes (bug#79042).

(cherry picked from commit e675d5ba64bc25921cb17ad348103090e7c50a3f)

2 weeks agoSaner defaults for `calendar-read-sexp' (Bug#78964)
Manuel Giraud [Sat, 5 Jul 2025 19:17:00 +0000 (21:17 +0200)]
Saner defaults for `calendar-read-sexp' (Bug#78964)

* lisp/calendar/cal-bahai.el (calendar-bahai-read-date):
* lisp/calendar/cal-china.el (calendar-chinese-goto-date):
* lisp/calendar/cal-coptic.el (calendar-coptic-read-date):
* lisp/calendar/cal-french.el (calendar-french-goto-date):
* lisp/calendar/cal-hebrew.el (calendar-hebrew-read-date):
* lisp/calendar/cal-islam.el (calendar-islamic-read-date):
* lisp/calendar/cal-iso.el (calendar-iso-read-date):
* lisp/calendar/cal-julian.el (calendar-julian-goto-date)
(calendar-astro-goto-day-number):
* lisp/calendar/cal-mayan.el (calendar-mayan-read-haab-date)
(calendar-mayan-read-tzolkin-date):
* lisp/calendar/cal-persia.el (calendar-persian-read-date):
* lisp/calendar/diary-lib.el (diary-insert-cyclic-entry): Use
first day as default.
* lisp/calendar/cal-hebrew.el (calendar-hebrew-list-yahrzeits):
Set the default of end-year as start-year plus ten years.

(cherry picked from commit eb252e645492069621e633d9269a02b778a80678)

2 weeks agoFix for 'windmove-do-window-select' if other-window is 'no-select
git@toki.la [Fri, 11 Jul 2025 19:34:35 +0000 (12:34 -0700)]
Fix for 'windmove-do-window-select' if other-window is 'no-select

If the variable 'windmove-create-window' is set to a function
that returns 'no-select', 'windmove-do-window-select' is intended
to ignore the final window selection.  However, because
'other-window' is passed to 'window-minibuffer-p' before checking
if 'other-window' is 'no-select', 'window-minibuffer-p' will
instead throw a type error, and the '(eq other-window 'no-select)'
case will never be reached.  This patch moves this case up a line
to avoid this.
* lisp/windmove.el (windmove-do-window-select): Check for
'no-select' value earlier.  (Bug#78997)

Copyright-paperwork-exempt: yes
(cherry picked from commit 256dfdf11f40d94a86490d1b68bb86935e2d3f03)

2 weeks agoImprove wording of messages and documentation for 'eww-readable'
Jim Porter [Thu, 17 Jul 2025 02:30:09 +0000 (19:30 -0700)]
Improve wording of messages and documentation for 'eww-readable'

* lisp/net/eww.el (eww-readable, eww-mode): Improve wording; avoid using
the word "content".

* doc/misc/eww.texi (Basics): Improve wording.

(cherry picked from commit 291cd2d3419c7be20200db3f0ee5936661ab79f2)

2 weeks agoGCC bug 117423 has a fix
Paul Eggert [Fri, 18 Jul 2025 18:49:29 +0000 (11:49 -0700)]
GCC bug 117423 has a fix

Document the change in dependency.  As we still need to work
around GCC bug 119085, there is no functional change in ‘configure’.
* configure.ac (emacs_cv_gcc_bug_119085_CFLAGS):
Rename from emacs_cv_gcc_bug_117423_CFLAGS.  All uses changed.

(cherry picked from commit 07ee5ebeca0ddeab436d449f626638d85c083da1)

2 weeks agoVC: Tighten up switching branches
Sean Whitton [Fri, 18 Jul 2025 13:53:43 +0000 (14:53 +0100)]
VC: Tighten up switching branches

* lisp/vc/vc.el: Require backend 'create-tag' functions to
prompt for the starting point of the branch.
(vc-retrieve-tag, vc-switch-branch): Accept empty NAME only when
not switching branches: it doesn't make sense to switch to the
current branch.  Plain 'C-x v r' can still be used to check out
the latest revisions on the current branch.

(cherry picked from commit 0ac1fe8d73ba83164c564bc579f3387d39856f31)

2 weeks ago; * lisp/proced.el (proced-update): Display read syntax for filter value
Phil Sainty [Sat, 5 Jul 2025 10:35:55 +0000 (22:35 +1200)]
; * lisp/proced.el (proced-update): Display read syntax for filter value

Also eliminate unnecessary concat.

(cherry picked from commit e55f61d1af96aee373f0e5348792e9245dc7fdbb)

2 weeks agooutline.el: Don't silence buffer text modification
Stefan Monnier [Sun, 6 Jul 2025 17:23:50 +0000 (13:23 -0400)]
outline.el: Don't silence buffer text modification

It's important not to hide buffer text modifications from
`after/after-change-functions` since it can break other packages'
assumptions.

* lisp/outline.el (outline--insert-button): Don't silence
buffer text modification.
(outline--fix-up-all-buttons): Save buffer's modified state instead.

(cherry picked from commit 35d32c0dd8675fabef4db9a320b22b925490c636)

2 weeks agooutline.el: Use jit-lock to maintain the buttons
Stefan Monnier [Sun, 6 Jul 2025 17:13:14 +0000 (13:13 -0400)]
outline.el: Use jit-lock to maintain the buttons

* lisp/outline.el (outline-minor-mode): Use jit-lock instead of
`after-change-functions`.
(outline-flag-region): Run `outline--fix-buttons` since jit-lock
won't be triggered.
(outline--fix-up-all-buttons): Make the args mandatory.
(outline--fix-buttons): Rename from `outline--fix-buttons-after-change`.
Fix the END calculation.  Return the affected bounds, for jit-lock.

(cherry picked from commit 74ab225ec7ce7f73960a53c2b42dd0829478944e)

2 weeks agooutline.el: Remove buttons properly, including the " "
Stefan Monnier [Sun, 6 Jul 2025 16:27:04 +0000 (12:27 -0400)]
outline.el: Remove buttons properly, including the "  "

In Xref, enabling+disabling `outline-minor-mode` left two spaces
in front of every heading (a.k.a "group") line.

* lisp/outline.el (outline--remove-buttons): New function.
(outline-minor-mode, outline--fix-buttons-after-change): Use it.
(outline-after-change-functions): Improve docstring.

(cherry picked from commit 845bb83a2236535455b3934709dc3a987933bcb9)

2 weeks agolisp/outline.el (outline-minor-mode-cycle-filter): Don't quote lambda
Stefan Monnier [Sun, 6 Jul 2025 16:08:51 +0000 (12:08 -0400)]
lisp/outline.el (outline-minor-mode-cycle-filter): Don't quote lambda

(cherry picked from commit 05520a2e740f7599133898de92a70078f4e1f201)

2 weeks agocomp.el: Fix minor corner-case annoyances
Stefan Monnier [Thu, 17 Jul 2025 16:36:16 +0000 (12:36 -0400)]
comp.el: Fix minor corner-case annoyances

* lisp/emacs-lisp/comp.el (comp--native-compile): Avoid `%s`
on objects that may not have names.
* src/data.c (Ffset): Don't compute trampoline for no-op `fset`.

(cherry picked from commit f8b9d80ec6831671466000ba6dc0300a1577db0a)

2 weeks ago; * test/lisp/net/shr-tests.el (shr-test/zoom-image): Fix <img> (bug#79041).
Eli Zaretskii [Thu, 17 Jul 2025 16:34:50 +0000 (19:34 +0300)]
; * test/lisp/net/shr-tests.el (shr-test/zoom-image): Fix <img> (bug#79041).

(cherry picked from commit 462a541db904405ede8446c48ba0c71ad41c544d)

2 weeks ago; * lisp/battery.el (battery-bsd-apm): Explain a FIXME (bug#79040).
Manuel Giraud [Thu, 17 Jul 2025 12:22:26 +0000 (14:22 +0200)]
; * lisp/battery.el (battery-bsd-apm): Explain a FIXME (bug#79040).

(cherry picked from commit a05be41af713bd02a28659078ba1acc82ba66ae4)

2 weeks ago; Fix last change.
Eli Zaretskii [Thu, 17 Jul 2025 07:40:33 +0000 (10:40 +0300)]
; Fix last change.

(cherry picked from commit ae560ae11c1d4b1ae5e130f3a942364dcaf69b62)

2 weeks ago; * test/src/fileio-tests.el (fileio-tests--read-directory): New test.
Eli Zaretskii [Thu, 17 Jul 2025 07:26:17 +0000 (10:26 +0300)]
; * test/src/fileio-tests.el (fileio-tests--read-directory): New test.

(cherry picked from commit 29324fd0fa3755028466966b6eeb3cd0df1b442f)

2 weeks agoAdd more ways to exclude buffers in tab-line-mode. (Bug#78988)
Elías Gabriel Pérez [Thu, 10 Jul 2025 22:40:34 +0000 (16:40 -0600)]
Add more ways to exclude buffers in tab-line-mode. (Bug#78988)

* etc/NEWS: Announce changes.
* lisp/tab-line.el (tab-line-exclude-buffer): New user option.
(tab-line-mode--turn-on): Update conditions.

(cherry picked from commit 6053a7f1a4a862bee6a83ab5d69531672c7f9652)

2 weeks agoDon’t optimize insert-file-contents for GNU
Paul Eggert [Thu, 17 Jul 2025 06:21:23 +0000 (23:21 -0700)]
Don’t optimize insert-file-contents for GNU

* src/fileio.c (Finsert_file_contents):
Remove a microoptimization for GNU/Linux and Android.

(cherry picked from commit 15570b7b95da3461feb51cf1bfe3b6337f5a67cd)

2 weeks ago; Skip commit 9326784b785c110468c1804b969eefb8d8119fd8
Eshel Yaron [Thu, 24 Jul 2025 11:53:26 +0000 (13:53 +0200)]
; Skip commit 9326784b785c110468c1804b969eefb8d8119fd8

2 weeks agoinsert-file-contents small gap bug
Paul Eggert [Wed, 16 Jul 2025 18:38:20 +0000 (11:38 -0700)]
insert-file-contents small gap bug

Problem reported by Zhengyi Fu (Bug#79031).
* src/fileio.c (Finsert_file_contents): Do not read more than
requested, even when the gap is so small that we use a local buffer.

(cherry picked from commit e450a7802c544b7fa14fe064c62de1f9b7098e81)

2 weeks agoinsert-file-contents likely-end memory objects
Paul Eggert [Wed, 16 Jul 2025 18:16:13 +0000 (11:16 -0700)]
insert-file-contents likely-end memory objects

* src/fileio.c (Finsert_file_contents): Treat memory objects like
regular files when inferring likely end.  Simplify likely end
computation.

(cherry picked from commit 92dee45c5e4e7be1682a8a3aacdfd7d9c87cf286)

2 weeks agoPort insert-file-contents dir behavior to Unix
Paul Eggert [Wed, 16 Jul 2025 16:47:30 +0000 (09:47 -0700)]
Port insert-file-contents dir behavior to Unix

* src/fileio.c (Finsert_file_contents): Port better to traditional
Unix platforms like Solaris, where in some cases 'read' can
succeed on directories.

(cherry picked from commit 8a1d368b6241d999668086fed3c20f634b9fb4d3)

2 weeks agoAvoid syscall in dir-locals--all-files
Paul Eggert [Wed, 16 Jul 2025 16:45:18 +0000 (09:45 -0700)]
Avoid syscall in dir-locals--all-files

* lisp/files.el (dir-locals--all-files):
Omit an unnecessary call to file-directory-p.

(cherry picked from commit b282cb98e498ded876b87e5e48fe74b8c45156ea)

2 weeks agoAvoid some syscalls in locate-dominating-file
Paul Eggert [Wed, 16 Jul 2025 15:43:14 +0000 (08:43 -0700)]
Avoid some syscalls in locate-dominating-file

* lisp/files.el (locate-dominating-file): Do not call
file-directory-p each time through a loop ascending the directory
hierarchy, as the file must be a directory after the first loop
iteration.  Instead, call file-directory-p just once, before the
loop starts, and do this only if the file name is not already that
of a directory.

(cherry picked from commit 2074951c2adff43be49822c344d6cf3fee2e29a5)

2 weeks agoFix :box attribute of faces in Leuven themes.
Ken Mankoff [Wed, 16 Jul 2025 09:44:47 +0000 (05:44 -0400)]
Fix :box attribute of faces in Leuven themes.

* etc/themes/leuven-dark-theme.el:
* etc/themes/leuven-theme.el: Fix 'lui-highlight-face' face.
(Bug#79029)

(cherry picked from commit fe3ac1575a0103ac3f2030fe4a464a50f935abff)

2 weeks ago; define-globalized-minor-mode: Fix capitalization.
Sean Whitton [Wed, 16 Jul 2025 10:20:08 +0000 (11:20 +0100)]
; define-globalized-minor-mode: Fix capitalization.

(cherry picked from commit 86e32aed4a3506151c9a06df7f4dcdd2c4bbeca1)

2 weeks ago; * lisp/vc/diff-mode.el (diff-mode): Scare-quote 'normal'.
Sean Whitton [Wed, 16 Jul 2025 10:17:58 +0000 (11:17 +0100)]
; * lisp/vc/diff-mode.el (diff-mode): Scare-quote 'normal'.

(cherry picked from commit 24db9b79623a04207aeff5071f1389ad38f66672)