GNU bug report logs -
#11890
24.1; (wrong-type-argument processp nil) in `shell-mode'
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Mon, 9 Jul 2012 15:43:02 UTC
Severity: wishlist
Tags: unreproducible
Found in version 24.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11890 in the body.
You can then email your comments to 11890 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11890
; Package
emacs
.
(Mon, 09 Jul 2012 15:43:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 09 Jul 2012 15:43:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
I am seeing this in my own setup. Have not yet been able to repro
starting with emacs -Q (see below at end). But hopefully this report
will help anyway.
I visit an Emacs-Lisp file foo.el, then `M-x shell-mode'. Yes, I imagine
that that is not an expected user interaction. Still, the error message
shown does not seem appropriate (low-level).
This is the backtrace:
Debugger entered--Lisp error: (wrong-type-argument processp nil)
* process-command(nil)
* (car (process-command (get-buffer-process (current-buffer))))
* (file-name-nondirectory (car (process-command (get-buffer-process (curren=
t-buffer)))))
* (let ((shell (file-name-nondirectory (car (process-command (get-buffer-pr=
ocess (current-buffer)))))) (hsize (getenv "HISTSIZE"))) (and (stringp hsiz=
e) (integerp (setq hsize (string-to-number hsize))) (> hsize 0) (set (make-=
local-variable (quote comint-input-ring-size)) hsize)) (setq comint-input-r=
ing-file-name (or (getenv "HISTFILE") (cond ((string-equal shell "bash") "~=
/.bash_history") ((string-equal shell "ksh") "~/.sh_history") (t "~/.histor=
y")))) (if (or (equal comint-input-ring-file-name "") (equal (file-truename=
comint-input-ring-file-name) (file-truename "/dev/null"))) (setq comint-in=
put-ring-file-name nil)) (if (and comint-input-ring-file-name (string-match=
shell-dumb-shell-regexp shell)) (set-process-sentinel (get-buffer-process =
(current-buffer)) (function shell-write-history-on-exit))) (setq shell-dirs=
tack-query (cond ((string-equal shell "sh") "pwd") ((string-equal shell "ks=
h") "echo $PWD ~-") (t "dirs"))) (when (string-equal shell "bash") (add-hoo=
k (quote comint-preoutput-filter-functions) (quote shell-filter-ctrl-a-ctrl=
-b) nil t)))
* (progn (let ((shell (file-name-nondirectory (car (process-command (get-bu=
ffer-process ...))))) (hsize (getenv "HISTSIZE"))) (and (stringp hsize) (in=
tegerp (setq hsize (string-to-number hsize))) (> hsize 0) (set (make-local-=
variable (quote comint-input-ring-size)) hsize)) (setq comint-input-ring-fi=
le-name (or (getenv "HISTFILE") (cond ((string-equal shell "bash") "~/.bash=
_history") ((string-equal shell "ksh") "~/.sh_history") (t "~/.history"))))=
(if (or (equal comint-input-ring-file-name "") (equal (file-truename comin=
t-input-ring-file-name) (file-truename "/dev/null"))) (setq comint-input-ri=
ng-file-name nil)) (if (and comint-input-ring-file-name (string-match shell=
-dumb-shell-regexp shell)) (set-process-sentinel (get-buffer-process (curre=
nt-buffer)) (function shell-write-history-on-exit))) (setq shell-dirstack-q=
uery (cond ((string-equal shell "sh") "pwd") ((string-equal shell "ksh") "e=
cho $PWD ~-") (t "dirs"))) (when (string-equal shell "bash") (add-hook (quo=
te comint-preoutput-filter-functions) (quote shell-filter-ctrl-a-ctrl-b) ni=
l t))) (comint-read-input-ring t))
* (if (ring-empty-p comint-input-ring) (progn (let ((shell (file-name-nondi=
rectory (car (process-command ...)))) (hsize (getenv "HISTSIZE"))) (and (st=
ringp hsize) (integerp (setq hsize (string-to-number hsize))) (> hsize 0) (=
set (make-local-variable (quote comint-input-ring-size)) hsize)) (setq comi=
nt-input-ring-file-name (or (getenv "HISTFILE") (cond ((string-equal shell =
"bash") "~/.bash_history") ((string-equal shell "ksh") "~/.sh_history") (t =
"~/.history")))) (if (or (equal comint-input-ring-file-name "") (equal (fil=
e-truename comint-input-ring-file-name) (file-truename "/dev/null"))) (setq=
comint-input-ring-file-name nil)) (if (and comint-input-ring-file-name (st=
ring-match shell-dumb-shell-regexp shell)) (set-process-sentinel (get-buffe=
r-process (current-buffer)) (function shell-write-history-on-exit))) (setq =
shell-dirstack-query (cond ((string-equal shell "sh") "pwd") ((string-equal=
shell "ksh") "echo $PWD ~-") (t "dirs"))) (when (string-equal shell "bash"=
) (add-hook (quote comint-preoutput-filter-functions) (quote shell-filter-c=
trl-a-ctrl-b) nil t))) (comint-read-input-ring t)))
* (when (ring-empty-p comint-input-ring) (let ((shell (file-name-nondirecto=
ry (car (process-command (get-buffer-process ...))))) (hsize (getenv "HISTS=
IZE"))) (and (stringp hsize) (integerp (setq hsize (string-to-number hsize)=
)) (> hsize 0) (set (make-local-variable (quote comint-input-ring-size)) hs=
ize)) (setq comint-input-ring-file-name (or (getenv "HISTFILE") (cond ((str=
ing-equal shell "bash") "~/.bash_history") ((string-equal shell "ksh") "~/.=
sh_history") (t "~/.history")))) (if (or (equal comint-input-ring-file-name=
"") (equal (file-truename comint-input-ring-file-name) (file-truename "/de=
v/null"))) (setq comint-input-ring-file-name nil)) (if (and comint-input-ri=
ng-file-name (string-match shell-dumb-shell-regexp shell)) (set-process-sen=
tinel (get-buffer-process (current-buffer)) (function shell-write-history-o=
n-exit))) (setq shell-dirstack-query (cond ((string-equal shell "sh") "pwd"=
) ((string-equal shell "ksh") "echo $PWD ~-") (t "dirs"))) (when (string-eq=
ual shell "bash") (add-hook (quote comint-preoutput-filter-functions) (quot=
e shell-filter-ctrl-a-ctrl-b) nil t))) (comint-read-input-ring t))
* (let ((delay-mode-hooks t)) (comint-mode) (setq major-mode (quote shell-m=
ode)) (setq mode-name "Shell") (progn (if (get (quote comint-mode) (quote m=
ode-class)) (put (quote shell-mode) (quote mode-class) (get (quote comint-m=
ode) (quote mode-class)))) (unless (keymap-parent shell-mode-map) (set-keym=
ap-parent shell-mode-map (current-local-map))) (let ((parent (char-table-pa=
rent shell-mode-syntax-table))) (unless (and parent (not (eq parent (standa=
rd-syntax-table)))) (set-char-table-parent shell-mode-syntax-table (syntax-=
table)))) (unless (or (abbrev-table-get shell-mode-abbrev-table :parents) (=
eq shell-mode-abbrev-table local-abbrev-table)) (abbrev-table-put shell-mod=
e-abbrev-table :parents (list local-abbrev-table)))) (use-local-map shell-m=
ode-map) (set-syntax-table shell-mode-syntax-table) (setq local-abbrev-tabl=
e shell-mode-abbrev-table) (setq comint-prompt-regexp shell-prompt-pattern)=
(shell-completion-vars) (set (make-local-variable (quote paragraph-separat=
e)) "\\'") (set (make-local-variable (quote paragraph-start)) comint-prompt=
-regexp) (set (make-local-variable (quote font-lock-defaults)) (quote (shel=
l-font-lock-keywords t))) (set (make-local-variable (quote shell-dirstack))=
nil) (set (make-local-variable (quote shell-last-dir)) nil) (shell-dirtrac=
k-mode 1) (set (make-local-variable (quote ansi-color-apply-face-function))=
(lambda (beg end face) (when face (put-text-property beg end (quote font-l=
ock-face) face)))) (setq list-buffers-directory (expand-file-name default-d=
irectory)) (when (ring-empty-p comint-input-ring) (let ((shell (file-name-n=
ondirectory (car (process-command ...)))) (hsize (getenv "HISTSIZE"))) (and=
(stringp hsize) (integerp (setq hsize (string-to-number hsize))) (> hsize =
0) (set (make-local-variable (quote comint-input-ring-size)) hsize)) (setq =
comint-input-ring-file-name (or (getenv "HISTFILE") (cond ((string-equal sh=
ell "bash") "~/.bash_history") ((string-equal shell "ksh") "~/.sh_history")=
(t "~/.history")))) (if (or (equal comint-input-ring-file-name "") (equal =
(file-truename comint-input-ring-file-name) (file-truename "/dev/null"))) (=
setq comint-input-ring-file-name nil)) (if (and comint-input-ring-file-name=
(string-match shell-dumb-shell-regexp shell)) (set-process-sentinel (get-b=
uffer-process (current-buffer)) (function shell-write-history-on-exit))) (s=
etq shell-dirstack-query (cond ((string-equal shell "sh") "pwd") ((string-e=
qual shell "ksh") "echo $PWD ~-") (t "dirs"))) (when (string-equal shell "b=
ash") (add-hook (quote comint-preoutput-filter-functions) (quote shell-filt=
er-ctrl-a-ctrl-b) nil t))) (comint-read-input-ring t)))
* (progn (make-local-variable (quote delay-mode-hooks)) (let ((delay-mode-h=
ooks t)) (comint-mode) (setq major-mode (quote shell-mode)) (setq mode-name=
"Shell") (progn (if (get (quote comint-mode) (quote mode-class)) (put (quo=
te shell-mode) (quote mode-class) (get (quote comint-mode) (quote mode-clas=
s)))) (unless (keymap-parent shell-mode-map) (set-keymap-parent shell-mode-=
map (current-local-map))) (let ((parent (char-table-parent shell-mode-synta=
x-table))) (unless (and parent (not (eq parent ...))) (set-char-table-paren=
t shell-mode-syntax-table (syntax-table)))) (unless (or (abbrev-table-get s=
hell-mode-abbrev-table :parents) (eq shell-mode-abbrev-table local-abbrev-t=
able)) (abbrev-table-put shell-mode-abbrev-table :parents (list local-abbre=
v-table)))) (use-local-map shell-mode-map) (set-syntax-table shell-mode-syn=
tax-table) (setq local-abbrev-table shell-mode-abbrev-table) (setq comint-p=
rompt-regexp shell-prompt-pattern) (shell-completion-vars) (set (make-local=
-variable (quote paragraph-separate)) "\\'") (set (make-local-variable (quo=
te paragraph-start)) comint-prompt-regexp) (set (make-local-variable (quote=
font-lock-defaults)) (quote (shell-font-lock-keywords t))) (set (make-loca=
l-variable (quote shell-dirstack)) nil) (set (make-local-variable (quote sh=
ell-last-dir)) nil) (shell-dirtrack-mode 1) (set (make-local-variable (quot=
e ansi-color-apply-face-function)) (lambda (beg end face) (when face (put-t=
ext-property beg end (quote font-lock-face) face)))) (setq list-buffers-dir=
ectory (expand-file-name default-directory)) (when (ring-empty-p comint-inp=
ut-ring) (let ((shell (file-name-nondirectory (car ...))) (hsize (getenv "H=
ISTSIZE"))) (and (stringp hsize) (integerp (setq hsize (string-to-number hs=
ize))) (> hsize 0) (set (make-local-variable (quote comint-input-ring-size)=
) hsize)) (setq comint-input-ring-file-name (or (getenv "HISTFILE") (cond (=
... "~/.bash_history") (... "~/.sh_history") (t "~/.history")))) (if (or (e=
qual comint-input-ring-file-name "") (equal (file-truename comint-input-rin=
g-file-name) (file-truename "/dev/null"))) (setq comint-input-ring-file-nam=
e nil)) (if (and comint-input-ring-file-name (string-match shell-dumb-shell=
-regexp shell)) (set-process-sentinel (get-buffer-process (current-buffer))=
(function shell-write-history-on-exit))) (setq shell-dirstack-query (cond =
((string-equal shell "sh") "pwd") ((string-equal shell "ksh") "echo $PWD ~-=
") (t "dirs"))) (when (string-equal shell "bash") (add-hook (quote comint-p=
reoutput-filter-functions) (quote shell-filter-ctrl-a-ctrl-b) nil t))) (com=
int-read-input-ring t))))
* (delay-mode-hooks (comint-mode) (setq major-mode (quote shell-mode)) (set=
q mode-name "Shell") (progn (if (get (quote comint-mode) (quote mode-class)=
) (put (quote shell-mode) (quote mode-class) (get (quote comint-mode) (quot=
e mode-class)))) (unless (keymap-parent shell-mode-map) (set-keymap-parent =
shell-mode-map (current-local-map))) (let ((parent (char-table-parent shell=
-mode-syntax-table))) (unless (and parent (not (eq parent (standard-syntax-=
table)))) (set-char-table-parent shell-mode-syntax-table (syntax-table)))) =
(unless (or (abbrev-table-get shell-mode-abbrev-table :parents) (eq shell-m=
ode-abbrev-table local-abbrev-table)) (abbrev-table-put shell-mode-abbrev-t=
able :parents (list local-abbrev-table)))) (use-local-map shell-mode-map) (=
set-syntax-table shell-mode-syntax-table) (setq local-abbrev-table shell-mo=
de-abbrev-table) (setq comint-prompt-regexp shell-prompt-pattern) (shell-co=
mpletion-vars) (set (make-local-variable (quote paragraph-separate)) "\\'")=
(set (make-local-variable (quote paragraph-start)) comint-prompt-regexp) (=
set (make-local-variable (quote font-lock-defaults)) (quote (shell-font-loc=
k-keywords t))) (set (make-local-variable (quote shell-dirstack)) nil) (set=
(make-local-variable (quote shell-last-dir)) nil) (shell-dirtrack-mode 1) =
(set (make-local-variable (quote ansi-color-apply-face-function)) (lambda (=
beg end face) (when face (put-text-property beg end (quote font-lock-face) =
face)))) (setq list-buffers-directory (expand-file-name default-directory))=
(when (ring-empty-p comint-input-ring) (let ((shell (file-name-nondirector=
y (car (process-command ...)))) (hsize (getenv "HISTSIZE"))) (and (stringp =
hsize) (integerp (setq hsize (string-to-number hsize))) (> hsize 0) (set (m=
ake-local-variable (quote comint-input-ring-size)) hsize)) (setq comint-inp=
ut-ring-file-name (or (getenv "HISTFILE") (cond ((string-equal shell "bash"=
) "~/.bash_history") ((string-equal shell "ksh") "~/.sh_history") (t "~/.hi=
story")))) (if (or (equal comint-input-ring-file-name "") (equal (file-true=
name comint-input-ring-file-name) (file-truename "/dev/null"))) (setq comin=
t-input-ring-file-name nil)) (if (and comint-input-ring-file-name (string-m=
atch shell-dumb-shell-regexp shell)) (set-process-sentinel (get-buffer-proc=
ess (current-buffer)) (function shell-write-history-on-exit))) (setq shell-=
dirstack-query (cond ((string-equal shell "sh") "pwd") ((string-equal shell=
"ksh") "echo $PWD ~-") (t "dirs"))) (when (string-equal shell "bash") (add=
-hook (quote comint-preoutput-filter-functions) (quote shell-filter-ctrl-a-=
ctrl-b) nil t))) (comint-read-input-ring t)))
shell-mode()
* call-interactively(shell-mode t nil)
execute-extended-command(nil)
call-interactively(execute-extended-command nil nil)
Clearly, this code in shell.el is not tolerant of there being no process:
(file-name-nondirectory
(car (process-command (get-buffer-process (current-buffer)))))
I imagine that it should be, or rather that it should perhaps raise an
error with a more suitable message.
When I try with emacs -Q, and then load cygwin-mount.el, then load
setup-cygwin.el, and then do `M-x shell-mode', I get no such error. The
buffer is put in the proper mode (the mode-line lighter is
"Shell-script[bash]", and I get the message "Indentation setup for shell
type bash").
In GNU Emacs 24.1.1 (i386-mingw-nt5.1.2600)
of 2012-06-10 on MARVIN
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
`configure --with-gcc (4.6) --cflags
-ID:/devel/emacs/libs/libXpm-3.5.8/include
-ID:/devel/emacs/libs/libXpm-3.5.8/src
-ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
-ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
-ID:/devel/emacs/libs/giflib-4.1.4-1/include
-ID:/devel/emacs/libs/jpeg-6b-4/include
-ID:/devel/emacs/libs/tiff-3.8.2-1/include
-ID:/devel/emacs/libs/gnutls-3.0.9/include'
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11890
; Package
emacs
.
(Mon, 09 Jul 2012 15:59:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 11890 <at> debbugs.gnu.org (full text, mbox):
If you want sh-mode, then use it. shell-mode isn't it.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11890
; Package
emacs
.
(Mon, 09 Jul 2012 16:11:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 11890 <at> debbugs.gnu.org (full text, mbox):
> If you want sh-mode, then use it. shell-mode isn't it.
Fine, but OT. This is bug-gnu-emacs, not help-gnu-emacs.
That is not the point of the bug report, which states clearly
"Yes, I imagine that that is not an expected user interaction.".
What I meant to type was `M-x shell'.
FYI - Prior to Emacs 24, until you loaded some shell-related library, command
`shell-mode' was simply not recognized. But once you did load it, if you used
`M-x shell-mode' in an inappropriate context (e.g. buffer foo.el), you got the
same error.
If `shell-mode' is a command that is intended only for certain contexts then it
should control/manage that. It should issue a proper error message when the
context is inappropriate. It should not simply barf with a wrong-type arg
error.
That is the point of the bug report, as was stated clearly at the outset:
"Still, the error message shown does not seem appropriate (low-level)."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11890
; Package
emacs
.
(Sun, 16 Sep 2012 23:44:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 11890 <at> debbugs.gnu.org (full text, mbox):
ping
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11890
; Package
emacs
.
(Thu, 28 Apr 2016 15:53:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 11890 <at> debbugs.gnu.org (full text, mbox):
"Drew Adams" <drew.adams <at> oracle.com> writes:
> If `shell-mode' is a command that is intended only for certain contexts then it
> should control/manage that. It should issue a proper error message when the
> context is inappropriate. It should not simply barf with a wrong-type arg
> error.
Do you have a recipe from -Q? From the backtrace included, it kinda
looked like the bug was triggered from your own code.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11890
; Package
emacs
.
(Thu, 28 Apr 2016 16:11:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 11890 <at> debbugs.gnu.org (full text, mbox):
> > If `shell-mode' is a command that is intended only for certain contexts
> > then it should control/manage that. It should issue a proper error
> > message when the context is inappropriate. It should not simply barf
> > with a wrong-type arg error.
>
> Do you have a recipe from -Q? From the backtrace included, it kinda
> looked like the bug was triggered from your own code.
No, and it should not matter. The command should not just barf with
a wrong-type error msg.
As the bug report says:
Clearly, this code in shell.el is not tolerant of there being no process:
(file-name-nondirectory
(car (process-command (get-buffer-process (current-buffer)))))
I imagine that it should be, or rather that it should perhaps raise an
error with a more suitable message.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11890
; Package
emacs
.
(Thu, 28 Apr 2016 16:14:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 11890 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
>> Do you have a recipe from -Q? From the backtrace included, it kinda
>> looked like the bug was triggered from your own code.
>
> No, and it should not matter. The command should not just barf with
> a wrong-type error msg.
>
> As the bug report says:
>
> Clearly, this code in shell.el is not tolerant of there being no process:
>
> (file-name-nondirectory
> (car (process-command (get-buffer-process (current-buffer)))))
>
> I imagine that it should be, or rather that it should perhaps raise an
> error with a more suitable message.
There are many functions that may fail if called with invalid parameters
or in invalid buffers. Emacs does not attempt to cover them all with
user-level error messages.
If you don't have a recipe here, I don't see what how to proceed
further, and I'm closing this bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) unreproducible.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Thu, 28 Apr 2016 16:14:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
11890 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Thu, 28 Apr 2016 16:14:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11890
; Package
emacs
.
(Thu, 28 Apr 2016 16:17:01 GMT)
Full text and
rfc822 format available.
Message #30 received at 11890 <at> debbugs.gnu.org (full text, mbox):
> > The command should not just barf with a wrong-type error msg.
> > As the bug report says:
> >
> > Clearly, this code in shell.el is not tolerant of there being no
> > process:
> >
> > (file-name-nondirectory
> > (car (process-command (get-buffer-process (current-buffer)))))
> >
> > I imagine that it should be, or rather that it should perhaps raise an
> > error with a more suitable message.
>
> There are many functions that may fail if called with invalid parameters
> or in invalid buffers. Emacs does not attempt to cover them all with
> user-level error messages.
>
> If you don't have a recipe here, I don't see what how to proceed
> further, and I'm closing this bug report.
How to proceed is to make the `shell-mode' code ensure that if
there is no process then it raises an error saying that there
is no process. The low-level error is the wrong error.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 27 May 2016 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 9 years and 107 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.