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

178848 commits

Author SHA1 Message Date
Vincent Belaïche
3c0f6584bf Document ses--row and ses--col dynamic binding.
* doc/translations/fr/misc/ses-fr.texi (Local printer functions)
* doc/misc/ses.texi (Local printer functions): Document `ses--row'
and `ses--col' being dynamically bound to the cell coordinates.

* doc/translations/fr/misc/ses-fr.texi (Nonrelocatable
references):
* doc/misc/ses.texi (Nonrelocatable references): `row' renamed to
`ses--row', and so for `col' to `ses--col'.
2025-07-10 16:46:25 +02:00
Vincent Belaïche
b2e163ad98 Document advanced customization of ses-after-entry-functions.
* doc/translations/fr/misc/ses-fr.texi (Customizing @acronym{SES}):
* doc/misc/ses.texi (Customizing @acronym{SES}): Document advanced
customization for ses-after-entry-functions.
2025-07-10 16:31:23 +02:00
Vincent Belaïche
e70a8c9e6f Run ses-after-entry-functions with run-hook-with-args.
* lisp/ses.el (ses-after-entry-functions): Indicate that
`ses--row' and `ses--col' are dynamically bound while hook is run.
(ses-read-cell, ses-read-symbol): Use `run-hook-with-args' rather
than `dolist'+`funcall' to run hook `ses-after-entry-functions'.
2025-07-10 13:08:24 +02:00
Vincent Belaïche
699105ed3f Bind dynamically ses--row and ses--col on eval formula & after move.
* lisp/ses.el (ses-calculate-cell): Dynamically bind `ses--row' &
`ses--col' when evaluating formula.
(ses-read-cell, ses-read-symbol): Dynamically bind `ses--row' &
`ses--col' when running hook in `ses-after-entry-functions'.
2025-07-10 12:05:57 +02:00
Vincent Belaïche
47ce1b895c Typo SES-fr. 2025-07-10 11:57:07 +02:00
Vincent Belaïche
01758cabea Generate manual for other languages than default.
* doc/translations/fr/info_common.mk:
* doc/translations/default/info_common.mk: New file.

* doc/misc/Makefile.in: Get INFO_COMMON from language respective
info_common.mk helper script.
(INFO_TARGETS): Make it depend from info_common.mk settings.
(ORG_SETUP, ORG_SRC): Make it point at language specific sub-directory.
(texi_sources, DVI_TARGETS, HTML_TARGETS, PDF_TARGETS)
(PS_TARGETS, echo-info, info_template,efaq%$(lang_suffix).dvi)
(efaq%$(lang_suffix).pdf, efaq%$(lang_suffix).texi)
(efaq%$(lang_suffix).html): Make it use language specific suffix.
(${buildinfodir}/%$(lang_suffix).info, %$(lang_suffix).dvi)
(%$(lang_suffix).pdf, %$(lang_suffix).html, %$(lang_suffix).ps):
Make it use language specific suffix/subdirectory.

* Makefile.in (DOCLANGS): New variable, list of languages.
(install-info, uninstall): List targets into 'info_misc' for all languages.
(TAGS tags): Make tags for all languages.
($(DOCS)): Create target for all languages.
(texi_misc_fr, texi_misc_default): Set macro for all languages.
(srcdir_doc_info_dir_inputs): Macro concatenate texi_misc_lll for
all language lll.
2025-07-10 11:57:05 +02:00
Mattias Engdegård
cd3727f7e0 Speed up low-level parts of the reader and refactor
Inspect the given 'readcharfun' source once, before using it, instead of
for each character read.  This moves a bunch of branches away from the
critical path, with separate functions for different source types.
Replace some preprocessor macros with functions.

