Commit graph

180524 commits

Author SHA1 Message Date
Stéphane Marks
2b1440946e New optional recentf autosave timer (bug#80002)
* etc/NEWS: Announce the new user option.
* lisp/recentf.el (recentf-auto-cleanup): When canceling the
auto-cleanup timer, set recentf-auto-cleanup-timer to nil to
avoid false positive timerp.
(recentf-autosave-interval): New defcustom.
(recentf--autosave-timer, recentf--cancel-autosave-timer)
(recentf--manage-autosave-timer): New defun.
(recentf-mode): Call recentf--manage-autosave-timer.
2025-12-17 11:57:26 +00:00
Christoph Wedler
14f16535ed Fix init of auto/not-auto buffer-local vars in antlr-mode
* progmodes/antlr-mode.el (antlr-mode): Fix initialization of
variables, some are actually auto buffer-local and others not.
Patch by Arash Esbati <arash@gnu.org>.
2025-12-17 12:27:46 +01:00
João Távora
118b88dd22 Eglot: fix thinko, group file watchers by base URI (bug#79809)
It's fairly important to do this to reduce both the number of
file-notify watches and the number of expensive project-files among
"watcher" items pertaining to the same baseUri.

* lisp/progmodes/eglot.el (eglot--watch-globs): Rename from
eglot--watch-glob.  Accept list of compiled glob/kind pairs.
(eglot-register-capability): Group watchers by base-path before
setting up watches.
2025-12-17 10:01:00 +00:00
Michael Albinus
57f66bfa6c ; Fix last change in tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process): Adapt tests.
2025-12-17 07:36:49 +01:00
Sean Whitton
26dcbd06ed Fix outgoing diff commands including uncommitted changes
* lisp/vc/vc-hooks.el (vc-symbolic-working-revision): Don't
return nil when passed a directory if also passed a backend.
* lisp/vc/vc.el (vc-diff-outgoing): Pass backend to
vc-symbolic-working-revision.
2025-12-16 21:52:05 +00:00
João Távora
2b942c929e Eglot: fix last change about relativePatternSupport (bug#79809)
According to the spec, glob patterns are matched against relative paths
when server provides a RelativePattern baseUri.  Else match the glob
against the absolute path as usual.

* lisp/progmodes/eglot.el (eglot--watch-glob): Tweak
2025-12-16 21:20:06 +00:00
João Távora
06f31dc2d6 Eglot: support relativePatternSupport for file watching (bug#79809)
Announce relativePatternSupport capability.  Parse RelativePattern
objects with baseUri and pattern fields.  Add defvar
eglot-watch-files-outside-project-root to control filtering.

Rewrote file watching implementation.  Key by registration ID instead of
directory.  Each LSP watchers item spawns directory watchers
indenpendently that will look for the associated pattern only.

This change needs (or at least is known to work more efficiently) with
the latest project.el, so we should bump it.

* lisp/progmodes/eglot.el (eglot-client-capabilities): Announce
relativePatternSupport for didChangeWatchedFiles.
(eglot-lsp-server): Change file-watches slot to ID-keyed structure.
(eglot-watch-files-outside-project-root): New defvar.
(eglot--watch-glob): New function.
(eglot-register-capability): Rewrite.
(eglot-unregister-capability): Simplified for ID-keyed structure.
(eglot--on-shutdown): Update watch cleanup.
2025-12-16 17:58:32 +00:00
Michael Albinus
645a6ba081 Document and test process filters in tramp-smb.el
* doc/misc/tramp.texi (Remote processes): Provide more details in
"Running remote processes on MS Windows hosts".

* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process): Adapt tests.
2025-12-16 18:33:56 +01:00
Przemysław Kryger
62ce890c9f Mark less important package-vc-tests as expensive
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-test-deftest): Add support for `:tags' keyword.
(upgrade, upgrade-all, upgrade-all-after-require, rebuild)
(prepare-patch, log-incoming, pkg-spec-info-manual): Mark as
`:expensive-test'.
2025-12-16 17:38:53 +01:00
Przemysław Kryger
60c8f3e8ad Fix package-vc-tests failing when no install-info is available
* test/lisp/emacs-lisp/package-vc-tests.el
(pkg-spec-make-shell-command): Rename from
`pkg-spec-doc-make-shell-command'.  Remove assertions related to
info manual installation.
(pkg-spec-info-manual): Add tests for info manual installation.
2025-12-16 17:38:23 +01:00
Liu Hui
d22dd26fc7 Improve support for non-default calendar buffer (bug#79994)
* lisp/calendar/calendar.el (calendar-get-buffer): New function.
(calendar-mode-line-format): Support displaying non-default
calendar buffer name.
(calendar-exit): Handle non-default calendar buffer separately.
(calendar-generate-window): Update mode-line after cursor
motion (bug#79994).
(calendar-redraw, calendar-update-mode-line, calendar-unmark)
(calendar-mark-visible-date):
* lisp/calendar/cal-hebrew.el (calendar-hebrew-mark-date-pattern)
(calendar-hebrew-list-yahrzeits):
* lisp/calendar/diary-lib.el (diary-mark-sexp-entries)
(calendar-mark-days-named, calendar-mark-date-pattern)
(calendar-mark-1): Replace 'calendar-buffer' with the new
function or current calendar buffer.
(diary-mark-entries): Record current calendar buffer (bug#79994).
2025-12-16 11:58:29 +00:00
Stefan Monnier
0eec0d5174 (cconv-make-interpreted-closure): Be more conservative
We can't use `cconv-make-interpreted-closure` until it's
compiled because it would get called in an infinite recursion.
The same holds for a lof of the code needed to compute the interpreted
closures used during the computation of `cconv-make-interpreted-closure`.
We used to work around this inf-loop in `loadup.el` with a hack
that checks if two specific functions have been compiled.

In practice that worked well enough in normal use, but was brittle
if you ever tried to load `cconv.el`, or Edebug or `M-C-x` that code
for whatever reason.  So we replace it with a more conservative
approach which just short-circuits any recursive invocation.
It makes it conservative in that it will sometimes redirect the call
to the "dumb" `make-interpreted-closure` even though it would be able
to complete the call properly, but it should be infrequent
enough to be worth the added reliability.

* lisp/loadup.el: Simplify setting of
`internal-make-interpreted-closure-function`.

* lisp/emacs-lisp/cconv.el (cconv-make-interpreted-closure):
Avoid recursive invocations.
2025-12-15 22:04:50 -05:00
João Távora
4aff16bf9e Eglot: improve pull diagnostics support
* lisp/progmodes/eglot.el (eglot--diagnostics): Move up here.
(eglot--managed-mode): Use eglot--flymake-push.
(eglot-handle-notification): Simplify.
(eglot-flymake-backend): Simplify.
(eglot--flymake-pull): Rewrite.
(eglot--flymake-push): Tweak.

* etc/EGLOT-NEWS: Improve slightly.
2025-12-15 21:00:54 +00:00
Eli Zaretskii
45285a41d4 ; * lisp/simple.el (kill-visual-line): Fix a thinko in last change. 2025-12-15 18:23:53 +02:00
Michael Albinus
1b31023dab Finish process error buffer support in tramp-smb.el
* doc/misc/tramp.texi (Remote processes): Provide more details in
"Running remote processes on MS Windows hosts".

* lisp/net/tramp-smb.el (tramp-smb-handle-make-process):
Suppress lock files.

* test/lisp/net/tramp-tests.el (auto-revert-notify-watch-descriptor)
(auto-revert-remote-files, auto-revert-use-notify): Declare.  Set
proper values.
(tramp-test30-make-process): Adapt test.
2025-12-15 15:20:29 +01:00
Juri Linkov
1e9dca9ba2 * lisp/vc/vc.el (vc-diff-internal): Reuse the buffer object (bug#80005).
Instead of delaying hooks, set the variable 'buffer' to the buffer object
returned by 'get-buffer-create'.  This allows renaming the diff buffer
via 'diff-mode-hook'.
2025-12-15 09:22:33 +02:00
Paul Eggert
5fe0b9e6b0 make-docfile preferring streq
* lib-src/make-docfile.c (main, add_global, compare_globals):
Prefer streq to strcmp where either will do.
2025-12-14 14:47:22 -08:00
Paul Eggert
19e5d27daf Support nested parens in make-docfile args
* lib-src/make-docfile.c (scan_c_stream): Allow nested parens.
E.g., ‘(Lisp_Object XXX (force))’ for the identifier ‘force’,
where XXX is a macro.  This is for future changes.
2025-12-14 14:47:21 -08:00
Paul Eggert
aeab91bc55 Fix make-docfile strncmp typo
* lib-src/make-docfile.c (write_c_args):
Don’t mishandle the identifiers ‘v’, ‘vo’, and ‘voi’.
2025-12-14 14:47:21 -08:00
Paul Eggert
1269bbdaa9 Improve make-docfile.c for C23
* lib-src/make-docfile.c (write_c_args): Don’t diagnose “()”.
In C23 it’s equivalent to (void), and it works fine (albeit with
less type-checking) in older C.  Omit first arg, which is no
longer needed.  Caller changed.
2025-12-14 14:47:21 -08:00
Paul Eggert
51b8a7c7cb Fix some make-docfile core dumps
This bit me when I ran ‘make’ with typos in the Emacs source.
* lib-src/make-docfile.c (struct rcsoc_state.buf_lim):
New member.
(read_c_string_or_comment): Initialize it.
(put_char, scan_c_stream): Check for buffer overflow.
(scan_c_stream): Output a diagnostic rather than aborting
when the buffer overflows.
2025-12-14 14:47:21 -08:00
João Távora
2d1e891eea Eglot: half-decent pull diagnostics support
Implement basic LSP 3.17 pull diagnostics ('textDocument/diagnostic').
Only diagnostics for the current document are requested.  This is
chiefly because virtually no server has been found to support the
'relatedDocumentSupport' sub-capability which would allow to test this.

* etc/EGLOT-NEWS: Announce pull diagnostics support.

* lisp/progmodes/eglot.el (eglot-client-capabilities): Announce
:diagnostic capability.
(eglot--flymake-diag-type): New function.
(eglot--flymake-make-diag): New function.
(eglot--flymake-push-report-fn): Rename from
eglot--current-flymake-report-fn.
(eglot-flymake-backend): Check for :diagnosticProvider and dispatch
to pull or push path.
(eglot--flymake-pull): New function.
(eglot--flymake-push): Rename from eglot--report-to-flymake.
(eglot-handle-notification textDocument/publishDiagnostics): Use
eglot--flymake-make-diag helper.
(eglot-ignored-server-capabilities): Add diagnosticProvider
2025-12-14 22:01:29 +00:00
Christoph Wedler
9adb6df788 Add NEWS and auto-load entry for antlr-mode
* etc/NEWS (Antlr mode): Mention major changes.
* lisp/files.el (auto-mode-alist): Add 'antlr-v4-mode' for extension "g4".
2025-12-14 21:51:15 +01:00
Michael Albinus
ab63820870 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2025-12-14 16:56:06 +01:00
Michael Albinus
dbdae1b9a2 Implement process error buffer in tramp-smb.el
* lisp/net/tramp-smb.el (tramp-smb-handle-make-process):
Handle error buffer.

* test/lisp/net/tramp-tests.el (tramp-test30-make-process): Adapt test.
2025-12-14 16:55:38 +01:00
Philip Kaludercic
8447ebb06f
Load 'byte-recompile-file' to process User Lisp directory
* lisp/startup.el (byte-recompile-file): Declare 'byte-recompile-file'.
(prepare-user-lisp): Load bytecomp if necessary.  (Bug#79997)
2025-12-14 16:54:03 +01:00
Sean Whitton
699fb56b4e * lisp/vc/vc.el (vc-diff-internal): Use delay-mode-hooks. 2025-12-14 10:51:08 +00:00
Eli Zaretskii
d481b9efdc Fix a bug in 'kill-visual-line' that caused it signal an error
* lisp/simple.el (kill-visual-line): Don't assume 'posn-at-point'
always returns a non-nil value.  (Bug#80004)
2025-12-14 10:18:34 +02:00
Paul Eggert
1880cd0aa5 Use GCC warning -Wunused-const-variable=2
* configure.ac: Stop suppresssing -Wunused-const-variable=2 when
configured --with-gcc-warnings.  Suppressing no longer seems to be
needed with current GCC and src/lisp.h.
2025-12-13 21:33:01 -08:00
Dmitry Gutov
f8cf01134b project-files: Add the 'else' case to the previous change
* lisp/progmodes/project.el (project-files): Add the 'else' case
to the previous change (for DIRS outside of project root).
2025-12-14 04:34:16 +02:00
Dmitry Gutov
583856c437 Make project--vc-list-files extensible
* lisp/progmodes/project.el (project--vc-list-files):
Call backend function 'project-list-files'.
(project-files): Catch 'vc-not-supported' and default to
'project--files-in-directory' using the current project.
(vc-git-project-list-files, vc-hg-project-list-files):
New functions, extracted from 'project--vc-list-files'.
(https://lists.gnu.org/archive/html/emacs-devel/2025-12/msg00290.html)
2025-12-14 03:50:11 +02:00
Dmitry Gutov
48a4444977 Relax the condition on the values of DIRS in project-files
* lisp/progmodes/project.el (project-files):
Use 'file-in-directory-p' to dispatch to 'project--vc-list-files'
when listing subdirectory files too (bug#79809).
2025-12-14 02:26:36 +02:00
Michael Albinus
223dffabd8 Mention tramp-hlo in Tramp's documentation
* doc/misc/tramp.texi (Frequently Asked Questions)
(New operations): Mention tramp-hlo, again.
2025-12-13 17:58:50 +01:00
Michael Albinus
7089c1fd69 Implement process STDERR file in tramp-smb.el
* lisp/net/tramp-smb.el (tramp-smb-handle-make-process)
(tramp-smb-handle-process-file): Handle STDERR file.
(tramp-smb-call-winexe): Regroup sent commands.

* test/lisp/net/tramp-tests.el (tramp-test28-process-file)
(tramp-test30-make-process): Adapt tests.
2025-12-13 17:58:03 +01:00
Sean Whitton
08bd8fdbb4 vc-diff-internal: Call into backend after setting up the major mode
This means the backend can, for example, enable a minor mode,
without our changing the major mode immediately wiping that out.

* lisp/vc/vc.el (vc-diff-internal): Set up the major mode before
calling into the backend.
2025-12-13 14:26:29 +00:00
Sean Whitton
2d96fdc3b7 vc-git-dir-status-goto-stage: Accept exit 128 from git-add
* lisp/vc/vc-git.el (vc-git-dir-status-goto-stage): Accept an
exit code of 128 from 'git add --refresh' (bug#79999).
2025-12-13 14:13:15 +00:00
Eli Zaretskii
b7f2ccac1e Merge from origin/emacs-30
948c4f7f64 ; * admin/authors.el (authors-aliases): Add Rudolf Adamko...
2025-12-13 05:43:15 -05:00
Daniel Semyonov
242ee957f9 nnatom: Fix parsing of empty articles
* lisp/gnus/nnatom.el (nnatom--read-parts): Fix typo (bug#77539).
2025-12-13 11:58:52 +02:00
Paul Eggert
41ffeaec15 Update from Gnulib by running admin/merge-gnulib 2025-12-12 16:27:11 -08:00
Roi Martin
976143651b
Fix interactive call to 'prepare-user-lisp'
When called interactively with a prefix argument,
'prepare-user-lisp' throws a "Wrong type argument: stringp, (4)"
error.  This happens because the list passed to the interactive
specification is missing one argument and 'current-prefix-arg'
is assigned to AUTOLOAD-FILE instead of FORCE.

* lisp/startup.el (prepare-user-lisp): Fix list passed to
'interactive'.  (Bug#79996)
2025-12-12 21:45:49 +01:00
Stefan Monnier
aa5a9df828 Editorconfig: Merge a few more changes from upstream
* lisp/editorconfig-core.el: Fix up leading comment.
(editorconfig-core-get-properties-hash): Remove unused `confversion` arg.

* lisp/editorconfig-fnmatch.el (editorconfig-fnmatch--cache-hashtable):
Use `defconst`.
(editorconfig-fnmatch--do-translate): Don't escape `,` or `-` in regexps.

* lisp/editorconfig.el (editorconfig-indentation-alist):
Remove redundant entries for `ess-mode` and `terra-mode`.
2025-12-12 15:29:13 -05:00
lolbinarycat
96bb95c8cc editorconfig-fnmatch: fix ** globs (#374)
Cherypick of upstream commit 4af10445fcdf1c9dfa7af4f9e5bec59e8a759d6f
2025-12-12 15:26:30 -05:00
Mattias Engdegård
55b610490b * lisp/cus-start.el: Better unbound variable filter.
Remove (almost) all regexp matching and the need for saving match data.
Signal an error for unbound variables instead of a timid message,
so that it's certain to be noticed.
2025-12-12 18:55:21 +01:00
Mattias Engdegård
8158c4c43a * lisp/cus-start.el: Clean up.
Avoid computing things unless needed.  Use a slightly more modern elisp
style with fewer variable assignments.
2025-12-12 18:50:48 +01:00
Gerd Möllmann
6209771ddb ; Fix xt-mouse-tests
* lisp/xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal):
Don't use the terminal's top frame in batch mode.
2025-12-12 17:27:52 +01:00
Michael Albinus
74cbef7c45 Fix :type in `antlr-tool-command'
* lisp/progmodes/antlr-mode.el (antlr-tool-command): Give it a
proper :type.
2025-12-12 17:01:31 +01:00
Mattias Engdegård
251c070dfd Warn about uses of the 'any' atom in rx
'any' is a holdover from the ancient 'sregex' package where it meant
'not-newline', but is easily mistaken for 'anychar'.

* lisp/emacs-lisp/rx.el (rx--translate-symbol): Warn about 'any'.
* test/lisp/emacs-lisp/rx-tests.el (rx-atoms): Suppress warning here.
* etc/NEWS: Explain.
2025-12-12 13:55:29 +01:00
Eli Zaretskii
948c4f7f64 ; * admin/authors.el (authors-aliases): Add Rudolf Adamkovič (bug#79987). 2025-12-12 14:15:54 +02:00
Mattias Engdegård
8a58ce0abd Don't use rx 'any' to mean 'not-newline'
* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1):
* lisp/pcmpl-rpm.el (pcomplete/dnf):
* test/lisp/emacs-lisp/package-vc-tests.el (log-incoming):
Use 'anychar' instead of 'any', since that's probably what was meant.
2025-12-12 13:03:45 +01:00
Mattias Engdegård
4bf919a0e6 ; * lisp/progmodes/antlr-mode.el: useless backslashes 2025-12-12 12:51:08 +01:00