summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-proc.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/eshell/esh-proc.el')
-rw-r--r--lisp/eshell/esh-proc.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el
index 94401c5daa5..3735f30c304 100644
--- a/lisp/eshell/esh-proc.el
+++ b/lisp/eshell/esh-proc.el
@@ -158,7 +158,7 @@ The signals which will cause this to happen are matched by
(defalias 'eshell/wait 'eshell-wait-for-process)
-(defun eshell/jobs (&rest args)
+(defun eshell/jobs (&rest _args)
"List processes, if there are any."
(and (fboundp 'process-list)
(process-list)
@@ -167,7 +167,8 @@ The signals which will cause this to happen are matched by
(defun eshell/kill (&rest args)
"Kill processes.
Usage: kill [-<signal>] <pid>|<process> ...
-Accepts PIDs and process objects."
+Accepts PIDs and process objects. Optionally accept signals
+and signal names."
;; If the first argument starts with a dash, treat it as the signal
;; specifier.
(let ((signum 'SIGINT))
@@ -178,12 +179,12 @@ Accepts PIDs and process objects."
((string-match "\\`-[[:digit:]]+\\'" arg)
(setq signum (abs (string-to-number arg))))
((string-match "\\`-\\([[:upper:]]+\\|[[:lower:]]+\\)\\'" arg)
- (setq signum (abs (string-to-number arg)))))
+ (setq signum (intern (substring arg 1)))))
(setq args (cdr args))))
(while args
(let ((arg (if (eshell-processp (car args))
(process-id (car args))
- (car args))))
+ (string-to-number (car args)))))
(when arg
(cond
((null arg)
@@ -198,6 +199,8 @@ Accepts PIDs and process objects."
(setq args (cdr args))))
nil)
+(put 'eshell/kill 'eshell-no-numeric-conversions t)
+
(defun eshell-read-process-name (prompt)
"Read the name of a process from the minibuffer, using completion.
The prompt will be set to PROMPT."
@@ -279,11 +282,10 @@ See `eshell-needs-pipe'."
(let ((process-connection-type
(unless (eshell-needs-pipe-p command)
process-connection-type))
- (command (file-local-name command)))
+ ;; `start-process' can't deal with relative filenames.
+ (command (file-local-name (expand-file-name command))))
(apply 'start-file-process
- (file-name-nondirectory command) nil
- ;; `start-process' can't deal with relative filenames.
- (append (list (expand-file-name command)) args))))
+ (file-name-nondirectory command) nil command args)))
(eshell-record-process-object proc)
(set-process-buffer proc (current-buffer))
(if (eshell-interactive-output-p)