1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00
Commit Graph

175501 Commits

Author SHA1 Message Date
Jim Porter
9682d385c1 Improve correctness of Eshell globs when using escape characters
This new implementation opts *in* to treating characters as glob
characters, rather than opting out.  This reduces the need to coordinate
with other parts of Eshell and should be harder to break (bug#74033).

* lisp/eshell/em-glob.el (eshell-parse-glob-chars): Return the
propertized globbing character directly.
(eshell--propertize-glob, eshell--glob-char-p)
(eshell--contains-glob-char-p, eshell--all-glob-chars-p): New functions.
(eshell-glob-p): Make obsolete.
(eshell-glob-regexp, eshell-glob-convert-1, eshell-glob-convert): Check
for 'eshell-glob-char' property.
(eshell-extended-glob): Remove text properties when returning no match.
(eshell--glob-anything): New constant.
(eshell-glob-entries): Propertize "*" to treat it as a glob.

* lisp/eshell/em-ls.el (eshell-ls--expand-wildcards): New function...
(eshell-ls--insert-directory): ... use it.

* test/lisp/eshell/em-glob-tests.el: Use 'eshell--propertize-glob' in
tests.
(em-glob-test/convert/literal-characters)
(em-glob-test/convert/mixed-literal-characters): New tests.

* lisp/eshell/em-glob.el (eshell-expand-glob): Rename from
'eshell-extended-glob'.  Update callers.
(eshell-extended-glob): New function to expand a GLOB that hasn't been
propertized yet, for use outside of Eshell command forms.
(eshell-parse-glob-chars): Return the propertized globbing character
directly.
(eshell-parse-glob-string, eshell--glob-char-p)
(eshell--contains-glob-char-p, eshell--all-glob-chars-p): New functions.
(eshell-glob-regexp, eshell-glob-convert-1, eshell-glob-convert): Check
for 'eshell-glob-char' property.
(eshell-glob-p): Make obsolete.
(eshell--glob-anything): New constant...
(eshell-glob-entries): ... use it.

* lisp/eshell/em-ls.el (eshell-ls--expand-wildcards): New function...
(eshell-ls--insert-directory): ... use it.

* test/lisp/eshell/em-glob-tests.el: Use 'eshell-parse-glob-string in
tests.
(em-glob-test/convert/literal-characters)
(em-glob-test/convert/mixed-literal-characters): New tests.
2024-10-31 22:38:10 -07:00
Jim Porter
98e24e369a Fix and improve behavior of 'eshell/clear'
* lisp/eshell/esh-mode.el (eshell-clear): New function.
(eshell/clear): Fix incorrect behavior, and do the right thing when
'eshell-scroll-show-maximum-output' is nil.
(eshell/clear-scrollback): Call 'eshell/clear'.

* test/lisp/eshell/esh-mode-tests.el
(esh-mode-test/clear/eshell-command)
(esh-mode-test/clear/eshell-command/erase)
(esh-mode-test/clear/emacs-command)
(esh-mode-test/clear/emacs-command/erase): New tests.

* etc/NEWS: Mention the new 'eshell-command' (bug#73722).
2024-10-31 22:36:16 -07:00
Steven Allen
9ff155183c Remove undefined variable from c-ts-common.el
This variable came from code copied from c-indent-new-comment-line.
It's a parameter meant to be used by c-context-line-break, not a
global variable.

* lisp/progmodes/c-ts-common.el (c-ts-common-comment-indent-new-line):
Remove reference to undefined variable.  (Bug#74149)
2024-11-01 02:17:24 +01:00
Dmitry Gutov
0f9d48e99c project-tests: Add test assertion for bug#73801
* test/lisp/progmodes/project-tests.el
(project-vc-extra-root-markers-supports-wildcards): End with a
check that we didn't cache a wrong value for parent (bug#73801).

(cherry picked from commit 94a9e40e82)
2024-11-01 02:35:08 +02:00
Dmitry Gutov
b4b0d5a853 project-try-vc: Fix the "sometimes wrong cache" issue
* lisp/progmodes/project.el (project-try-vc--search):
Extract from 'project-try-vc'.
(project-try-vc): Use it.
(project-try-vc--search): Call itself recursively directly, to
avoid creating invalid cache entry (bug#73801).

(cherry picked from commit 29b30eb49f)
2024-11-01 02:34:36 +02:00
Dmitry Gutov
94a9e40e82 project-tests: Add test assertion for bug#73801
* test/lisp/progmodes/project-tests.el
(project-vc-extra-root-markers-supports-wildcards): End with a
check that we didn't cache a wrong value for parent (bug#73801).
2024-11-01 02:32:10 +02:00
Jim Porter
33997047e8 Don't remove trailing slash in Eshell "pwd" for remote root directories
* lisp/eshell/em-dirs.el (eshell/pwd): Check if 'file-local-name' of the
directory is the root dir.
2024-10-31 10:37:24 -07:00
Robert Pluim
9fe7b8ca41 ; * lisp/vc/smerge-mode.el: Fix typo in comment. 2024-10-31 16:28:44 +01:00
Stephen Berman
8113b5c562 Fix bugs in dabbrev-expand (bug#74090)
* lisp/dabbrev.el (dabbrev-expand): Use the buffer where the
expansion was found when setting the internal variables used to
determine the next expansion or a replacement expansion.

* test/lisp/dabbrev-tests.el (ert-x): Require for
'ert-with-temp-directory', 'ert-resource-directory' and
'ert-resource-file'.
(with-dabbrev-test): New macro.
(dabbrev-expand-test-same-buffer-{1,2,3,4})
(dabbrev-expand-test-other-buffer-{1,2,3,4})
(dabbrev-expand-test-minibuffer-{1,2,3,4}): New tests.

* test/lisp/dabbrev-resources/dabbrev-expand.el:
* test/lisp/dabbrev-resources/INSTALL_BEGIN: New test resources.

(cherry picked from commit f6c359cb66)
2024-10-31 12:12:25 +01:00
Cecilio Pardo
bf395fd8bc Fix 'yank-media' to allow yanking SVG data
* lisp/net/mailcap.el (mailcap-mime-type-to-extension): Return
"svg" for mime type 'image/svg+xml'.  Org-mode uses this.
* lisp/yank-media.el (yank-media--find-matching-media): If svg is
supported, don't filter out 'image/svg+xml'.  (Bug#74044)
2024-10-31 12:36:31 +02:00
Augusto Stoffel
9c5b6e88e7 shr.el: Define rendering rule for math tag
* lisp/net/shr.el (shr-tag-math): New function, see bug#73641.
2024-10-31 12:19:48 +02:00
Stephen Berman
f6c359cb66 Fix bugs in dabbrev-expand (bug#74090)
* lisp/dabbrev.el (dabbrev-expand): Use the buffer where the
expansion was found when setting the internal variables used to
determine the next expansion or a replacement expansion.

* test/lisp/dabbrev-tests.el (ert-x): Require for
'ert-with-temp-directory', 'ert-resource-directory' and
'ert-resource-file'.
(with-dabbrev-test): New macro.
(dabbrev-expand-test-same-buffer-{1,2,3,4})
(dabbrev-expand-test-other-buffer-{1,2,3,4})
(dabbrev-expand-test-minibuffer-{1,2,3,4}): New tests.

* test/lisp/dabbrev-resources/dabbrev-expand.el:
* test/lisp/dabbrev-resources/INSTALL_BEGIN: New test resources.
2024-10-31 10:46:27 +01:00
Yuan Fu
3101c5031e
Fix undefined variable in previous commit (bug#73900)
I somehow thought allow-auto-fill is a global variable that's
used by cc.  But it's not.  It's just a function param used by
c-indent-new-comment-line.

* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): Remove reference to
allow-auto-fill.
2024-10-30 18:18:50 -07:00
Yuan Fu
e6a8492fab
Fix c-ts-common-comment-indent-new-line (bug#73900)
* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): Delete trailing
whitespace before inserting newline.  The insert-line-break
function is the same as in c-indent-new-comment-line.
2024-10-30 18:18:06 -07:00
Yuan Fu
df5ac0daf0
Fix the call to treesit-thing-defined-p
* lisp/treesit.el (treesit-defun-at-point): Add the necessary
2nd argument.
2024-10-30 18:17:59 -07:00
Juri Linkov
7a3c10dcb5 Backport: Call tab-bar-tab-post-open-functions during tabs initialization
* lisp/tab-bar.el (tab-bar-tabs): Run the hook
'tab-bar-tab-post-open-functions' after creating the first tab
in the selected frame's tab-bar list of tabs (bug#74087).
Suggested by Ship Mints <shipmints@gmail.com>.

(cherry picked from commit 2c062dfdf5)
2024-10-30 21:27:27 +02:00
Juri Linkov
2c062dfdf5 Call tab-bar-tab-post-open-functions during tabs initialization
* lisp/tab-bar.el (tab-bar-tabs): Run the hook
'tab-bar-tab-post-open-functions' after creating the first tab
in the selected frame's tab-bar list of tabs (bug#74087).
Suggested by Ship Mints <shipmints@gmail.com>.
2024-10-30 20:32:28 +02:00
Eli Zaretskii
57fe24961f Prevent 'string-pixel-width' from deactivating the region
* lisp/emacs-lisp/subr-x.el (work-buffer--release)
(string-pixel-width): Bind 'deactivate-mark' around buffer
modifications, to avoid deactivating the region as side effect of
calling this function.  (Bug#74091)
2024-10-30 16:55:52 +02:00
Laurence Warne
98796f95fa Work on proced-tests.el
* test/lisp/proced-tests.el
(proced--assert-process-valid-cpu-refinement-explainer): New function
for explaining refinement test failures in greater detail.
2024-10-30 15:12:13 +01:00
Michael Albinus
1bf1753d79 Tramp: Use when-let*', if-let*' and `and-let*' consequently
* lisp/net/tramp-adb.el:
* lisp/net/tramp-androidsu.el:
* lisp/net/tramp-cache.el:
* lisp/net/tramp-cmds.el:
* lisp/net/tramp-compat.el:
* lisp/net/tramp-container.el:
* lisp/net/tramp-crypt.el:
* lisp/net/tramp-ftp.el:
* lisp/net/tramp-fuse.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-message.el:
* lisp/net/tramp-rclone.el:
* lisp/net/tramp-sh.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp-sshfs.el:
* lisp/net/tramp-sudoedit.el:
* lisp/net/tramp.el:
* test/lisp/net/tramp-tests.el:
Use `when-let*', `if-let*' and `and-let*' consequently.  (Bug#73441)
2024-10-30 10:39:02 +01:00
Sean Whitton
679c0c7b94 ; Revise improvements to vc-git-stash-read
* lisp/vc/vc-git.el (vc-git-stash-read): Use a keyword argument.
Abbreviate the prompt reference to the most recent stash.
(vc-git-stash-pop): Update call to vc-git-stash-read.
2024-10-30 09:34:12 +08:00
Eli Zaretskii
8a4d13e370 ; * doc/lispref/frames.texi (Yanking Media): Add index entry. 2024-10-29 16:27:51 +02:00
Sean Whitton
6a2e49e53f ; * lisp/vc/vc-git.el (vc-git-stash-read): Use string-empty-p. 2024-10-29 20:55:03 +08:00
Sean Whitton
4024c5db89 ; * lisp/vc/vc-git.el (vc-deduce-fileset): Declare. 2024-10-29 20:32:21 +08:00
Sean Whitton
90ffe8a36b Improve prompting for git stashes
* lisp/vc/vc-git.el (vc-git-stash-read): New DEFAULT-MOST-RECENT
optional argument.  Use format-prompt.  Signal user-error
immediately if there are no stashes.  Rewrite docstring.
(vc-git-stash-show, vc-git-stash-apply, vc-git-stash-pop)
(vc-git-stash-delete): Drop trailing ": " from prompts.
(vc-git-stash-pop): Pass non-nil DEFAULT-MOST-RECENT to
vc-git-stash-read.
2024-10-29 20:06:48 +08:00
Sean Whitton
4a49c50a4c VC Git: Use vc-deduce-fileset to determine what to stash
* lisp/vc/vc-git.el (vc-git--deduce-files-for-stash): New function.
(vc-git-stash, vc-git-stash-snapshot): Use it to determine what
to stash.  Update and expand docstrings.
(vc-git-stash-snapshot): No longer unconditionally snapshot all
uncommitted changes across the whole working tree.
2024-10-29 20:06:48 +08:00
Yuan Fu
9aa1865926
Fix c-ts-common-comment-indent-new-line (bug#73900)
* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): Delete trailing
whitespace before inserting newline.  The insert-line-break
function is the same as in c-indent-new-comment-line.
2024-10-29 00:31:17 -07:00
Sean Whitton
15b9d99cef ; * lisp/vc/log-edit.el (log-edit-diff-function): Tweak formatting. 2024-10-29 12:58:08 +08:00
Sean Whitton
c7a1fafa99 * lisp/vc/log-edit.el (log-edit-diff-function): Document. 2024-10-29 12:56:06 +08:00
Stefan Monnier
0aae02a374 * lisp/files.el (require-with-check): Be a bit more lenient (bug74040) 2024-10-28 22:40:15 -04:00
Yuan Fu
1551c306f3
Fix the call to treesit-thing-defined-p
* lisp/treesit.el (treesit-defun-at-point): Add the necessary
2nd argument.
2024-10-28 19:33:20 -07:00
Dmitry Gutov
c0cb369ab1 project--completing-read-strict: Move some common processing here
* lisp/progmodes/project.el (project--completing-read-strict):
Add new optional argument, COMMON-PARENT-DIRECTORY.  Move the
absolute->relative processing of MB-DEFAULT and the contents of
HIST here.
(project--read-file-cpd-relative): From here.  So that
'project--read-file-absolute' can also benefit from those
conversions.
(project--read-file-absolute): Pass the new argument.
(project-read-file-name-function): Update value tags.
2024-10-29 04:28:22 +02:00
Dmitry Gutov
a6626a00dc project--read-file-cpd-relative: Move out the 'included-cpd' logic
* lisp/progmodes/project.el (project-find-dir):
Use 'project-files-relative-names'.  Include "./" here rather than
(project--read-file-cpd-relative): ...doing it here.
2024-10-29 04:28:22 +02:00
Stefan Monnier
cc6a11f483 (with-peg-rules): Fix references to rulesets (bug#74018)
PEG rules get "compiled" to functions with name `peg-rule <RULE>`.
`define-peg-ruleset` instead defines it PEG rules with name
`peg-rule <RULESET> <RULE>`, so that they can be made visible
by `with-peg-rules` simply by adding local aliases from
`peg-rule <RULE>` to `peg-rule <RULESET> <RULE>`.

Apparently when I added `define-peg-ruleset` I somehow failed to
install some of the corresponding code in `with-peg-rules`, so
the aliases were not installed, making it "impossible" to use
rulesets.
[ I still have no idea how this happened and/or where
  the missing code went, so I "recreated" it.  ]

* lisp/progmodes/peg.el (with-peg-rules): Install the aliases
for the rulesets.
(peg--translate-rule-body): Try and preserve
location info when emitting a warning.

* test/lisp/progmodes/peg-tests.el (peg-test-myrules): New ruleset.
(peg-test-ruleset): New test.
2024-10-28 22:14:10 -04:00
Sean Whitton
40cf6f9009 Fix window selection after log-edit-show-diff
* lisp/vc/vc.el (vc-diff-patch-string): Use display-buffer, not
pop-to-buffer, for consistency with log-edit-diff-fileset.
(vc-modify-change-comment): Use save-selected-window around
vc-diff-internal to avoid leaving the *vc-diff* window selected,
for consistency with log-edit-diff-fileset.
2024-10-29 09:40:39 +08:00
Alan Mackenzie
41f347c1d1 elisp-mode-tests.el: Add test for the added fix
* test/lisp/progmodes/elisp-mode-tests.el
(elisp-completes-functions-after-empty-let-bindings):
New test (bug#73880).
2024-10-29 01:51:05 +02:00
Dmitry Gutov
7681eacc39 elisp: Fix completion at funpos after empty let bindings form
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Use
'skip-syntax-backward' instead of 'backward-list' since the latter
also skips over other syntax, such as empty parens (bug#73880).
2024-10-29 01:38:00 +02:00
Eli Zaretskii
70f084db2f ; * etc/NEWS: Fix typo (bug#74066). 2024-10-28 21:11:50 +02:00
Alan Mackenzie
fb59156655 Call PF correctly from pcase--edebug-match-pat-args
Also correct a doc string and insert commentary.  This fixes
bug#74052.

* lisp/emacs-lisp/edebug.el
(edebug--match-&-spec-op <&interpose>): Correct and complete
the doc string, which now says MUST call exactly once, and
documents the return values of FUN, PF and
edebug--match-&-spec-op.  Also remove an unneeded `(...)
construct.

* lisp/emacs-lisp/pcase.el (pcase--edebug-match-pat-args): Call
PF also for the main cases handled.
2024-10-28 16:35:27 +00:00
Alan Mackenzie
c05a13ef0d CC Mode: Add/remove defun buffer locally to post-command-hook
Also remove no longer existing hook.

* lisp/progmodes/cc-mode (c-leave-cc-mode-mode): remove-hook
c-post-command buffer locally.  Delete removal of non-existent
c-post-gc-hook.
(c-basic-common-init): add-hook c-post-command buffer locally.
2024-10-28 15:58:04 +00:00
Sean Whitton
fc3de939b9 Fix C-c C-d and C-c C-w during log-view-modify-change-comment
* lisp/vc/vc-dispatcher.el (log-edit-diff-fileset)
(log-edit-diff-patch): Declare.
(vc-log-edit, vc-start-logentry): New optional argument
DIFF-FUNCTION to specify log-edit-diff-function in the generated
Log Edit buffer.
* lisp/vc/vc.el (vc-modify-change-comment): Pass the new
DIFF-FUNCTION argument to vc-start-logentry.
2024-10-28 21:46:06 +08:00
Eli Zaretskii
b7b55dfc03 More workarounds for GDB bug 32313
* src/eval.c (backtrace_args): Same treatment as
backtrace_function.
2024-10-28 09:04:41 -04:00
Jim Porter
ea68517006 Fix definitions of Eshell "xtra" functions
* lisp/eshell/em-xtra.el (eshell-parse-command): Remove unnecessary
autoload.
(eshell/substitute): Pass the correct number of arguments to
'cl-substitute'.
(eshell/count, eshell/union, eshell/mismatch, eshell/intersection)
(eshell/set-difference, eshell/set-exclusive-or): Use named arguments
for the required arguments (bug#73738).
2024-10-27 21:13:56 -07:00
Dmitry Gutov
29b30eb49f project-try-vc: Fix the "sometimes wrong cache" issue
* lisp/progmodes/project.el (project-try-vc--search):
Extract from 'project-try-vc'.
(project-try-vc): Use it.
(project-try-vc--search): Call itself recursively directly, to
avoid creating invalid cache entry (bug#73801).
2024-10-28 05:53:34 +02:00
Paul Eggert
ebf3fb9a22 Work around GDB bug 32313 when debugging Emacs internals
Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2024-10/msg00653.html
* src/eval.c (backtrace_function_body): Rename from
backtrace_function, and make it static.
(GDB_FUNCPTR): New macro.
(backtrace_function): New function pointer, for GDB only.
2024-10-27 17:23:32 -07:00
Stefan Monnier
9e1abf11fc Tweak doc w.r.t to "void function" (bug#73886)
* doc/lispref/functions.texi (Function Cells): Avoid talking
about the function cell being void.

* src/data.c (Fboundp, Ffmakunbound, Fsymbol_function):
Don't suggest that "void" can be considered as a kind of value.
2024-10-27 14:52:25 -04:00
Protesilaos Stavrou
9e40d3f2a1
Update modus-themes to their version 4.6.0
* doc/misc/modus-themes.org
(Differences between loading and enabling)
(Option for which themes to toggle)
(Option for which themes to rotate, DIY Palette override presets)
(DIY Add padding to the mode line)
(DIY Remap face with local value): Fix typos.
(DIY Add support for solaire-mode): Fix some symbols.
(Full support for packages or face groups)
(Indirectly covered packages): Add newly supported packages.
(DIY Add support for combobulate):,
(DIY Add support for engrave-faces, DIY Add support for howm)
(DIY Add support for meow-mode): Document how to style those
packages.
(Acknowledgements): Update names of people who have in one way
or another contributed to the project.

* etc/themes/modus-operandi-deuteranopia-theme.el:
* etc/themes/modus-operandi-theme.el:
* etc/themes/modus-operandi-tinted-theme.el:
* etc/themes/modus-operandi-tritanopia-theme.el:
* etc/themes/modus-vivendi-deuteranopia-theme.el:
* etc/themes/modus-vivendi-theme.el:
* etc/themes/modus-vivendi-tinted-theme.el:
* etc/themes/modus-vivendi-tritanopia-theme.el:
* etc/themes/modus-themes.el: Make refinements to supported
faces, add support for more faces, and tweak palette entries.

Release notes: <https://protesilaos.com/codelog/2024-10-27-modus-themes-4.6.0/>.
2024-10-27 18:04:31 +02:00
Laurence Warne
7a8ca202c5 Fix flakey proced refine tests (Bug#73441)
* test/lisp/proced-tests.el (proced-refine-test)
(proced-refine-with-update-test): Use the much simpler CPU refinement
for testing 'proced-refine'.  The previous tests made the incorrect
assumption that refining on the PID of process A only filtered the
buffer to contain process A and its children, whereas in actuality
the children of process A's children, their children, and so on will
also be shown.
(proced-update-preserves-pid-at-point-test): Mark as unstable.
2024-10-27 16:50:20 +01:00
Eli Zaretskii
55a8cec013 Another 'void' update
* doc/lispref/symbols.texi (Symbol Components): Another update due
to the change in 'void' function implementation.  (Bug#73886)
2024-10-27 16:07:08 +02:00
Eli Zaretskii
aeaeccbe32 Merge from origin/emacs-30
c78b4d2b31 Fix doc string of 'wdired-use-dired-vertical-movement'
b0aaee93fd Update the documentation of void functions
299a1f2407 ; * lisp/vc/log-edit.el (log-edit-diff-function): Grammar...
67a27ff53b ; Fix typos
2024-10-27 08:23:06 -04:00