Commit graph

97598 commits

Author SHA1 Message Date
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
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
Stefan Monnier
19257efbf7 lisp/files.el (internal--get-default-lexical-binding): Buttonize the M-x 2025-04-07 23:24:21 -04:00
Stefan Monnier
9dc6177206 lisp/files.el (internal--get-default-lexical-binding): Handle nested loads 2025-04-07 22:48:01 -04:00
Stefan Monnier
9f25d46568 (Fload, Feval_buffer): Emit a warning when lexbind is unset (bug#74145)
This emits a warning at run-time rather than at compile time.

* src/lread.c (get_lexical_binding): New function.
(Fload, Feval_buffer): Use it.
(syms_of_lread): New var `internal--get-default-lexical-binding-function`.
* lisp/files.el: Set it.
(internal--get-default-lexical-binding): New function.
2025-04-07 21:41:35 -04:00
Stefan Monnier
9663c959c7 eieio: Improve some obsolecence warnings and fix #<CLASS CLASS-XX> names
* lisp/emacs-lisp/eieio.el (eieio--constructor-macro): Improve message.
(eieio-object-name-string): Avoid repeated class name in the output of
`eieio-object-name`.
(make-instance, clone): Improve message.

* lisp/emacs-lisp/eieio-core.el (eieio-defclass-autoload): Use the same
obsolescence warning as elsewhere.
2025-04-07 12:48:18 -04:00
Stefan Monnier
fb5da5035a Merge branch 'cedet-object-name' 2025-04-07 00:58:32 -04:00
Stefan Monnier
aca9f8c50a lisp/emacs-lisp/eieio-custom.el: Require eieio-base to silence warning 2025-04-07 00:10:42 -04:00
Stefan Monnier
71afa12941 eieio: Emit compilation warnings a bit more thoroughly
We used to warn about unknown slots only in `oref`: add the same check
for `oset` and `slot-boundp`.
Similarly, we warned about obsolete name args only when calling the
constructors: add the same check to `make-instance`.

* lisp/emacs-lisp/eieio-core.el (eieio--check-slot-name): New function
extracted from the compiler-macro of `eieio-oref`.
(eieio-oref, eieio-oset): Use it.
* lisp/emacs-lisp/eieio.el (slot-boundp): Use it.
 (eieio--constructor-macro): Add category to warning.
(make-instance): Add compiler-macro to warn about obsolete name.
2025-04-07 00:06:52 -04:00
Stefan Monnier
308a5ff0f8 (srecode-macro-help): Use cl--class-docstring
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help): Don't
rely on `variable-documentation`.
2025-04-07 00:06:52 -04:00
Stefan Monnier
f0c1de75e1 cedet: Prefer slot-value over eieio-object-name-string
* lisp/cedet/srecode/mode.el (srecode-minor-mode-templates-menu):
* lisp/cedet/srecode/insert.el (srecode-insert-subtemplate):
* lisp/cedet/srecode/compile.el (srecode-dump): Prefer `slot-value`
over `eieio-object-name-string` since we know it's an
`eieio-named` object.
2025-04-07 00:06:08 -04:00
Stefan Monnier
48b41d595c cedet: Don't abuse initargs for slot names
* lisp/cedet/ede/base.el (ede-normalize-file/directory):
* lisp/cedet/ede/emacs.el (initialize-instance):
* lisp/cedet/ede/generic.el (initialize-instance):
* lisp/cedet/ede/linux.el (initialize-instance, project-rescan):
* lisp/cedet/srecode/map.el (srecode-map-update-map):
* lisp/cedet/srecode/srt-mode.el (srecode-parse-this-macro):
* lisp/cedet/ede/simple.el (ede-simple-load):
Use slot names rather than initargs with oref/oset/slot-value/...
2025-04-07 00:05:28 -04:00
Stefan Monnier
05680dc6c5 cedet: Delete obsolete object name arg to EIEIO constructors
For classes that don't inherit from `eieio-named`, this argument
is ignored anyway.

* lisp/auth-source-pass.el (auth-source-pass-backend): Delete obsolete
object-name argument to `auth-source-backend` constructor.

* lisp/cedet/ede/config.el (ede-config-get-configuration): Delete obsolete
object-name argument to ede-config constructor.

* lisp/cedet/ede/cpp-root.el (ede-find-target): Delete obsolete
object-name argument to `ede-cpp-root-target` constructor.

