bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29156: 25.3; eshell/kill does not understand -<signal>


From: Noam Postavsky
Subject: bug#29156: 25.3; eshell/kill does not understand -<signal>
Date: Sun, 05 Nov 2017 07:38:37 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

tags 29156 + confirmed
quit

Pierre Neidhardt <ambrevar@gmail.com> writes:

> - emacs -Q
> - M-x eshell
>
> ~ $ kill -9 emacs
> kill: bad pid: -9

This bit converts the "-9" into an integer:

(defun eshell-lisp-command (object &optional args)
   ...
                  ;; if any of the arguments are flagged as numbers
                  ;; waiting for conversion, convert them now
                  (unless (get object 'eshell-no-numeric-conversions)
                    (while args
                      (let ((arg (car args)))
                        (if (and (stringp arg)
                                 (> (length arg) 0)
                                 (not (text-property-not-all
                                       0 (length arg) 'number t arg)))
                            (setcar args (string-to-number arg))))
                      (setq args (cdr args))))
  ...

Whereas this bit expects "-9" as a string:

(defun eshell/kill (&rest args)
  ...
      (when (stringp arg)
        (cond
         ((string-match "\\`-[[:digit:]]+\\'" arg)
          (setq signum (abs (string-to-number arg))))
         ((string-match "\\`-\\([[:upper:]]+\\|[[:lower:]]+\\)\\'" arg)
          (setq signum (abs (string-to-number arg)))))
  ...

Using "-SIGKILL" doesn't work either, because eshell/kill calls
`string-to-number' on it, giving 0.  Apparently nobody ever actually
used this feature before.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]