1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 06:50:46 -08:00
emacs/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.el Mark if-let and when-let obsolete 2024-10-24 16:50:07 +08:00
em-banner.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-basic.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-cmpl.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-dirs.el Don't remove trailing slash in Eshell "pwd" for remote root directories 2024-10-31 10:37:24 -07:00
em-elecslash.el Checkdoc fixes in eshell/*.el 2024-07-08 16:51:05 +02:00
em-extpipe.el Checkdoc fixes in eshell/*.el 2024-07-08 16:51:05 +02:00
em-glob.el Improve correctness of Eshell globs when using escape characters 2024-10-31 22:38:10 -07:00
em-hist.el Don't save to history from 'eshell-command' when aborting 2024-07-15 09:10:30 -07:00
em-ls.el Improve correctness of Eshell globs when using escape characters 2024-10-31 22:38:10 -07:00
em-pred.el Fix Eshell incompatibility with "[" command when eshell-pred is disabled 2024-10-26 14:50:20 -07:00
em-prompt.el Mark if-let and when-let obsolete 2024-10-24 16:50:07 +08:00
em-rebind.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-script.el Fix a race condition when running Eshell startup scripts 2024-10-21 14:21:50 -07:00
em-smart.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-term.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-tramp.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-unix.el Improve correctness of 'eshell-quote-argument' 2024-06-09 15:28:40 -07:00
em-xtra.el Fix definitions of Eshell "xtra" functions 2024-10-27 21:13:56 -07:00
esh-arg.el Mark if-let and when-let obsolete 2024-10-24 16:50:07 +08:00
esh-cmd.el Mark if-let and when-let obsolete 2024-10-24 16:50:07 +08:00
esh-ext.el Fix execution of MS-Windows app execution aliases in Eshell 2024-07-07 20:25:09 -07:00
esh-io.el Mark if-let and when-let obsolete 2024-10-24 16:50:07 +08:00
esh-mode.el Fix and improve behavior of 'eshell/clear' 2024-10-31 22:36:16 -07:00
esh-module.el Checkdoc fixes in eshell/*.el 2024-07-08 16:51:05 +02:00
esh-opt.el ; Compute the list of symbols for 'eshell-eval-using-options' once 2024-02-13 12:27:38 -08:00
esh-proc.el Mark if-let and when-let obsolete 2024-10-24 16:50:07 +08:00
esh-util.el ; Ensure 'eshell-split-filename' doesn't expand the filename first 2024-10-26 14:24:39 -07:00
esh-var.el Mark if-let and when-let obsolete 2024-10-24 16:50:07 +08:00
eshell.el Fix redirecting Eshell output to symbols in some places 2024-08-28 18:53:03 -07:00