1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

178959 commits

Author SHA1 Message Date
Stefan Monnier
ec0a3c0d60 lisp/outline.el (outline--insert-button): Fix RET on covered button 2025-07-17 13:34:58 -04:00
Stefan Monnier
430bf07c74 xref.el: Use outline-button-cover-text
* lisp/progmodes/xref.el (xref--xref-buffer-mode):
Use `outline-button-cover-text`.  Unconditionally enable
`outline-minor-mode`.
(xref--insert-xrefs): Add a marker char for groups, for outline's benefit.
2025-07-17 13:01:56 -04:00
Stefan Monnier
c87d1a1713 outline.el: Add outline-button-cover-text
* lisp/outline.el (outline-minor-mode-use-buttons): De-advertize `insert`.
(outline-button-cover-text): New variable.
(outline--button-icons): Adjust var docstring.
(outline-minor-mode): Flush the button icons memoization table.
(outline--button-icons): Fill the memoization var lazily.
Rename function from `outline--create-button-icons`.  Add 2 args.
Use the `location` arg to determine what to return instead of relying
on `outline-minor-mode-use-buttons`.
(outline--insert-button): Adjust calls accordingly.
2025-07-17 13:01:47 -04:00
Stefan Monnier
35d32c0dd8 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.
2025-07-17 12:57:04 -04:00
Stefan Monnier
74ab225ec7 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.
2025-07-17 12:57:04 -04:00
Stefan Monnier
845bb83a22 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.
2025-07-17 12:57:04 -04:00
Stefan Monnier
05520a2e74 lisp/outline.el (outline-minor-mode-cycle-filter): Don't quote lambda 2025-07-17 12:57:04 -04:00
Stefan Monnier
f8b9d80ec6 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`.
2025-07-17 12:36:57 -04:00
Eli Zaretskii
462a541db9 ; * test/lisp/net/shr-tests.el (shr-test/zoom-image): Fix <img> (bug#79041). 2025-07-17 19:34:50 +03:00
Eli Zaretskii
ae560ae11c ; Fix last change. 2025-07-17 10:40:33 +03:00
Eli Zaretskii
29324fd0fa ; * test/src/fileio-tests.el (fileio-tests--read-directory): New test. 2025-07-17 10:26:17 +03:00
Elías Gabriel Pérez
6053a7f1a4 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.
2025-07-17 09:35:38 +03:00
Paul Eggert
15570b7b95 Don’t optimize insert-file-contents for GNU
* src/fileio.c (Finsert_file_contents):
Remove a microoptimization for GNU/Linux and Android.
2025-07-16 23:21:23 -07:00
F. Jason Park
9326784b78 ; Skip erc-autojoin-channels--delay test on Solaris
* test/lisp/erc/erc-join-tests.el (erc-autojoin-channels--delay): Skip
for now on Solaris and UnixWare pending further
investigation.  (Bug#79017)
2025-07-16 17:57:28 -07:00
Paul Eggert
e450a7802c 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.
2025-07-16 11:45:23 -07:00
Paul Eggert
92dee45c5e 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.
2025-07-16 11:45:23 -07:00
Paul Eggert
8a1d368b62 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.
2025-07-16 11:45:23 -07:00
Paul Eggert
b282cb98e4 Avoid syscall in dir-locals--all-files
* lisp/files.el (dir-locals--all-files):
Omit an unnecessary call to file-directory-p.
2025-07-16 11:45:23 -07:00
Paul Eggert
2074951c2a 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.
2025-07-16 11:45:23 -07:00
Sean Whitton
94b2a0b2fc Merge from origin/emacs-30
24db9b7962 ; * lisp/vc/diff-mode.el (diff-mode): Scare-quote 'normal'.
756e7e5243 ; * lisp/window.el (window-state-put): Fix a typo (bug#79...
0fb20adf8e ; define-globalized-minor-mode: Fix info node link in doc...
2025-07-16 11:18:41 +01:00
Sean Whitton
24db9b7962 ; * lisp/vc/diff-mode.el (diff-mode): Scare-quote 'normal'. 2025-07-16 11:17:58 +01:00
Sean Whitton
48b3363ac4 ; vc-revert-buffer-internal: Capitalization fix. 2025-07-16 11:00:46 +01:00
Sean Whitton
3d04506cf3 view-mode-exit: Respect view-read-only
* lisp/view.el (view-mode-exit): When view-read-only is non-nil,
don't exit View mode if doing so would leave behind a read-only
buffer not in View mode.
(View-exit): Bind view-read-only to nil to override the above.
2025-07-16 10:49:26 +01:00
Sean Whitton
aec5c5f037 vc-git-diff: Fix case where REV1 & REV2 are nil and no commits yet
* lisp/vc/vc-git.el (vc-git--empty-tree): New constant.
(vc-git-diff): When REV1 and REV2 are both nil and there are no
commits yet, diff against the empty tree object (bug#78987).
2025-07-16 09:55:54 +01:00
Michael Albinus
e4db6aa545 ; * src/xdisp.c: Fix typo. 2025-07-16 08:47:23 +02:00
Paul Eggert
42548c25f7 Fix insert-file-contents overlap check
In commit 61a8ce0280 I mistakenly
focused on overlap in the buffer.  The code also needs to check
for overlap in the inserted file data.
Problem reported by Gerd Möllmann (Bug#79020).
* src/fileio.c (Finsert_file_contents): Prevent overlap in both
the buffer head and tail, and in the inserted file’s head and tail.
Also, shrink the file’s head if the file shrank to be smaller
than its head.
2025-07-15 22:47:16 -07:00
Sean Whitton
a30372f42b ; Fix wording. 2025-07-15 21:58:59 +01:00
Sean Whitton
6ee0093b21 ; Fix recently introduced "ELisp". 2025-07-15 21:57:59 +01:00
Stefan Monnier
c3f3fe136c Add redisplay_counter to catch nested redisplays and abort outer one
The redisplay code is not re-entrant.  To allow running ELisp code
from within redisplay, we have some hacks (e.g. `inhibit-redisplay`)
that try to avoid the resulting breakage.
This commit adds another one of those hacks, which tries
to get closer to the core of the problem, thereby making it "safe"
to override `inhibit-redisplay`, e.g. to debug jit-lock code.

* src/dispextern.h (redisplay_counter): Declare.
* src/xdisp.c (redisplay_counter): Define.
(redisplay_internal) Increment it.
(dsafe__call): Use it, in case `inhibit-redisplay` is overridden.
* src/eval.c (call_debugger): Use it as well to refine the test
we already had.
2025-07-15 13:49:29 -04:00
Michael Albinus
4c9b376607 Improve autorevert-tests
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.8.1-pre".

* lisp/autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(auto-revert-notify-handler, auto-revert--end-lockout):
Use `auto-revert-buffer'.
(auto-revert-notify-handler): Rearrange setting current buffer.
(auto-revert-handler): Add debug message.  Rearrange check.
Cancel lockout timer if running.

