1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 11:00:45 -08:00
emacs/test/lisp/eshell
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
..
em-alias-tests.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
em-basic-tests.el Support setting umask symbolically in Eshell 2024-01-27 22:21:23 -08:00
em-cmpl-tests.el ; Fix test failures from the fix for bug#67661 2024-01-17 09:32:18 -08:00
em-dirs-tests.el In Eshell, don't expand quoted tildes into a user's home directory 2024-01-28 16:02:05 -08:00
em-extpipe-tests.el Improve handling of deferrable Eshell commands 2024-07-18 11:10:04 -07:00
em-glob-tests.el Improve correctness of Eshell globs when using escape characters 2024-10-31 22:38:10 -07:00
em-hist-tests.el Erase existing duplicates in eshell-history-ring 2024-05-24 19:29:20 -07:00
em-ls-tests.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
em-pred-tests.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
em-prompt-tests.el Ensure navigating by paragraphs in Eshell stops at prompts and paragraphs 2024-06-20 19:01:20 -07:00
em-script-tests.el Fix redirecting Eshell output to symbols in some places 2024-08-29 21:51:25 -07:00
em-tramp-tests.el Use 'unwind-protect' to ensure that Eshell always closes I/O handles 2024-07-27 13:57:17 -07:00
em-unix-tests.el Improve correctness of 'eshell-quote-argument' 2024-06-09 15:28:40 -07:00
esh-arg-tests.el Improve correctness of Eshell sub-forms 2024-10-16 21:48:35 -07:00
esh-cmd-tests.el Add support for chaining conditionals in Eshell 2024-10-16 21:48:36 -07:00
esh-ext-tests.el Use "/local:" prefix in Eshell to run local commands when cwd is remote 2024-05-15 18:50:54 -07:00
esh-io-tests.el Fix redirecting Eshell output to symbols in some places 2024-08-29 21:51:25 -07:00
esh-mode-tests.el Fix and improve behavior of 'eshell/clear' 2024-10-31 22:36:16 -07:00
esh-opt-tests.el ; Compute the list of symbols for 'eshell-eval-using-options' once 2024-02-13 12:27:38 -08:00
esh-proc-tests.el Don't set exit info in Eshell if the command is being piped elsewhere 2024-07-19 11:22:34 -07:00
esh-util-tests.el ; Ensure 'eshell-split-filename' doesn't expand the filename first 2024-10-26 14:24:39 -07:00
esh-var-tests.el Be more careful about applying spliced arguments 2024-10-20 18:03:45 -07:00
eshell-tests-helpers.el Fix redirecting Eshell output to symbols in some places 2024-08-29 21:51:25 -07:00
eshell-tests-unload.el Consolidate Eshell module loading/unloading code 2024-05-29 12:09:05 -07:00
eshell-tests.el Support "/dev/null" as a target when creating Eshell handles 2024-08-28 19:14:30 -07:00