* lisp/cedet/ede/locate.el (ede-enable-locate-on-project): Delete obsolete
object-name argument to ede-locate constructor.

* lisp/cedet/ede/project-am.el (project-am-load-makefile): Delete obsolete
object-name argument to `project-am-makefile` constructor.

* lisp/cedet/semantic/complete.el (semantic-complete-read-tag-buffer-deep)
(semantic-complete-read-tag-local-members)
(semantic-complete-read-tag-project, semantic-complete-read-tag-analyzer):
Delete obsolete object-name argument to
`semantic-collector-buffer-deep`,
`semantic-collector-local-members`,
`semantic-collector-project-brutish`, and
`semantic-collector-analyze-completions` constructors.

* lisp/cedet/semantic/db-ebrowse.el (semanticdb-create-database):
Delete obsolete object-name argument to
`semanticdb-project-database-ebrowse` constructor.

* lisp/cedet/semantic/db-file.el (semanticdb-create-database): Delete
obsolete object-name argument to
`semanticdb-project-database-file` constructor.

* lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache):
Delete obsolete object-name argument to `semanticdb-typecache` constructor.

* lisp/cedet/semantic/db.el (semanticdb-get-table-index)
(semanticdb-create-table):
Delete obsolete object-name argument to
`semanticdb-default-find-index-class`, new-table-class, and
desired-class constructors.

* lisp/cedet/semantic/bovine/c.el (semantic-analyze-tag-references):
* lisp/cedet/semantic/analyze/refs.el
(semantic-analyze-tag-references-default): Delete obsolete
object-name argument to `semantic-analyze-references` constructor.

* lisp/cedet/srecode/compile.el (srecode-compile-templates):
Delete obsolete object-name argument to `srecode-compile-state` and
`srecode-dictionary-compound-variable` constructors.

* lisp/cedet/srecode/cpp.el (srecode-semantic-apply-tag-to-dict)
(srecode-c-apply-templates): Delete obsolete object-name argument to
`srecode-semantic-tag` constructors.

* lisp/cedet/srecode/dictionary.el (srecode-dictionary-add-entries)
(srecode-compound-toString): Delete obsolete object-name argument to
`srecode-dictionary-compound-variable` and `srecode-field` constructors.

* lisp/cedet/srecode/insert.el (srecode-insert-method-field):
Delete obsolete object-name argument to `srecode-field-value` constructor.

* lisp/cedet/srecode/semantic.el (srecode-semantic-handle-:tag)
(srecode-semantic-insert-tag, srecode-semantic-apply-tag-to-dict-default):
Delete obsolete object-name argument to `srecode-semantic-tag` constructors.

* lisp/cedet/srecode/table.el (srecode-mode-table-new): Delete
obsolete object-name argument to `srecode-template-table` constructor.
2025-04-07 00:03:20 -04:00
Stefan Monnier
f75f8f3d6a cedet: Pass object name via explicit :object-name arg
* lisp/cedet/srecode/insert.el (srecode-parse-input):
* lisp/cedet/srecode/compile.el (srecode-compile-one-template-tag)
(srecode-compile-inserter): Pass object name via explicit
`:object-name` arg to `srecode-template`,
`srecode-template-inserter-variable`, and children of `srecode-template`.

