summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-arg.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2020-11-16 14:43:55 +0100
committerStefan Kangas <stefan@marxist.se>2020-11-16 14:43:55 +0100
commit238261db95ae3e99907594e839fd30ec5476762b (patch)
tree3ae3ab72fdf8c9bca6e5ff74ed277ea744841f3d /lisp/eshell/esh-arg.el
parent81588748bd85827468e297d3e44a72844438e807 (diff)
downloademacs-238261db95ae3e99907594e839fd30ec5476762b.tar.gz
Don't quote lambdas in eshell/*.el
* lisp/eshell/em-basic.el (eshell-echo): * lisp/eshell/em-cmpl.el (eshell-command-completion-function) (eshell-default-completion-function, eshell-cmpl-initialize) (eshell-complete-parse-arguments, eshell-complete-commands-list): * lisp/eshell/em-dirs.el (eshell-complete-user-reference): * lisp/eshell/em-hist.el (eshell-hist-unload-hook) (eshell-hist-initialize): * lisp/eshell/em-ls.el (eshell-ls-sort-entries): * lisp/eshell/em-pred.el (eshell-modifier-alist) (eshell-display-predicate-help, eshell-display-modifier-help) (eshell-pred-substitute, eshell-split-members): * lisp/eshell/em-prompt.el (eshell-prompt-function): * lisp/eshell/em-smart.el (eshell-smart-unload-hook) (eshell-smart-initialize, eshell-refresh-windows): * lisp/eshell/em-unix.el (eshell-shuffle-files): * lisp/eshell/esh-arg.el (eshell-parse-argument-hook): * lisp/eshell/esh-cmd.el (eshell-cmd-initialize) (eshell-parse-command): * lisp/eshell/esh-mode.el (eshell-preinput-scroll-to-bottom) (eshell-postoutput-scroll-to-bottom): * lisp/eshell/esh-module.el (eshell-modules-list): * lisp/eshell/esh-proc.el (eshell-read-process-name) (eshell-round-robin-kill): * lisp/eshell/esh-var.el (eshell-envvar-names) (eshell-variables-list): Don't quote lambdas.
Diffstat (limited to 'lisp/eshell/esh-arg.el')
-rw-r--r--lisp/eshell/esh-arg.el79
1 files changed, 38 insertions, 41 deletions
diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el
index e7b07b4208d..aefda647689 100644
--- a/lisp/eshell/esh-arg.el
+++ b/lisp/eshell/esh-arg.el
@@ -85,51 +85,48 @@ If POS is nil, the location of point is checked."
'eshell-parse-special-reference
;; numbers convert to numbers if they stand alone
- (function
- (lambda ()
- (when (and (not eshell-current-argument)
- (not eshell-current-quoted)
- (looking-at eshell-number-regexp)
- (eshell-arg-delimiter (match-end 0)))
- (goto-char (match-end 0))
- (let ((str (match-string 0)))
- (if (> (length str) 0)
- (add-text-properties 0 (length str) '(number t) str))
- str))))
+ (lambda ()
+ (when (and (not eshell-current-argument)
+ (not eshell-current-quoted)
+ (looking-at eshell-number-regexp)
+ (eshell-arg-delimiter (match-end 0)))
+ (goto-char (match-end 0))
+ (let ((str (match-string 0)))
+ (if (> (length str) 0)
+ (add-text-properties 0 (length str) '(number t) str))
+ str)))
;; parse any non-special characters, based on the current context
- (function
- (lambda ()
- (unless eshell-inside-quote-regexp
- (setq eshell-inside-quote-regexp
- (format "[^%s]+"
- (apply 'string eshell-special-chars-inside-quoting))))
- (unless eshell-outside-quote-regexp
- (setq eshell-outside-quote-regexp
- (format "[^%s]+"
- (apply 'string eshell-special-chars-outside-quoting))))
- (when (looking-at (if eshell-current-quoted
- eshell-inside-quote-regexp
- eshell-outside-quote-regexp))
- (goto-char (match-end 0))
- (let ((str (match-string 0)))
- (if str
- (set-text-properties 0 (length str) nil str))
- str))))
+ (lambda ()
+ (unless eshell-inside-quote-regexp
+ (setq eshell-inside-quote-regexp
+ (format "[^%s]+"
+ (apply 'string eshell-special-chars-inside-quoting))))
+ (unless eshell-outside-quote-regexp
+ (setq eshell-outside-quote-regexp
+ (format "[^%s]+"
+ (apply 'string eshell-special-chars-outside-quoting))))
+ (when (looking-at (if eshell-current-quoted
+ eshell-inside-quote-regexp
+ eshell-outside-quote-regexp))
+ (goto-char (match-end 0))
+ (let ((str (match-string 0)))
+ (if str
+ (set-text-properties 0 (length str) nil str))
+ str)))
;; whitespace or a comment is an argument delimiter
- (function
- (lambda ()
- (let (comment-p)
- (when (or (looking-at "[ \t]+")
- (and (not eshell-current-argument)
- (looking-at "#\\([^<'].*\\|$\\)")
- (setq comment-p t)))
- (if comment-p
- (add-text-properties (match-beginning 0) (match-end 0)
- '(comment t)))
- (goto-char (match-end 0))
- (eshell-finish-arg)))))
+ (lambda ()
+ (let (comment-p)
+ (when (or (looking-at "[ \t]+")
+ (and (not eshell-current-argument)
+ (looking-at "#\\([^<'].*\\|$\\)")
+ (setq comment-p t)))
+ (if comment-p
+ (add-text-properties (match-beginning 0) (match-end 0)
+ '(comment t)))
+ (goto-char (match-end 0))
+ (eshell-finish-arg))))
;; parse backslash and the character after
'eshell-parse-backslash