Commit graph

177925 commits

Author SHA1 Message Date
Eli Zaretskii
2b3763e955 Merge from origin/emacs-30
d3c39fb522 Fix display of keys in 'help-form' buffers (bug#77118)
6509cc20a9 Improve documentation of 'user-emacs-directory'
3f06059730 Update remarks on name prefixes in coding conventions
e966ff9759 ; * doc/emacs/files.texi (Image Mode): Fix a typo (bug#77...
378bea99b1 ; Fix doc strings of a few Dired commands
30fb2ac07a ; * CONTRIBUTE: Clarify single-line commit should end wit...
417d14a95e ; * admin/MAINTAINERS: Complete the handover of VC
bb756b195a ; Fix typo in Tramp
2025-04-12 08:57:38 -04:00
Eli Zaretskii
6221e9a66d ; Merge from origin/emacs-30
The following commit was skipped:

684adc07c2 ; Fix a recent backport
2025-04-12 08:57:38 -04:00
Visuwesh
bf7bcbaa3d Limit fontification of "customize" in setopt suggestion
* lisp/help-fns.el (help-fns--customize-variable): Limit the
fontification to newly inserted text to avoid spurious
fontification of other instances of the word "customize."
2025-04-12 14:22:55 +03:00
Eli Zaretskii
50531a00b5 ; * etc/NEWS: Fix wording and punctuation in last added entry. 2025-04-12 14:12:05 +03:00
Spencer Baugh
861e7f8b60 flymake: fall back to margins on text terminals
Previously, flymake-indicator-type defaulted to either fringes
or margins.  But fringes should be used on graphical frames, and
margins on TTY frames.  So default to fringes instead, and
simply fall back to margins automatically on text frames.

* lisp/progmodes/flymake.el (flymake-indicator-type): Set to
fringes.  (bug#77313)
(flymake-mode): Fallback to margins if there's no fringes.
* doc/misc/flymake.texi (Customizable variables): Mention
fallback behavior.
* etc/NEWS: Announce fallback behavior.
2025-04-12 14:10:19 +03:00
Stephen Berman
d3c39fb522 Fix display of keys in 'help-form' buffers (bug#77118)
* lisp/help.el (help-form-show): Use 'insert' instead of 'princ'
so that keys in 'help-form' are displayed with 'help-key-binding' face.
2025-04-12 12:01:50 +02:00
Eli Zaretskii
6509cc20a9 Improve documentation of 'user-emacs-directory'
* doc/emacs/custom.texi (Find Init): Document the effect of
'user-emacs-directory' on native compilation.  Advise against
changing the value of 'user-emacs-directory' in init files.
(Bug#77745)
2025-04-12 09:52:04 +03:00
Sean Whitton
3f06059730 Update remarks on name prefixes in coding conventions
* doc/lispref/tips.texi (Coding Conventions): Say that it's okay
to put the name prefix later for defining constructs, rather
than explicitly instructing the reader to do so.  Condense the
recommendation to err on the side of prepending the name prefix.
2025-04-12 11:05:45 +08:00
Sean Whitton
3b841700a8 vc-do-async-command: Ellipse later lines in multiline arguments
* lisp/emacs-lisp/cl-print.el (cl-print-expand-ellipsis): Bind
inhibit-read-only to t.
* lisp/vc/vc-dispatcher.el (require): Require cl-print at
compile time.
(vc-do-async-command): When printing command arguments that
contain multiple lines, use cl-prin1 with cl-print-string-length
bound in order to ellipse lines other than the first.
Switch the outer quotation marks to single quotation marks.
2025-04-12 10:05:57 +08:00
Sean Whitton
cc232bd7a1 ; * etc/NEWS: Move new variables only for Lisp programmers downwards. 2025-04-12 10:05:29 +08:00
Juri Linkov
695edc5b55 Rename treesit-toggle-sexp-type to treesit-cycle-sexp-type.
* lisp/treesit.el (treesit-cycle-sexp-type):
Rename from 'treesit-toggle-sexp-type'.  Fix docstring.
https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00291.html
2025-04-11 19:34:29 +03:00
Sean Whitton
53058e15c3 ; * etc/NEWS: Expand description of vc-buffer-overriding-fileset. 2025-04-11 18:46:37 +08:00
Michael Albinus
1be9007c0d ; * etc/NEWS: Fix typos. 2025-04-11 11:58:40 +02:00
Eli Zaretskii
e966ff9759 ; * doc/emacs/files.texi (Image Mode): Fix a typo (bug#77723). 2025-04-11 11:33:26 +03:00
Sean Whitton
95675b4db0 ; Delete FIXME in vc-print-log
This isn't a state-changing operation, indeed, and passing t
here is relevant to dired-vc-deduce-fileset.
2025-04-11 11:47:32 +08:00
Sean Whitton
60530889c3 New buffer-local vc-buffer-overriding-fileset and vc-buffer-revision
* lisp/vc/vc.el (vc-buffer-overriding-fileset)
(vc-buffer-revision): New variables (bug#77529).
(vc-find-revision-save, vc-find-revision-no-save): Set them.
(vc-deduce-fileset): Respect vc-buffer-overriding-fileset.
(vc-print-log): Use vc-buffer-revision as a default working
revision.

* lisp/vc/vc-annotate.el (vc-annotate-parent-file)
(vc-annotate-parent-rev): Delete.
(vc-annotate): Respect vc-buffer-overriding-fileset and
vc-buffer-revision.  This makes 'C-x v g' work from buffers
generated by 'C-x v ~' (bug#5424).
Set the two variables in the newly prepared buffer.
(vc-annotate-working-revision)
(vc-annotate-extract-revision-at-line)
(vc-annotate-revision-at-line, vc-annotate-warp-revision)
(vc-annotate-goto-line):
* lisp/vc/vc-svn.el (vc-svn-annotate-current-time): Use
vc-buffer-overriding-fileset instead of vc-annotate-parent-file,
vc-buffer-revision instead of vc-annotate-parent-rev.
(vc-annotate-parent-rev): Delete declaration.

* etc/NEWS: Announce the new variables.
2025-04-11 11:46:05 +08:00
Sean Whitton
37164032f6 ; Normalize spacing in last change 2025-04-11 10:02:54 +08:00
Stefan Monnier
c0ea954d0f Add lexical-binding cookie to generated files
Side-companion to commits bb0f84bc0b and 50947fd512.
While in there, couldn't resist adding a few minor cleanups
I had lying around.

* lisp/savehist.el (savehist-save): Add `lexical-binding:t` cookie.

* lisp/url/url-cookie.el: Remove redundant `:group` arguments.
(url-cookie-write-file): Add `lexical-binding:t` cookie.

* lisp/abbrev.el: Prefer #' to quote function names.
(write-abbrev-file): Add a `lexical-binding:t` cookie.
(unexpand-abbrev): Use `replace-region-contents` and 3-args `<=`.
(define-abbrev-table): Use `defvar-1`.

* lisp/filesets.el (filesets-menu-cache-file-save-maybe):
Add `lexical-binding:t` cookie.
(filesets-ingroup-patterns): Don't quote lambdas.
(filesets-spawn-external-viewer): Remove redundant "" arg to `mapconcat`.

* lisp/recentf.el: Prefer #' to quote function names.
(recentf-save-file-header): Add `lexical-binding:t` cookie and change
mode to match the actual content.
2025-04-10 16:31:30 -04:00
Juri Linkov
ec62674cb9 Fix treesit-forward-sexp/list navigation in the middle of a node.
* lisp/treesit.el (treesit--forward-list-with-default):
Check the thing 'sexp-default' (bug#76791).

* lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode):
* lisp/progmodes/go-ts-mode.el (go-ts-mode):
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
* lisp/progmodes/sh-script.el (bash-ts-mode):
Add the thing 'sexp-default' to 'treesit-thing-settings'.
2025-04-10 19:20:35 +03:00
Juri Linkov
addcab6891 Rename treesit-toggle-sexp-mode to treesit-toggle-sexp-type.
* lisp/treesit.el (treesit-toggle-sexp-type):
Rename from 'treesit-toggle-sexp-mode'.  Fix docstring.
https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00273.html
2025-04-10 19:04:12 +03:00
Eli Zaretskii
cb9aded6d9 ; Fix an error in 'package-quickstart-refresh'
* lisp/emacs-lisp/package.el (package-quickstart-refresh): Fix a
thinko.  (Bug#77701)
2025-04-10 16:46:00 +03:00
Eli Zaretskii
aa8a5090ec ; Update ldefs-boot.el 2025-04-10 08:04:08 -04:00
Eli Zaretskii
bb0f84bc0b Fix one more case of unnecessary lexbind warnings
* lisp/filesets.el (filesets-menu-cache-file-load): Bind
'warning-inhibit-types' to avoid warning about missing lexbind
cookie when loading the file.
2025-04-10 15:01:04 +03:00
Eli Zaretskii
50947fd512 Avoid warnings about lexbind cookies where they aren't needed
* lisp/emacs-lisp/warnings.el (warning-inhibit-types): New variable.
(display-warning): If TYPE matches 'warning-inhibit-types', don't
display the warning, even if it's emitted during startup.
* lisp/startup.el (normal-top-level):
* lisp/savehist.el (savehist-mode):
* lisp/url/url-cookie.el (url-cookie-parse-file):
* lisp/recentf.el (recentf-load-list):
* lisp/abbrev.el (read-abbrev-file): Bind 'warning-inhibit-types'
to avoid warning about missing lexbind cookie when loading files
that Emacs itself generates.
2025-04-10 14:36:43 +03:00
Po Lu
426a016d61 ; * test/infra/android/test-controller.el (ats-eval): Correct punctuation. 2025-04-10 18:19:28 +08:00
Po Lu
ddcc87514c ; * etc/NEWS: Document previous change. 2025-04-10 15:25:38 +08:00
Po Lu
884ede7c95 Respond to display configuration updates on Android
* java/org/gnu/emacs/EmacsNative.java
(sendConfigurationChanged): Declare function.

* java/org/gnu/emacs/EmacsSdk7FontDriver.java (Sdk7FontEntity)
(Sdk7FontObject): Do not access `metrics' field deleted from
`EmacsService'.

* java/org/gnu/emacs/EmacsService.java (EmacsService)
<metrics, resources>: Delete fields.
<dpiX, dpiY, dpiScaled>: New fields.
(onCreate): Adjust accordingly.  Record current display metrics
for subsequent comparison.
(onConfigurationChanged): New function.

* lisp/dynamic-setting.el (font-setting-change-default-font):
Enable on systems where font-get-system-font is not defined if
invoked with SET-FONT nil.

* src/android.c (sendConfigurationChanged): New function.

* src/androidgui.h (ANDROID_CONFIGURATION_CHANGED): New enumerator.
(struct android_configuration_changed): New structure.
(union android_event): Add `config' member.

* src/androidterm.c (handle_one_android_event): Handle
ANDROID_CONFIGURATION_CHANGED events.
(syms_of_androidterm): Define Qfont_render, and
Qdynamic_setting.  Provide the latter.
2025-04-10 15:25:38 +08:00
Eli Zaretskii
cb339ad8f4 ; * lisp/minibuffer.el (read-file-name): Fix a typo in the doc string. 2025-04-10 09:36:17 +03:00
Eli Zaretskii
b205d7b59d ; Fix recently-added documentation
* etc/NEWS:
* lisp/treesit.el (treesit-toggle-sexp-mode): Fix wording of
recently-added documentation.
2025-04-10 09:26:32 +03:00
Juri Linkov
99a2cb05a4 New command 'treesit-toggle-sexp-mode' (bug#76676).
* lisp/treesit.el (treesit-forward-sexp): Don't use
'treesit-sexp-type-regexp' reserved for list commands
to override their default 'list' thing.
(treesit-down-list, treesit-up-list): Use
'treesit-sexp-type-regexp' instead of 'list'
when it's non-nil.
(treesit-toggle-sexp-mode): New command.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--thing-settings):
Improve 'sexp' thing settings to exclude the top-level
"translation_unit" that just moves to EOF and also "comment".

* lisp/progmodes/elixir-ts-mode.el (elixir-ts--sexp-regexp): Remove.
(elixir-ts--forward-sexp): Remove to use the default 'sexp' navigation.
(elixir-ts--with-parens-0-p, elixir-ts--with-parens-1-p):
New internal functions.
(elixir-ts-mode): Add 'treesit-thing-settings'
instead of 'forward-sexp-function' (bug#76788).

* lisp/progmodes/heex-ts-mode.el (heex-ts--sexp-regexp): Remove.
(heex-ts--forward-sexp): Remove to use the default 'sexp' navigation.
(heex-ts--thing-settings): New variable.
(heex-ts-mode): Use 'heex-ts--thing-settings'
instead of 'forward-sexp-function'.

* lisp/progmodes/java-ts-mode.el (java-ts-mode):
Improve 'sexp' thing to use settings like in c-ts-mode.

* lisp/progmodes/php-ts-mode.el (php-ts-mode):
Improve 'sexp' thing settings to exclude the top-level
"program" that just moves to EOF and also "comment".

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Improve 'sexp' thing to use settings like in c-ts-mode.

* lisp/textmodes/css-mode.el (css--treesit-thing-settings):
Add 'sexp' thing.  Add "string_value" to 'text' thing.

* lisp/textmodes/html-ts-mode.el (html-ts-mode--treesit-things-settings):
Improve 'sexp' thing to use settings like in c-ts-mode.
Add "doctype" to the 'list' thing.
2025-04-09 21:21:53 +03:00
Juri Linkov
fa247a24a5 Improve 'treesit-outline-search'.
* lisp/treesit.el (treesit-outline-search): Remove
temporary arg 'recursive'.  Use iteration to visit
more ranges until the next outline heading is found.

* lisp/progmodes/php-ts-mode.el (php-ts-mode):
Set 'treesit-outline-predicate' explicitly.
2025-04-09 20:40:09 +03:00
Juri Linkov
4b9d571a55 * lisp/subr.el (defvar-local): Change 'indent' to 'defun' (bug#77256). 2025-04-09 20:24:42 +03:00
Eli Zaretskii
378bea99b1 ; Fix doc strings of a few Dired commands
* lisp/dired-aux.el (dired-do-chown, dired-do-touch)
(dired-do-chgrp, dired-do-chmod): Doc fix.  (Bug#77650)
2025-04-09 14:25:29 +03:00
Sean Whitton
09887a2d41 Rename some of the new window layout commands
* lisp/window-x.el (rotate-window-layout-counterclockwise):
Rename to window-layout-rotate-anticlockwise.
(rotate-window-layout-clockwise):
Rename to window-layout-rotate-clockwise.
(flip-window-layout-horizontally):
Rename to window-layout-flip-leftright.
(flip-window-layout-vertically):
Rename to window-layout-flip-topdown.
(transpose-window-layout): Rename to window-layout-transpose.

* doc/lispref/windows.texi (Changing Window Layouts):
* etc/NEWS:
* lisp/ldefs-boot.el (rotate-window-layout-counterclockwise)
(rotate-window-layout-clockwise, flip-window-layout-horizontally)
(flip-window-layout-vertically, transpose-window-layout):
Update for the renames.
2025-04-09 13:34:55 +08:00
Sean Whitton
253364e2c7 VC-Dir: Offer to register files before checking in
* lisp/vc/vc.el (vc-only-files-state-and-model): Rewrite
checking that all files are in compatible VC states.  In
particular, consistently return 'edited' when all files are
either added, removed or edited, instead of allowing the return
value to depend on the order of the files in VC-Dir, and offer
to registered unregistered files if doing so would allow the
operation to proceed.
(vc-compatible-state): Delete.
(vc-next-action): Replace call to vc-compatible-state.
Document, in this command's docstring, the new feature
implemented in vc-only-files-state-and-model.
* etc/NEWS: Announce the new feature.
2025-04-09 12:37:32 +08:00
Sean Whitton
2310c12658 ; vc-setup-buffer: Don't pass a string to buffer-live-p. 2025-04-09 11:04:26 +08:00
Sean Whitton
686032ddaf ; * src/minibuf.c (syms_of_minibuf): Improve some wording. 2025-04-09 10:35:38 +08:00
João Távora
3e22c73fb6 Eglot: announce support for diagnostic version checks (bug#77588)
* lisp/progmodes/eglot.el (eglot-client-capabilities): Mention versionSupport.
2025-04-08 22:16:27 +01:00
Spencer Baugh
40b0c83988 Use relative names where possible in package-quickstart.el
package-quickstart.el hardcodes many absolute file names, which
makes it break if user-emacs-directory moves, or in other
situations.  To be slightly more robust to this, use relative
file names to packages that are located in the same directory as
package-quickstart.el.

* lisp/emacs-lisp/package.el (package--quickstart-dir,
package--quickstart-rel): Add.
(package-quickstart-refresh): Use package--quickstart-rel on
file names.  (bug#77468)
2025-04-08 14:39:44 -04:00
Spencer Baugh
0fbba16387 Preserve an explicit * in pcm-try-completion
An explicitly typed * has different semantics from automatically
inserted PCM wildcards, so it should be preserved on try-completion.  We
already do this in some cases, but now we do it more.

This is especially significant for filename completion: removing an
explicit * can take us from

~/src/emacs/trunk/*/minibuf

to

~/src/emacs/trunk//minibuf

The explicit double slash is interpreted by the file name completion
table to mean "start completing from the root directory", so deleting
the * here substantially changes semantics.

* lisp/minibuffer.el (completion-pcm--merge-completions): Don't drop
important wildcards. (bug#74420)
* test/lisp/minibuffer-tests.el (completion-pcm-test-7): Add tests.
2025-04-08 14:36:30 -04:00
Juri Linkov
bec2de2046 * lisp/treesit.el (treesit--after-change): New function.
(treesit-major-mode-setup): Set 'outline-minor-mode-hook'
to add 'treesit--after-change' with 'treesit-update-ranges'
to 'after-change-functions' (bug#77256).
2025-04-08 20:43:41 +03:00
Juri Linkov
5e0daa1ef7 New function treesit-parsers-at for treesit-language-at (bug#77256).
* doc/lispref/parsing.texi (Multiple Languages): The variable
'treesit-language-at-point-function' is now optional for
multi-language major modes.  Add description of 'treesit-parsers-at'.

* lisp/treesit.el (treesit-language-at-point-function):
Change the the docstring to remove the dissuasion against
deriving the language from parser ranges.
(treesit-language-at): Use the first parser from
'treesit-parsers-at' as the default return value when
'treesit-language-at-point-function' is nil.  Adapt the docstring.
(treesit-node-at): Use 'treesit-parsers-at'.
(treesit-parsers-at): New function.
(treesit-local-parsers-at): Use 'treesit-parsers-at'
with the most part of the body moved to it.
(treesit-local-parsers-on): Replace the overlay property
'treesit-parser' with 'treesit-parser-local-p' in the docstring.
(treesit-up-list, treesit-simple-imenu, treesit-outline-level):
Use 'treesit-parsers-at'.

* lisp/progmodes/c-ts-mode.el (c-ts-mode): Don't set
'treesit-language-at-point-function'.

* lisp/progmodes/elixir-ts-mode.el (elixir-ts--treesit-language-at-point):
Remove.
(elixir-ts-mode): Don't set 'treesit-language-at-point-function'.

* lisp/progmodes/js.el (js--treesit-language-at-point): Remove.
(js-ts-mode): Don't set 'treesit-language-at-point-function'.

* lisp/progmodes/php-ts-mode.el (php-ts-mode--html-language-at-point)
(php-ts-mode--language-at-point): Remove.
(php-ts-mode): Don't set 'treesit-language-at-point-function'.

* lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--language-at-point):
Remove.
(mhtml-ts-mode): Don't set 'treesit-language-at-point-function'.
Use 'treesit-language-at' for mode-line lighter.
2025-04-08 20:40:10 +03:00
Stefan Monnier
7ff674d712 (internal--get-default-lexical-binding): Be more failsafe
* lisp/files.el (internal--get-default-lexical-binding): Try and
avoid signaling an error.  Make it easier to suppress the
warning for a specific file.
2025-04-08 13:10:30 -04:00
Eli Zaretskii
646ccd5e67 Fix prettify-symbols-mode with composition rules
* lisp/progmodes/prog-mode.el
(prettify-symbols--composition-displayable-p): Fix a thinko.
Patch by Visuwesh <visuweshm@gmail.com>.  (Bug#77627)
2025-04-08 19:04:41 +03:00
Sean Whitton
d283db5773 Fix window selection after log-edit-show-diff, again
In October I installed a change to vc-diff-patch-string and
labelled it as "Fix window selection after log-edit-show-diff"
but that change only fixed the problem within
log-view-modify-change-comment.  This change should fix window
selection after C-c C-d in ordinary checkins.

* lisp/vc/log-edit.el (log-edit-diff-fileset): Use
save-selected-window in order to respect the documented
requirement that values of log-edit-diff-function leave the Log
Edit buffer's window selected when they return.
2025-04-08 20:36:42 +08:00
Jeremy Bryant
30fb2ac07a ; * CONTRIBUTE: Clarify single-line commit should end with a period. 2025-04-08 13:43:16 +03:00
João Távora
13f439ce98 Eglot: check textDocument/publishDiagnostics version (bug#77588)
* lisp/progmodes/eglot.el (eglot--versioned-identifier): Move up.
(eglot-handle-notification textDocument/publishDiagnostics): Check
eglot--versioned-identifier
2025-04-08 08:46:17 +01:00
Sean Whitton
577ddbb9b7 ; Fix last change: ensure-list does not ensure a proper list 2025-04-08 15:12:17 +08:00
Sean Whitton
b784f194f8 Factor out vc-only-files-state-and-model
* lisp/dired-aux.el (vc-compatible-state): Delete declaration.
(vc-only-files-state-and-model): Declare.
(dired-vc-deduce-fileset): Factor out vc-only-files-state-and-model.
* lisp/vc/vc-dir.el (require): Require cl-lib at load time, too.
(vc-only-files-state-and-model): Declare.
(vc-dir-deduce-fileset): Factor out vc-only-files-state-and-model.
* lisp/vc/vc.el (vc-only-files-state-and-model): New function,
factored out of dired-vc-deduce-fileset and vc-dir-deduce-fileset.
2025-04-08 14:09:07 +08:00
Sean Whitton
5f89eadb3f ; Drop Mtn from comment now vc-mtn is obsolete 2025-04-08 13:24:15 +08:00