summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-ext.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2022-09-25 16:15:16 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2022-09-25 16:15:16 -0400
commit650c20f1ca4e07591a727e1cfcc74b3363d15985 (patch)
tree85d11f6437cde22f410c25e0e5f71a3131ebd07d /lisp/eshell/esh-ext.el
parent8869332684c2302b5ba1ead4568bbc7ba1c0183e (diff)
parent4b85ae6a24380fb67a3315eaec9233f17a872473 (diff)
downloademacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.gz
emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.bz2
emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.zip
Merge 'master' into noverlay
Diffstat (limited to 'lisp/eshell/esh-ext.el')
-rw-r--r--lisp/eshell/esh-ext.el35
1 files changed, 15 insertions, 20 deletions
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index 14ae6b4ae1d..98902fc6f23 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -1,6 +1,6 @@
;;; esh-ext.el --- commands external to Eshell -*- lexical-binding:t -*-
-;; Copyright (C) 1999-2017 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2022 Free Software Foundation, Inc.
;; Author: John Wiegley <johnw@gnu.org>
@@ -31,17 +31,12 @@
;;; Code:
-(provide 'esh-ext)
-
(require 'esh-util)
-(eval-when-compile
- (require 'cl-lib)
- (require 'esh-io)
- (require 'esh-cmd))
+(eval-when-compile (require 'cl-lib))
+(require 'esh-io)
(require 'esh-arg)
(require 'esh-opt)
-(require 'esh-proc)
(defgroup eshell-ext nil
"External commands are invoked when operating system executables are
@@ -79,10 +74,8 @@ but Eshell will be able to understand
"Search the environment path for NAME."
(if (file-name-absolute-p name)
name
- (let ((list (eshell-parse-colon-path eshell-path-env))
+ (let ((list (eshell-get-path))
suffixes n1 n2 file)
- (if (eshell-under-windows-p)
- (push "." list))
(while list
(setq n1 (concat (car list) name))
(setq suffixes eshell-binary-suffixes)
@@ -117,7 +110,7 @@ wholly ignored."
(autoload 'eshell-parse-command "esh-cmd")
(defsubst eshell-invoke-batch-file (&rest args)
- "Invoke a .BAT or .CMD file on DOS/Windows systems."
+ "Invoke a .BAT or .CMD file on MS-DOS/MS-Windows systems."
;; since CMD.EXE can't handle forward slashes in the initial
;; argument...
(setcar args (subst-char-in-string ?/ ?\\ (car args)))
@@ -170,16 +163,16 @@ by the user on the command line."
(defcustom eshell-explicit-command-char ?*
"If this char occurs before a command name, call it externally.
-That is, although `vi' may be an alias, `\vi' will always call the
+That is, although `vi' may be an alias, `*vi' will always call the
external version."
:type 'character
:group 'eshell-ext)
;;; Functions:
-(defun eshell-ext-initialize ()
+(defun eshell-ext-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the external command handling code."
- (add-hook 'eshell-named-command-hook 'eshell-explicit-command nil t))
+ (add-hook 'eshell-named-command-hook #'eshell-explicit-command nil t))
(defun eshell-explicit-command (command args)
"If a command name begins with `*', call it externally always.
@@ -193,8 +186,6 @@ This bypasses all Lisp functions and aliases."
(error "%s: external command not found"
(substring command 1))))))
-(autoload 'eshell-close-handles "esh-io")
-
(defun eshell-remote-command (command args)
"Insert output from a remote COMMAND, using ARGS.
A remote command is something that executes on a different machine.
@@ -211,7 +202,7 @@ causing the user to wonder if anything's really going on..."
(progn
(setq exitcode
(shell-command
- (mapconcat 'shell-quote-argument
+ (mapconcat #'shell-quote-argument
(append (list command) args) " ")
outbuf errbuf))
(eshell-print (with-current-buffer outbuf (buffer-string)))
@@ -222,7 +213,7 @@ causing the user to wonder if anything's really going on..."
(defun eshell-external-command (command args)
"Insert output from an external COMMAND, using ARGS."
- (setq args (eshell-stringify-list (eshell-flatten-list args)))
+ (setq args (eshell-stringify-list (flatten-tree args)))
(let ((interp (eshell-find-interpreter
command
args
@@ -235,6 +226,8 @@ causing the user to wonder if anything's really going on..."
(cl-assert interp)
(if (functionp (car interp))
(apply (car interp) (append (cdr interp) args))
+ (require 'esh-proc)
+ (declare-function eshell-gather-process-output "esh-proc" (command args))
(eshell-gather-process-output
(car interp) (append (cdr interp) args)))))
@@ -249,7 +242,7 @@ Adds the given PATH to $PATH.")
(if args
(progn
(setq eshell-path-env (getenv "PATH")
- args (mapconcat 'identity args path-separator)
+ args (mapconcat #'identity args path-separator)
eshell-path-env
(if prepend
(concat args path-separator eshell-path-env)
@@ -259,6 +252,7 @@ Adds the given PATH to $PATH.")
(eshell-printn dir)))))
(put 'eshell/addpath 'eshell-no-numeric-conversions t)
+(put 'eshell/addpath 'eshell-filename-arguments t)
(defun eshell-script-interpreter (file)
"Extract the script to run from FILE, if it has #!<interp> in it.
@@ -335,4 +329,5 @@ line of the form #!<interp>."
(cdr interp)))))
(or interp (list fullname)))))))
+(provide 'esh-ext)
;;; esh-ext.el ends here