* src/lread.c (READCHAR, UNREAD, READCHAR_REPORT_MULTIBYTE)
(FROM_FILE_P): Remove; use corresponding functions instead.
All callers adapted.
(source_t): New struct that takes the place of the `readcharfun` and
`readbyte` arguments in many places.
(init_source)
(source_buffer_get, source_buffer_unget)
(source_marker_get, source_marker_unget)
(source_string_get, source_string_unget)
(source_file_get, source_file_unget)
(source_function_get, source_function_unget)
(from_file_p, unreadbyte_from_file):
New.
(readbyte_from_stdio): Replace `readbyte_from_file`.
(readchar, unreadchar): Rewrite.
(lisp_file_lexical_cookie, readevalloop, read_internal_start):
Create a source_t for use during reading.  All signatures and functions
called adapted.
(read_char_escape): Remove check for an error that can no longer occur.
2025-07-10 10:24:58 +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
Mattias Engdegård
f605e6ede3 ; * src/lread.c (read_internal_start): Simplify.
This removes code that became dead in the non-recursive reader reform.
2025-07-09 19:23:47 +02:00
Eli Zaretskii
1a6e7280e2 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2025-07-09 19:13:56 +03: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
Pip Cet
a76506f131 Fix crashes when "emacsclient -nw" frames are suspended (bug#78980)
* src/frame.c (frame_redisplay_p): Start loop with 'f', not its parent
frame.  Simplify return expression.
2025-07-09 14:09:53 +00:00
Eli Zaretskii
115a4fd940 ; * doc/lispref/parsing.texi (Using Parser): Fix wording. 2025-07-09 15:43:00 +03:00
Sean Whitton
8497cfeaea ; * lisp/treesit.el (treesit-parser-changed-regions): Declare. 2025-07-09 11:46:50 +01:00
Sean Whitton
b03f11d9ac print_error_message: Handle user-error to the echo area specially
* src/print.c (print_error_message): For a user-error that is to
be printed to the echo area, use message3 in order to preserve
fontification.
2025-07-09 11:45:13 +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
Martin Rudalics
2fc402cb0b Handle invalid frame_or_window slots in tty input events (Bug#78966)
* src/frame.c (make_terminal_frame): Initialize terminal's
top_frame slot if it has not been set up yet (Bug#78966).
* src/keyboard.c (kbd_buffer_get_event): Do not assume that the
event's frame_or_window slot always produces a valid frame
(Bug#78966).
(tty_read_avail_input): Try to make sure that the input event we
create has a valid frame_or_window slot (Bug#78966).  Add assertion
to that purpose.
2025-07-09 09:52:01 +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
Jim Porter
87cae92e7c Add NEWS entry for abbreviating Git revisions in 'vc-annotate'
* etc/NEWS: Document new cases where 'vc-annotate' abbreviates Git
revisions (bug#78900).
2025-07-08 20:00:03 -07: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
Mattias Engdegård
c120a338e6 Cheaper char counting when reading symbols
* src/lread.c (read0): Strength reduction.
2025-07-07 17:27:21 +02:00
Mattias Engdegård
32a0367554 Refactor buffering code in the Lisp reader
Abstract the buffering in the reader with a struct and plain functions
instead of rather unhygienic preprocessor macros.

* src/lread.c (READ_AND_BUFFER, INVALID_SYNTAX_WITH_BUFFER):
Removed, replaced with...
(readbuf_t, readbuf_grow, add_char_to_buffer, read_and_buffer)
(invalid_syntax_with_buffer): ...these new functions and struct.
(read0): Use new code instead of old preprocessor macros.
2025-07-07 17:11:55 +02:00
Mattias Engdegård
501bb04e53 ; * src/lread.c (skip_lazy_string): more precise comment
The bool vector compat hack is there for a bug in Emacs 19 only.
2025-07-07 17:11:55 +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
Sean Whitton
f85f3c30dd ; * doc/emacs/maintaining.texi (VC With A Merging VCS): Fix wording. 2025-07-07 15:30:50 +01:00
Mattias Engdegård
d13693ef4e Read non-ASCII chars from unibyte string sources as raw bytes
Previously, latin-1 was incorrectly assumed (bug#70988).

* src/lread.c (readchar): Convert to raw byte.
* test/src/lread-tests.el (lread-unibyte-string-source): New test.
2025-07-07 11:30:07 +02:00
Mattias Engdegård
f2f7675621 Print non-ASCII chars in unibyte symbols as raw bytes
Previously, latin-1 was incorrectly assumed (bug#70988).

* src/print.c (print_object): Call the correct function.
* test/src/print-tests.el (print-unibyte-symbols): New test.
2025-07-07 11:30:07 +02:00
Mattias Engdegård
553a6c407f Read characters from functions as multibyte
Previously, latin-1 was incorrectly assumed (bug#70988).

* src/lread.c (readchar): Set multibyte flag.
* test/src/lread-tests.el (lread-function-source): New test.
2025-07-07 11:30:07 +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
Stefan Monnier
b93d49a378 (Ftranspose_regions): Fix bug#76124
* src/editfns.c (Ftranspose_regions): Be careful that ELisp code could
move the gap from under our feet.

* test/src/editfns-tests.el (editfns-tests--bug76124): New test.
2025-07-06 19:15:51 -04: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
67ddf21576 ; Move text about C-x v v from Diff mode buffers into main list
* doc/emacs/maintaining.texi (VC With A Merging VCS): Move text
about C-x v v from a Diff mode buffer into the bulleted list.
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
Michael Albinus
771370dea5 Adapt filenotify-tests.el for Emba
* test/infra/gitlab-ci.yml (.filenotify-gio-template): Enable also
for scheduled jobs.

* test/lisp/filenotify-tests.el (file-notify--test-cleanup):
Fix docstring.
(file-notify--deftest-remote): Use `file-notify--test-cleanup'.
(file-notify-test03-events, file-notify-test05-file-validity)
(file-notify-test06-dir-validity)
(file-notify-test07-many-events)
(file-notify-test09-watched-file-in-watched-dir): Adapt tests.
(file-notify-test03-events-remote)
(file-notify-test04-autorevert-remote)
(file-notify-test07-many-events-remote)
(file-notify-test09-watched-file-in-watched-dir-remote): Do not
tag as :unstable.
2025-07-06 14:41:02 +02:00
Michael Albinus
0550d036b7 ; * etc/NEWS: Fix thinko in last commit. 2025-07-06 09:00:42 +02: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