[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select 8912ca0 211/218: Make eshell/kill hand
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select 8912ca0 211/218: Make eshell/kill handle -<signal> and -<SIGNALNAME> (Bug#29156) |
Date: |
Fri, 14 Dec 2018 03:35:45 -0500 (EST) |
branch: feature/gnus-select
commit 8912ca025ed0c5046c884abf107f69415a9cf959
Author: Eric Skoglund <address@hidden>
Commit: Andrew G Cohen <address@hidden>
Make eshell/kill handle -<signal> and -<SIGNALNAME> (Bug#29156)
* lisp/eshell/esh-proc.el (eshell/kill): Handle the argument parsing
and numeric conversion in function in order to parse -signal and
-SIGNALNAME correctly.
* doc/misc/eshell.texi (kill): Update docs to reflect new function
behaviour.
* etc/NEWS: Mention new eshell/kill behaviour.
---
doc/misc/eshell.texi | 2 +-
etc/NEWS | 5 +++++
lisp/eshell/esh-proc.el | 9 ++++++---
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index 80077e5..bda6159 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -330,7 +330,7 @@ List subprocesses of the Emacs process, if any, using the
function
@item kill
@cmindex kill
Kill processes. Takes a PID or a process object and an optional
-signal specifier.
+signal specifier which can either be a number or a signal name.
@item listify
@cmindex listify
diff --git a/etc/NEWS b/etc/NEWS
index f435703..b08dec2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -278,6 +278,11 @@ To restore the old behavior, use
*** The function 'shell-uniquify-list' has been renamed from
'eshell-uniqify-list'.
+*** The function eshell/kill is now able to handle signal switches.
+Previously eshell/kill would fail if provided a kill signal to send to the
+process. It now accepts signals specified either by name or by its number.
+
+
** Pcomplete
*** The function 'pcomplete-uniquify-list' has been renamed from
'pcomplete-uniqify-list'.
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el
index b3bd7a7..a7855d8 100644
--- a/lisp/eshell/esh-proc.el
+++ b/lisp/eshell/esh-proc.el
@@ -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."
- [Emacs-diffs] feature/gnus-select 4a80595 192/218: Fix too-large integer in Hg backend, (continued)
- [Emacs-diffs] feature/gnus-select 4a80595 192/218: Fix too-large integer in Hg backend, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 992a8ec 187/218: * src/lisp.h (struct Lisp_Buffer_Local_Value): Update commentary., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 17a41a9 191/218: Avoid Fortran-style floating-point optimization, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 6eddea6 193/218: * src/process.c (Fsignal_process): Simplify., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 80ab319 204/218: Remove some unused gnus-registry variables, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 905bb9c 206/218: * lisp/emulation/viper.el (viper-set-hooks): Replace obsolete func., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 2f67ad3 208/218: Optimize certain memq forms during byte-compilation., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select bc2d36a 197/218: Remove some declare-function stub definitions, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 39699c8 212/218: Remove architecture dependent source downloads, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select c5595a1 200/218: * lisp/progmodes/cc-langs.el: Silence compiler., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 8912ca0 211/218: Make eshell/kill handle -<signal> and -<SIGNALNAME> (Bug#29156),
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select 4b68a75 216/218: ; Spelling fix, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 2e4c1b9 196/218: Replace some uses of cl with cl-lib, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 709e1da 189/218: Fix bug#30846, along with misc cleanups found along the way, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 8ee4b77 194/218: cedet: replace cl with cl-lib, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 5b0fed9 218/218: Fix constant folding of overflows, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 1955afe 162/218: * lisp/gnus/gnus-cloud.el (gnus-cloud-synced-files): Fix doc & type., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 36a0cfe 150/218: Improve documentation of Auto-Revert mode, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 73ee8d2 181/218: * doc/lispref/buffers.texi (Buffer List): Fix grammar., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 233bfb5 209/218: Fix byte-optimize-memq incorrectly optimizing some memq forms., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 7d929e5 098/218: Another followup to fixing 'window-text-pixel-width', Andrew G Cohen, 2018/12/14