* lisp/cedet/semantic/mru-bookmark.el (semantic-mrub-push):
Pass object name via explicit `:object-name` arg to `semantic-bookmark`.
2025-04-07 00:02:20 -04:00
Sean Whitton
e9e11f7281 Add bindings for vc-git-stash-delete-at-point, vc-git-stash-delete
* lisp/vc/vc-git.el (vc-git-stash-map): Bind "D" to
vc-git-stash-delete-at-point.
(vc-dir-git-mode-map): Bind "z d" to vc-git-stash-delete.
* etc/NEWS: Announce the new bindings.
2025-04-07 11:28:35 +08:00
Sean Whitton
1e100f482c ; * lisp/vc/ediff-wind.el (ediff-with-live-window): Use cl-once-only 2025-04-07 10:19:58 +08:00
Sean Whitton
3ccd25f6b0 * lisp/vc/vc-git.el (vc-git-checkin): Actually pass down TO-STASH. 2025-04-07 10:05:08 +08:00
Sean Whitton
7f60aa45aa vc-git-checkin: Don't relativize names of temporary files
* lisp/vc/vc-git.el (vc-git-checkin)
(vc-git--stash-staged-changes): Don't relativize names of
temporary files passed to 'git apply --cached'.  More generally,
these are not files managed by the underlying VCS, so they
shouldn't go in the FILE-OR-LIST argument to vc-git-command.
2025-04-07 10:03:46 +08:00
João Távora
ba13e7de32 Icomplete: rename some internal helper functions (bug#77546)
The naming convention for internal functions is

  <package-name>--foo

not

  <package-name-subfunctionality>--foo

* lisp/icomplete.el (icomplete--adjust-lines-for-column): Rename
from icomplete-vertical--adjust-lines-for-column.
(icomplete--ensure-visible-lines-inside-buffer): Rename from
icomplete-vertical--ensure-visible-lines-inside-buffer.
(icomplete--add-indicator-to-selected): Rename from
icomplete-vertical--add-indicator-to-selected.
(icomplete--render-vertical): Use new internal function names.
2025-04-06 14:08:14 +01:00
João Távora
819f92cb12 Icomplete: check flag before rendering vertical indicators
Fixes: bug#77546

* lisp/icomplete.el (icomplete-vertical--add-indicator-to-selected): Rework.
(icomplete--render-vertical): Fix bug.
2025-04-06 14:08:14 +01:00
Michael Albinus
bb756b195a ; Fix typo in Tramp
* lisp/net/tramp-cache.el (with-tramp-saved-connection-property):
Fix typo.
2025-04-06 09:11:06 +02:00
Sean Whitton
8ae7224b8f ; VC credits: Add some names 2025-04-06 11:46:23 +08:00
Sean Whitton
936b2efdb3 Teach VC-Dir to automatically add and remove marks on other lines
* lisp/vc/vc-dir.el (vc-dir-allow-mass-mark-changes): New option.
(vc-dir-parent-marked-p): Replace with ...
(vc-dir--parent): ... this.
(vc-dir-children-marked-p): Replace with ...
(vc-dir--children): ... this.
(vc-dir-mark-file): Unmark subitems before marking a directory.
Offer to unmark a directory before marking a subitem.
(vc-dir-unmark-file): For an implicitly marked item, offer to
unmark it by marking everything else that's implicitly marked.
For an unmarked directory with marked subitems, offer to unmark
them all.
* etc/NEWS: Document the changes.
2025-04-06 11:18:57 +08:00
Sean Whitton
c0b1b54d73 Fix dired-vc-next-action generating inconsistent marks
* lisp/vc/vc-dir.el (vc-dir-mark-files): Document that
directories passed to this function must have trailing slashes.
Don't mark both a directory and also items under it (bug#76769).
* lisp/dired-aux.el (dired-vc-next-action): Update docstring.
2025-04-06 11:09:22 +08:00
Sean Whitton
a5f574429d vc-dir-mark-file: Consistently don't allow marking a subdirectory
* lisp/vc/vc-dir.el (vc-dir-mark-file): Don't allow marking a
subdirectory if its parent is already marked.  This fixes an
inconsistency whereby if a subdirectory was already marked then
its parent could not be marked, but not vice-versa (bug #76769).
2025-04-06 09:09:32 +08:00
Alan Mackenzie
c418e454b3 macroexp--expand-all: Don't call function-get on non-symbols
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Don't call
function-get on non-symbols (bug#77550).
2025-04-06 07:30:27 +08:00
Eli Zaretskii
684adc07c2 ; Fix a recent backport
* lisp/progmodes/typescript-ts-mode.el
(treesit-node-child-by-field-name, treesit-node-match-p)
(treesit-node-type): Declare.  Do not merge to master.
2025-04-05 15:09:20 +03:00
Eli Zaretskii
54b485ced6 Merge from origin/emacs-30
99d70ce6c2 Fix Tramp problem with loooongish file names
2025-04-05 07:07:29 -04:00
Eli Zaretskii
2054060d56 Merge from origin/emacs-30
ae7f65f3f9 Fix obsolete documentation of desktop library
fd5f817882 Improve Tramp's initial warnings
1e865a2f28 Explain, how to suppress Tramp warnings
a096207474 printed manuals: xrefs in and out of "Preparing Patches"
3f9ac99fc7 Fix Tramp's file-attributes cache
2025-04-05 07:07:29 -04:00
James Thomas
5987d77f40 * lisp/gnus/nnfeed.el (nnfeed--write-server): Use default print settings.
Bug#77113
2025-04-05 13:35:40 +03:00
Billy Lei
183ab3372e Add input method for languages based on Burmese
This adds 4 new input methods:
 . Burmese
 . Burmese Visual
 . Shan
 . Mon
* lisp/leim/quail/burmese.el: New file.  (Bug#77026)
2025-04-05 12:44:39 +03:00
Paul Nelson
2d0b5f34a0 Restrict symbol prettification to displayable glyphs
* lisp/international/mule.el (char-displayable-on-frame-p): New
function used to determine whether a character can be
meaningfully displayed on a given frame.
* doc/lispref/display.texi (Fontsets): Document it.
* lisp/progmodes/prog-mode.el
(prettify-symbols--composition-displayable-p): New function used
to restrict to displayable prettification symbols.  This
prevents issues with missing characters appearing as boxes.
(prettify-symbols--make-keywords): Use it.  (Bug#77381)
2025-04-05 12:24:50 +03:00
Paul Nelson
ef6203b64a Extend prettify-symbols-alist in TeX mode
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Add
further math symbols, quotes and fractions.  (Bug#77381)
2025-04-05 12:21:29 +03:00
Elías Gabriel Pérez
8fc18d0968 Optionally display function docstring in eldoc
Allow display (optionally) function docstring in eldoc. (Bug#77124)
* etc/NEWS: Document changes.
* lisp/progmodes/elisp-mode.el
(elisp-eldoc-funcall-with-docstring-length): New user option.
(elisp-eldoc-funcall-with-docstring): New function.
2025-04-05 12:08:20 +03:00
Visuwesh
c73e4cdece Improve formatting of 'setopt' suggestion in *Help* buffer
* lisp/help-fns.el (help--recommend-setopt): Remove function,
and...
(help-fns--customize-variable): ... move the relevant code here
to keep related code in the same place.  Change the formatting
to also include the :set function if it is set to a named
function.  (Bug#77173)
2025-04-05 11:45:37 +03:00
Eli Zaretskii
cffe5a0245 ; Fix wording of recent documentation changes
* lisp/desktop.el (desktop-restore-frames):
* etc/NEWS:
* doc/emacs/misc.texi (Saving Emacs Sessions): Fix wording of the
recent changes.
2025-04-05 10:11:03 +03:00
Eshel Yaron
3ee021dc19
; (find-function-search-for-symbol): Be cautious with macros.
* lisp/emacs-lisp/find-func.el
(find-function-search-for-symbol): Only attempt to expand
macros in trusted buffers.  (Bug#77341)
2025-04-05 08:04:55 +02:00
Stefan Monnier
cd41247dc1 perl-mode.el: Avoid obsolete font-lock face vars
* lisp/progmodes/perl-mode.el (perl-mode-abbrev-table): Merge defvar
into the definition.
(perl-font-lock-keywords-1, perl-font-lock-keywords-2): Avoid obsolete
font-lock face vars.
2025-04-04 23:53:10 -04:00
Po Lu
d582ed9dc9 Disable desktop-restore-frames by default on Android
* lisp/desktop.el (desktop-restore-frames): Default to nil when
\(featurep 'android).

* doc/emacs/misc.texi (Saving Emacs Sessions): Adjust to match.
2025-04-05 10:30:36 +08:00
Paul D. Nelson
2bced74aa9 ediff-current-file: New optional startup-hooks arg
* lisp/vc/ediff.el (ediff-current-file): Add optional
startup-hooks argument, so that the user can write wrapper
commands with more finely customized behavior (bug#77323).
2025-04-05 09:36:29 +08:00
Stefan Monnier
1fdaad5253 lisp/emacs-lisp/warnings.el (display-warning): Don't quote lambda 2025-04-04 16:53:05 -04:00
Stefan Monnier
21920da6c7 (defclass): Don't duplicate the compiler macro
* lisp/emacs-lisp/eieio.el (eieio--constructor-macro): New function.
(defclass): Use it.
2025-04-04 16:48:57 -04:00
Stefan Monnier
fce3f0ad4a lisp/calc/calc-keypd.el (calc-keypad-vector-menu): Don't quote lambda 2025-04-04 16:45:25 -04:00