1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00
Commit graph

98163 commits

Author SHA1 Message Date
Sean Whitton
423c6a4dc0 ; Delete unnecessary global autoload from last change. 2025-07-12 14:07:58 +01:00
Stephen Berman
b406c44c82 dired-vc-deduce-fileset: Call vc-backend-for-registration
* lisp/vc/vc.el (vc-backend-for-registration):
* lisp/dired-aux.el (vc-backend-for-registration): Autoload.
(dired-vc-deduce-fileset): Call vc-backend-for-registration when
vc-responsible-backend returns nil (bug#78987).
2025-07-12 11:34:31 +01:00
Eli Zaretskii
4bff1dfe1f Merge from origin/emacs-30
ebb65d4163 ; Fix typos
2025-07-12 05:25:02 -04:00
Liu Hui
e0270c563a Add option 'ffap-prefer-remote-file' (bug#78925)
This option only affects absolute filenames that are found by
ffap-file-at-point in buffers with remote default directory.

The handling of relative filenames in above buffers remains
unchanged: ffap-file-at-point returns the relative filename,
which can be converted to a remote absolute filename by
subsequent callers (e.g. ffap) using expand-file-name.

* lisp/ffap.el (ffap-prefer-remote-file): New user option.
(ffap-file-exists-string): Add an optional argument to allow the
check of existence of absolute filename on the remote host.
(ffap-file-at-point): Always find remote files in remote context
if the new option is non-nil.
* test/lisp/ffap-tests.el (ffap-test-remote): Add a test.
* etc/NEWS: Announce the change.
2025-07-12 11:48:52 +03:00
Eli Zaretskii
c6ce81c15d Revert "Add option 'ffap-prefer-remote-file' (bug#78925)"
This reverts commit ae46edff68.
I mistakenly installed the wrong version of the patch for
bug#78925.
2025-07-12 11:48:03 +03:00
Liu Hui
ae46edff68 Add option 'ffap-prefer-remote-file' (bug#78925)
This option only affects absolute filenames that are found by
ffap-file-at-point in buffers with remote default directory.

The handling of relative filenames in above buffers remains
unchanged: ffap-file-at-point returns the relative filename,
which can be converted to a remote absolute filename by
subsequent callers (e.g. ffap) using expand-file-name.

* lisp/ffap.el (ffap-prefer-remote-file): New user option.
(ffap-file-exists-string): Add an optional argument to allow the
check of existence of absolute filename on the remote host.
(ffap-file-at-point): Always find remote files in remote context
if the new option is non-nil.
* test/lisp/ffap-tests.el (ffap-test-remote): Add a test.
* etc/NEWS: Announce the change.
2025-07-12 11:38:27 +03:00
Elías Gabriel Pérez
f746762e74 New command 'mode-line-invisible-mode'
This new command allows hide the mode line in the current
buffer.  (Bug#78881)

* doc/emacs/display.texi (Optional Mode Line): Document feature.
* etc/NEWS: Announce changes.
* lisp/simple.el (mode-line-invisible--buf-state): New buffer
local variable.
(mode-line-invisible-mode): New minor mode.
2025-07-12 10:50:22 +03:00
Xiyue Deng
5c75ec6ae5 Add public interfaces for accessing builtin package info (Bug#78844)
* lisp/emacs-lisp/package.el (package-builtin-packages)
(package-builtin-package-version): New functions.
* doc/lispref/package.texi: Add a section 'Package Information' with
documentation for the new functions.
* etc/NEWS: Add entry for 'package-versioned-builtin-packages' and
'package-builtin-package-version'.
2025-07-12 10:03:50 +03:00
Sean Whitton
8ff6e7fe58 ; vc-git-find-revision: Fix last change to this function. 2025-07-11 11:08:10 +01:00
Sean Whitton
10024cc065 VC: Fix displaying the async command buffer during async checkins
* lisp/vc/vc-dispatcher.el (vc--display-async-command-buffer):
New function, factored out of vc-do-async-command.
(vc-do-async-command): Use it.
(vc-finish-logentry): Bind vc--inhibit-async-window when running
the log operation, then call vc--display-async-command-buffer
again ourselves after performing other window changes.
2025-07-11 09:58:20 +01:00
Sean Whitton
5d048521e2 Apply vc-use-incoming-outgoing-prefixes to vc-dir-mode-map too
* lisp/vc/vc-dir.el (vc-use-incoming-outgoing-prefixes):
* lisp/vc/vc-hooks.el: Apply vc-use-incoming-outgoing-prefixes
to the corresponding bindings in vc-dir-mode-map, too.
2025-07-11 09:30:19 +01:00
Sean Whitton
191109e25e vc-git-find-revision: Pass --filters to git-cat-file
* lisp/vc/vc-git.el (vc-git-find-revision): Pass --filters to
git-cat-file.  Problem reported and fix suggested by Oscar
Fuentes <ofv@wanadoo.es>.
2025-07-11 09:13:47 +01:00
Alan Third
8b200c0419 Use css to set SVG foreground in docview
* lisp/doc-view.el (doc-view-insert-image): Use CSS to set the fill
attribute to the desired foreground color.
2025-07-10 17:54:33 +01:00
Michael Albinus
9f82300bb0 Fix handling of `browse-url-temp-file-name'
* lisp/net/browse-url.el (browse-url--temp-file-setup):
Add `browse-url-delete-temp-file' to `write-file-functions'.
(browse-url-of-file, browse-url-delete-temp-file): Fix handling of
`browse-url-temp-file-name'.  (Bug#78830)
2025-07-10 17:25:56 +02:00
Juri Linkov
99080d0c04 Cache only the last string in 'tab-bar-format-align-right' (bug#78953)
* lisp/tab-bar.el (tab-bar--align-right-cache):
Rename from 'tab-bar--align-right-hash'.
(tab-bar-format-align-right): Use it to store
the string in the car, and the width in the cdr.
2025-07-10 09:40:51 +03:00
Yuan Fu
b85d9048f4
Eldoc: Run eldoc-display-functions with original buffer (bug#78530)
Also bump eldoc version so Eglot can require the new version
later.

* lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): Run the
hook with the original buffer as the current buffer. This way
we're certain that the buffer-local value of
'eldoc-display-functions' is used.
(eldoc-display-functions): Update docstring.
2025-07-09 19:28:45 -07:00
Andrea Corallo
48a5917681 Nativecomp don't materialize non-materializable objects (bug#78606)
The native compiler should not try to generate in rendered code
immediate floats produced by the constrain on the '=' operator.

* test/src/comp-tests.el (comp-test-78606-1): Add test.
* test/src/comp-resources/comp-test-funcs.el (comp-test-78606-1-f): New
function.
* src/comp.c (emit_mvar_rval): Check if an immediate is materializable.
* lisp/emacs-lisp/comp.el (comp-ctxt): Add 'non-materializable-objs-h'
slot.
(comp--fwprop-insn): Update call.
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Add parameter.
2025-07-09 17:32:07 +02:00
Pip Cet
6a5d9cb07d Call eieio--class-* accessors only on eieio classes (bug#78786)
* lisp/emacs-lisp/eieio-core.el (eieio-oref, eieio-oref-default):
(eieio-oset, eieio-oset-default): Don't look for class slots except in
eieio classes.
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-test-defstruct-slot-value): New test.
2025-07-09 15:20:14 +00:00
Sean Whitton
8497cfeaea ; * lisp/treesit.el (treesit-parser-changed-regions): Declare. 2025-07-09 11:46:50 +01:00
Sean Whitton
72eb20f93f * lisp/vc/vc.el (vc-find-revision-no-save): Call read-only-mode. 2025-07-09 11:43:49 +01:00
Stephen Berman
8b86978895 Amend last change to 'kill-this-buffer'
* lisp/menu-bar.el (kill-this-buffer): Take using window tool bar
into account (bug#78809).
2025-07-09 10:59:13 +02:00
Juri Linkov
280d6f70a3 Handle multiple mouse events in display-buffer-override-next-command
* lisp/window.el (display-buffer-override-next-command):
Use 'mouse-event-p' to wait for more following mouse events.

* lisp/frame.el (other-frame-prefix):
* lisp/tab-bar.el (other-tab-prefix):
* lisp/windmove.el (windmove-display-in-direction):
* lisp/window.el (other-window-prefix, same-window-prefix):
Update the docstring to explain the behavior in regard
to multiple consecutive mouse events (bug#78945).
2025-07-09 09:48:17 +03:00
Yuan Fu
159ddd27ee
Ditch the async range update in tree-sitter (bug#78402)
Right now in treesit-outline-search -> treesit-navigate-thing, a
freshly created tree-sitter node becomes outdated within the
function.  I'm not sure _exactly_ how it happend, but it might
look like this: we first get a node from, say, html parser, then
get another node from, say, liquid parser.  Creating the node
from liquid parser causes a reparse which updated the range of
the html parser, which rendered the html node outdated.

There're several problems with the current design, let's start
with the most obvious one: we add
treesit--font-lock-mark-ranges-to-fontify as a notifier of the
primar parser in treesit-major-mode-setup.  Now, if a ts major
mode inherits another major mode, treesit-major-mode-setup will
be called twice, once in the parent mode and once in the child
node, and two parsers will have the notifier.  But
treesit--font-lock-mark-ranges-to-fontify is designed to run
only once.

I believe this bug, together with some mysterious async
execution order, led to the problems we saw in the bug report.
My solution is to just make everything synchronous.

So I added treesit-parser-changed-regions, and modified
treesit--font-lock-mark-ranges-to-fontify to use it.  Now we
don't need to add the notifier to the primary parser anymore.

I also applied the tree-sitter-outline change we discussed in
the bug report.  (Change to treesit-outline-search, and remove
treesit--after-change.)

* lisp/treesit.el:
(treesit--font-lock-mark-ranges-to-fontify): Remove the unused
PARSER arg.
(treesit--pre-redisplay): Make use of
treesit-parser-changed-regions.
(treesit-outline-search): Call treesit--pre-redisplay in the
beginning.
(treesit--after-change): Remove function.
(treesit-major-mode-setup): Don't add notifier to primary parser.
2025-07-08 23:39:39 -07:00
Yuan Fu
564b947745
Add a synchronous way to get parser change ranges (bug#78402)
This commit only adds the new function, the fix for the bug is
in the next commit.

* doc/lispref/parsing.texi (Using Parser): Add docs.
* lisp/treesit.el (treesit): Add shortdoc.
* src/treesit.c (treesit_get_affected_ranges): New function
extracted from treesit_call_after_change_functions.
(treesit_call_after_change_functions): Extract out.
(treesit_ensure_parsed): Return affected regions.
(Ftreesit_parser_changed_regions): New function that returns the
affected regions.
2025-07-08 23:39:36 -07:00
Juri Linkov
c4674bfa3a Cache 'string-pixel-width' in 'tab-bar-format-align-right' (bug#78953)
* lisp/tab-bar.el (tab-bar--align-right-hash): New internal variable.
(tab-bar-format-align-right): Use memoization for 'string-pixel-width'.
2025-07-09 09:32:18 +03:00
Juri Linkov
8b1978fa6e Fix tab-bar-format-align-right to not call tab-bar-format-global twice
* lisp/tab-bar.el (tab-bar-format-align-right): Add optional arg 'rest'
to handle it specially in 'tab-bar-format-list'.  Use the value from 'rest'
instead of calling format functions twice by 'tab-bar-format-list'.
(tab-bar-format-list): When 'format-list' contains the item
'tab-bar-format-align-right', collect the rest of formatted items
and call 'tab-bar-format-align-right' explicitly with the collected
list (bug#78953).
2025-07-09 09:28:05 +03:00
Arash Esbati
db46d5e833 ; Fix last change
* lisp/international/latexenc.el
(latexenc-find-file-coding-system): Check if `TeX-master' is
really set to a string globally.  (AUCTeX bug#78841)
2025-07-07 21:12:30 +02:00
Sean Whitton
83da45ddd0 ; vc-git-checkin, vc-hg-checkin: Delete unused lexical variable. 2025-07-07 15:50:43 +01:00
Sean Whitton
6227a0412d * lisp/vc/vc.el (with-vc-properties): Fix macro variable capture. 2025-07-07 15:50:22 +01:00
Sean Whitton
6c0c985cee Resolve FIXME regarding running vc-checkin-hook
Running vc-checkin-hook needs to be delayed in the case of an
async checkin.  As a quick fix we had been relying on the
backend checkin functions to run the hook in the async case.
This restores handling running the hook in generic code even for
the async case.

* lisp/vc/vc.el (vc-checkin): Always pass vc-checkin-hook to
vc-start-logentry.  Return the result of calling the backend
'checkin-patch' or 'checkin' function to vc-finish-logentry.
* lisp/vc/vc-dispatcher.el (vc-finish-logentry): If the log
operation returns a cons of the form (async . #<process ...>),
use vc-exec-after to delay vc-resynch-buffer and hooks until the
async process completes.  Approach suggested by Dmitry Gutov.
* lisp/vc/vc-git.el (vc-git-checkin):
* lisp/vc/vc-hg.el (vc-hg-checkin): For an async checkin, return
a cons (async . #<process ...>) containing the async checkin
process.  No longer run vc-checkin-hook.

* lisp/vc/vc.el (with-vc-properties): Return the result of
evaluating FORM.
* lisp/vc/vc-dispatcher.el (vc-exec-after): Change to PROC's
buffer before calling vc-set-mode-line-busy-indicator.
2025-07-07 15:44:34 +01:00
Robert Pluim
ebb65d4163 ; Fix typos
* lisp/emacs-lisp/warnings.el (warning-display-at-bottom): Fix typo.
* lisp/replace.el (query-replace-help): Typo fix.
2025-07-07 14:49:23 +02:00
Mattias Engdegård
0de646b6a1 Turn compiler macro defalias messages into warnings
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defalias):
Turn messages into warnings to make them more visible to the user and
provide a source location (bug#78792).
2025-07-07 11:04:19 +02:00
Jim Porter
e88af5fff7 Use short revisions by default when navigating to revisions
* lisp/vc/vc-annotate.el (vc-annotate-revision-previous-to-line)
(vc-annotate-show-diff-revision-at-line-internal)
(vc-annotate-warp-revision): Let-bind 'vc-use-short-revision'
around calls to 'previous-revision' and 'next-revision'.

* lisp/vc/vc-git.el (vc-git-previous-revision, vc-git-next-revision):
Handle 'vc-use-short-revision' option (bug#78900).
2025-07-07 09:32:12 +01:00
Jim Porter
d3c75a3d2d Show "readable" status in the EWW mode line
* lisp/net/eww.el (eww-display-html): Check whether a readable form of
the document exists; if not, don't set ':readable' to t.
(eww-readable): Check whether a readable form of the document exists; if
not, warn the user and don't add to history.
(eww-readable-dom): Return nil if no readable form exists.
(eww-mode): Check the ':readable' property of 'eww-data' to show
"readable" state in the mode line.

* test/lisp/net/eww-tests.el
(eww-test/readable/default-readable/non-readable-page): New test
(bug#78958).
2025-07-06 17:26:45 -07:00
Eli Zaretskii
b4b7ddb603 Fix 'kill-ring-deindent-mode'
* lisp/indent-aux.el
(kill-ring-deindent-buffer-substring-function): Fix deindenting
for modes which set 'indent-tab-mode' to nil.  (Bug#77981)

(cherry picked from commit 1c7fe501fe)
2025-07-06 18:33:17 +03:00
Stefan Monnier
4732b8921d lisp/mpc.el (mpc-describe-song): Don't quote lambdas 2025-07-06 10:39:33 -04:00
Sean Whitton
90a0771379 Log Edit: Don't auto-fill within the headers
* lisp/vc/log-edit.el (log-edit-do-auto-fill): New function.
(log-edit-mode): Set normal-auto-fill-function to it.
2025-07-06 14:03:31 +01:00
Sean Whitton
7a0bfa3ee7 vc-checkin: Check whether the fileset or patches have changed
* lisp/vc/vc-dispatcher.el (vc-finish-logentry): Delay popping
to vc-parent-buffer until after calling the log operation.
That way if the log operation exits early, the current buffer
remains *vc-log*.
(vc-dir-marked-files, dired-get-marked-files): Declare.
(vc-dispatcher--explicit-marks-p): New function.
* lisp/vc/vc.el (vc-checkin): Check the user isn't likely to be
surprised by what is included in the checkin.  Specifically,
check whether the fileset or patches implied by vc-parent-buffer
are unchanged.
* doc/emacs/maintaining.texi (VC With A Merging VCS): Explain
how the fileset or patch string is fixed once *vc-log* pops up.
2025-07-06 14:03:31 +01:00
Sean Whitton
08c5f68e0b ; * lisp/vc/log-edit.el (log-edit): Clarify vc-log-fileset. 2025-07-06 14:03:31 +01:00
Stefan Monnier
8786dfedc9 lisp/help-mode.el (help-mode-context-menu): Don't quote lambda 2025-07-05 19:32:50 -04:00
Michael Albinus
aa8afabd49 Add file notification handler for Tramp's "smb" method.
* etc/NEWS: Mention new file notification handler for Tramp "smb".

* lisp/filenotify.el (file-notify--expand-file-name): Fix the
remote case.
(file-notify-callback): Extend for "smb-notify".
(file-notify--call-handler): Fix debug message.

* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch):
* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter):
Use connection property "file-monitor".

* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Use `tramp-smb-handle-file-notify-add-watch'.
(tramp-smb-handle-delete-directory): Do not error if there is a
pending deletion of a directory under file-watch.
(tramp-smb-handle-file-notify-add-watch)
(tramp-smb-notify-process-filter): New defuns.
(tramp-smb-send-command): New optional argument NOOUTPUT.
(tramp-smb-wait-for-output): Improve debug message.

* lisp/net/tramp.el (tramp-directory-watched): New defun.
(tramp-accept-process-output, tramp-wait-for-regexp):
Improve debug message.

* test/lisp/filenotify-tests.el (top): Filter also for
"smb-notify".  Set some other Tramp related variables.
(file-notify--test-wait-for-events)
(file-notify--test-with-actions-check)
(file-notify--test-with-actions): Add debug message.
(file-notify--test-cleanup, file-notify--deftest-remote):
Keep Tramp debugs buffer.
(file-notify--test-monitor): Check for "smb-notify".
(file-notify--deftest-remote): Call `file-notify-rm-all-watches'.
(file-notify--test-make-temp-name): Use a better name for parent
directory.
(file-notify--test-event-handler): Use `string-match-p'.
(file-notify--test-with-actions): Check also for the `stopped'
event as limit.
(file-notify-test03-events, file-notify-test04-autorevert)
(file-notify-test05-file-validity)
(file-notify-test07-many-events, file-notify-test08-backup)
(file-notify-test09-watched-file-in-watched-dir): Adapt tests for
"smb-notify".
(file-notify-test12-unmount): Skip for "smb-notify".
2025-07-05 19:21:48 +02:00
Stefan Monnier
4024a7d541 (eieio--validate-slot-value): Don't break on struct objects
Nowadays `eieio-oset` applies to more than just EIEIO objects.
The old code tended to work OK but only because `eieio--class-slots`
is usually compiled/inlined without checks.

* lisp/emacs-lisp/eieio-core.el (eieio--validate-slot-value):
Don't assume CLASS is an EIEIO class.
2025-07-05 11:18:13 -04:00
Mattias Engdegård
d1677d0a92 Make elint obsolete (bug#78685)
It never was very useful to begin with, produces lots of false positives,
and the byte-compiler has long eclipsed it in warning quality.

* lisp/emacs-lisp/elint.el: Move this file...
* lisp/obsolete/elint.el: ...here, and declare obsolete.
(elint-file, elint-directory, elint-current-buffer, elint-defun):
Declare obsolete.
(elint--file): Split from elint-file to avoid warning.
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu):
Remove elint menu entries.
* etc/NEWS: Announce
2025-07-05 14:38:48 +02:00
Eli Zaretskii
a4712609b7 Revert "New command 'mode-line-invisible-mode'"
This reverts commit 7e56ffd51b.
It caused failure to bootstrap.  (Bug#78881)
2025-07-05 13:29:46 +03:00
Eli Zaretskii
4d14891850 ; * lisp/progmodes/cc-engine.el: Fix trailing whitespace. 2025-07-05 06:03:48 -04:00
Eli Zaretskii
4288dc7751 Merge from origin/emacs-30
3f7787c979 ; * lisp/replace.el (query-replace-help): Fix help text (...
b10596a630 ; * lisp/emacs-lisp/warnings.el (warning-display-at-botto...
060f964906 Handle ts_node_type return NULL (bug#78938)
5bdacbe460 Improve documentation of 'warning-display-at-bottom'
30dae2ad23 Handle the case when ts_node_type returns NULL (bug#78938)
985ad1da76 ; * lisp/emacs-lisp/bytecomp.el (compilation-safety): Doc...
de18407f51 ; * doc/lispref/functions.texi (Mapping Functions): Fix w...
2025-07-05 06:02:36 -04:00
Spencer Baugh
49d0342a00 Fix ffap-in-project to check file existence
* lisp/ffap.el (ffap-in-project): Check file existence before
returning non-nil. (bug#78929)
2025-07-05 12:19:51 +03:00
Sean Whitton
ae55c0fd2d ; * lisp/vc/log-edit.el (log-edit-diff-fileset): Update comment. 2025-07-05 09:53:51 +01:00
Sean Whitton
45d1486803 Don't call vc-buffer-sync-fileset when committing a patch
* lisp/vc/vc-dispatcher.el (vc-finish-logentry): Move call to
vc-buffer-sync-fileset from here ...
* lisp/vc/vc.el (vc-checkin): ... to here, and conditionalize so
as not to call when committing a patch.  Also fix comment.
2025-07-05 09:49:13 +01:00
Eli Zaretskii
cbd4616ae2 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2025-07-05 11:37:10 +03:00