summaryrefslogtreecommitdiff
path: root/lisp/eshell/em-script.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/eshell/em-script.el')
-rw-r--r--lisp/eshell/em-script.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el
index aecc48610f7..1f08e891919 100644
--- a/lisp/eshell/em-script.el
+++ b/lisp/eshell/em-script.el
@@ -59,11 +59,12 @@ This includes when running `eshell-command'."
(defun eshell-script-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the script parsing code."
(setq-local eshell-interpreter-alist
- (cons (cons #'(lambda (file _args)
- (string= (file-name-nondirectory file)
- "eshell"))
- 'eshell/source)
- eshell-interpreter-alist))
+ (cons (cons (lambda (file _args)
+ (and (file-regular-p file)
+ (string= (file-name-nondirectory file)
+ "eshell")))
+ 'eshell/source)
+ eshell-interpreter-alist))
(setq-local eshell-complex-commands
(append '("source" ".") eshell-complex-commands))
;; these two variables are changed through usage, but we don't want