* lisp/net/tramp.el (tramp-barf-if-file-missing)
(with-parsed-tramp-file-name, tramp-skeleton-file-truename):
* lisp/net/tramp-archive.el (with-parsed-tramp-archive-file-name):
* lisp/net/tramp-message.el (tramp-with-demoted-errors):
Fix debug declatation.

* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter): Do not
prepend remote prefix.

* test/lisp/autorevert-tests.el: Unify file notification libraries
"gio-monitor" and "gvfs-monitor-dir" to "gio".
(top): Set some Tramp related variables.
(auto-revert--timeout): Increase value.
(auto-revert--test-enabled-remote)
(auto-revert-test02-auto-revert-deleted-file): Do not check for
EMACS_HYDRA_CI environment variable.
(auto-revert--wait-for-revert): Fix regexp to search for.
(auto-revert--deftest-remote): Fix debug declatation.  Do not tag
:unstable.
(with-auto-revert-test): Fix debug declatation.  Adapt revert intervals.
(auto-revert-test*): Start with (file-notify-rm-all-watches).  Use
`buffer-string' and `string-match-p'.
(auto-revert-test00-auto-revert-mode): Unlock initial lockout.
(auto-revert-test01-auto-revert-several-files): Rearrange
temporary directory and file settings.
(auto-revert-test02-auto-revert-deleted-file): Adapt debug message.
(auto-revert-test03-auto-revert-tail-mode): Use `with-auto-revert-test'.
(auto-revert-test04-auto-revert-mode-dired):
Use `ert-with-temp-directory'.  Adapt prefix of tmpfile.
(auto-revert-test04-auto-revert-mode-dired)
(auto-revert-test05-global-notify, auto-revert-test06-write-file):
Wait for proper file modification.
(auto-revert-test--instrument-kill-buffer-hook): Fix debug message.
(auto-revert-test07-auto-revert-several-buffers): Use
`with-auto-revert-test.

* test/lisp/filenotify-tests.el: Unify file notification libraries
"gio-monitor" and "gvfs-monitor-dir" to "gio".
(file-notify--deftest-remote): Fix debug declatation.  Do not skip
for "gio".
(file-notify--test-with-actions): Fix debug declatation.

* test/lisp/net/tramp-tests.el (filenotify): Require.
(ert-remote-temporary-file-directory)
(tramp-test41-special-characters, tramp-test42-utf8)
(tramp-test45-asynchronous-requests): Do not check for
EMACS_HYDRA_CI environment variable.
(tramp-test46-file-notifications): New test.
2025-07-15 18:57:49 +02:00
Eli Zaretskii
0237e0d1a4 ; * test/lisp/vc/vc-tests/vc-tests.el (vc-test--version-diff): Fix for Bzr. 2025-07-15 19:30:05 +03:00
Eli Zaretskii
1ea3d7b1f7 Fix shift-translation support of 'scroll-lock-mode' commands
* lisp/scroll-lock.el (scroll-lock-next-line-always-scroll)
(scroll-lock-next-line, scroll-lock-previous-line)
(scroll-lock-forward-paragraph, scroll-lock-backward-paragraph):
Make them support shift-translation, like the commands remapped to
them do.  (Bug#79022)
2025-07-15 16:23:03 +03:00
Sean Whitton
c82a62fa36 ; Improve cross-referencing in some VC docs. 2025-07-15 12:43:44 +01:00
Sean Whitton
8fb0e33a10 ; Wording fixes in VC docs. 2025-07-15 12:43:31 +01:00
Jonas Bernoulli
105ae06031
Allow trivially autoloading transient-define-group
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Allow uses of transient-define-group to be autoloaded using just
";;;autoload".
2025-07-15 12:45:05 +02:00
Sean Whitton
e4ea991ed9 vc-resynch-window: Check whether auto-revert-mode is bound
* lisp/vc/vc-dispatcher.el (auto-revert-mode): Delete
declaration.
(vc-resynch-window): Check whether auto-revert-mode is bound.
2025-07-15 10:18:52 +01:00
Pengji Zhang
5d9a67e4bd Move some RefTeX 'setq's to major mode definition
Move two 'setq' expressions from the RefTeX label selection loop
to the body of the major mode definition, so to make it easier
to adjust the settings of the buffer via the mode hook.

* lisp/textmodes/reftex-ref.el (reftex-offer-label-menu): Move
two 'setq' expressions from here...
* lisp/textmodes/reftex-sel.el (reftex-select-label-mode): ...to
here.  (bug#77335)
2025-07-14 21:24:45 +02:00
Stefan Monnier
7f1cae9637 (cl--class-allparents): Fix bug#78989
Give more control over ordering when linearizing the
parent graph and avoid pathological misbehavior (such as
placing `t` in the middle of the linearization instead of the
end) when we can't "do it right".

* lisp/subr.el (merge-ordered-lists): Degrade more gracefully in case
of inconsistent hierarchies and don't do it silently.

* lisp/emacs-lisp/cl-preloaded.el (cl--class-allparents): Use the local
ordering to break ties, as in the C3 algorithm.
2025-07-14 12:37:11 -04:00
Paul Nelson
c8b6e90b4e Improve prettification of (La)TeX symbols
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Remove
entry for "\\newline", which resulted in an invisible display.
Prettify "\\ " with OPEN BOX instead of BOTTOM SQUARE BRACKET.
(tex--prettify-symbols-compose-p): Skip composition when the
control backslash is itself escaped (bug#78752).
2025-07-14 12:25:45 -04:00
Stefan Monnier
f01fc3d614 lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Use \
This is the "standard" way to avoid those indentation problems
without relying on funny numbers.
2025-07-14 12:25:32 -04:00
Po Lu
b2d5e4fe40 Fix the Android port
* src/fileio.c (emacs_full_read): Retype FD param to `emacs_fd'.
(Fcopy_file): Label newsize MAYBE_UNUSED.
2025-07-14 21:41:18 +08:00
Eli Zaretskii
d0f96de277 ; Fix 'threads-join-error' test
* test/src/thread-tests.el (threads-thread-sleeps): New helper
function.
(threads-join-error): Fix to work as intended, and remove the
'unstable' tag.  (Bug#40823)
2025-07-14 15:48:45 +03:00
Eli Zaretskii
756e7e5243 ; * lisp/window.el (window-state-put): Fix a typo (bug#79013). 2025-07-14 14:35:31 +03:00
Juri Linkov
817f7829f9 * src/xdisp.c (tab-bar-truncate): New variable (bug#78953).
(tab_bar_height): Use it.
2025-07-14 09:43:18 +03:00
Paul Eggert
a8b65860a5 ; Fix indentation. 2025-07-13 21:39:54 -07:00
Paul Eggert
5bce6753e2 Speed up insert-file-contents reads
This change makes insert-file-contents-literally 30% faster on my
platform, when inserting xdisp.c.
* src/fileio.c (READ_BUF_SIZE): Remove, replacing with ...
(IO_BUFSIZE): ... this new constant from Coreutils.
All uses of READ_BUF_SIZE changed to either MAX_ALLOCA or
IO_BUFSIZE.
2025-07-13 21:09:40 -07:00
Paul Eggert
c3f96d20ee Avoid some tiny /proc file reads
* src/fileio.c (union read_non_regular):
New members buf and bufsize replace inserted and trytry.
(read_non_regular): Adjust to this new, simpler interface.
(Finsert_file_contents): If the gap is smaller than read_buf
and we want to read more than the gap, read into read_buf
first, to avoid lots of tiny reads from /proc files.
2025-07-13 21:09:40 -07:00
Paul Eggert
55f41ca3aa insert-file-contents file shrinkage in scanback
* src/fileio.c (emacs_full_read): New function.
(Fcopy_file, Finsert_file_contents): Use it.
(Finsert_file_contents): Check for partial reads when scanning
backwards through the file’s tail, as this indicates the file
shrank while we read it.  Also, use emacs_full_read in other
situations where it’s simpler and should be a bit faster.
2025-07-13 21:09:39 -07:00
Paul Eggert
8ac78986ff int → ptrdiff_t for read results
* src/fileio.c (Finsert_file_contents): Use ptrdiff_t, not int, to
store results returned by emacs_fd_read, which return ptrdiff_t.
This doesn’t fix any bugs since the values happen to fit in int,
but is a bit clearer and may simplify future changes.
2025-07-13 21:09:39 -07:00
Paul Eggert
f4adb56c9a insert-file-contents unexpected end shrinkage
* src/fileio.c (Finsert_file_contents): If the file unexpectedly
shrinks while reading its tail backwards, give up searching for
the match end.
2025-07-13 21:09:39 -07:00