GNU bug report logs - #18950
24.4.51; Wrong type argument: stringp on completing an asterisk in eshell with pcomplete-cycle-completions disabled

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Wed, 5 Nov 2014 05:29:01 UTC

Severity: normal

Found in version 24.4.51

Done: Dmitry Gutov <dgutov <at> yandex.ru>

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 18950 in the body.
You can then email your comments to 18950 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18950; Package emacs. (Wed, 05 Nov 2014 05:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitry Gutov <dgutov <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 05 Nov 2014 05:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.51;
 Wrong type argument: stringp on completing an asterisk in eshell with
 pcomplete-cycle-completions disabled
Date: Wed, 05 Nov 2014 07:27:56 +0200
1. M-x eshell
2. (setq pcomplete-cycle-completions nil)
3. Type `*', press TAB.
4. See an error, like:

Debugger entered--Lisp error: (wrong-type-argument stringp ("Anki/" "Audiobooks/" "Desktop/" "Documents/" "Downloads/" ...))
  file-name-directory(("Anki/" "Audiobooks/" "Desktop/" "Documents/" "Downloads/" ...))
  (if (file-name-directory filename) (pcomplete-executables) (if (and (> (length filename) 0) (eq (aref filename 0) eshell-explicit-command-char)) (setq filename (substring filename 1) pcomplete-stub filename glob-name t)) (let* ((paths (eshell-parse-colon-path eshell-path-env)) (cwd (file-name-as-directory (expand-file-name default-directory))) (path "") (comps-in-path nil) (file "") (filepath "") (completions nil)) (while paths (setq path (file-name-as-directory (expand-file-name (or (car paths) "."))) comps-in-path (and (file-accessible-directory-p path) (file-name-all-completions filename path))) (while comps-in-path (setq file (car comps-in-path) filepath (concat path file)) (if (and (not (member file completions)) (or (string-equal path cwd) (not ...)) (file-executable-p filepath)) (setq completions (cons file completions))) (setq comps-in-path (cdr comps-in-path))) (setq paths (cdr paths))) (pcomplete-uniqify-list (if glob-name completions (setq completions (append (and (eshell-using-module ...) (funcall ... filename)) (eshell-winnow-list (mapcar ... ...) nil (quote ...)) completions)) (append (and (or eshell-show-lisp-completions (and eshell-show-lisp-alternatives ...)) (all-completions filename obarray (quote functionp))) completions)))))
  (let ((filename (pcomplete-arg)) glob-name) (if (file-name-directory filename) (pcomplete-executables) (if (and (> (length filename) 0) (eq (aref filename 0) eshell-explicit-command-char)) (setq filename (substring filename 1) pcomplete-stub filename glob-name t)) (let* ((paths (eshell-parse-colon-path eshell-path-env)) (cwd (file-name-as-directory (expand-file-name default-directory))) (path "") (comps-in-path nil) (file "") (filepath "") (completions nil)) (while paths (setq path (file-name-as-directory (expand-file-name (or ... "."))) comps-in-path (and (file-accessible-directory-p path) (file-name-all-completions filename path))) (while comps-in-path (setq file (car comps-in-path) filepath (concat path file)) (if (and (not ...) (or ... ...) (file-executable-p filepath)) (setq completions (cons file completions))) (setq comps-in-path (cdr comps-in-path))) (setq paths (cdr paths))) (pcomplete-uniqify-list (if glob-name completions (setq completions (append (and ... ...) (eshell-winnow-list ... nil ...) completions)) (append (and (or eshell-show-lisp-completions ...) (all-completions filename obarray ...)) completions))))))
  eshell-complete-commands-list()
  ...

5. (setq pcomplete-cycle-completions t) -> and it works fine again.

In GNU Emacs 24.4.51.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2014-11-03 on axl
Repository revision: 117658 michael.albinus <at> gmx.de-20141102112256-548dk6al63uy76uh
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.1 LTS




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18950; Package emacs. (Thu, 15 Jan 2015 04:14:02 GMT) Full text and rfc822 format available.

Message #8 received at 18950 <at> debbugs.gnu.org (full text, mbox):

From: samer <samer <at> samertm.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 18950 <at> debbugs.gnu.org
Subject: Re: bug#18950: [PATCH] 24.4.51; Wrong type argument: stringp on
 completing an asterisk in eshell with pcomplete-cycle-completions disabled
Date: Wed, 14 Jan 2015 20:12:48 -0800
Hi,

The function pcomplete-parse-arguments wasn't completing the input when
pcomplete-cycle-completions was nil, and so pcomplete would pass control
to one of eshell's completion functions, which would blow up when given
a list by pcomplete-arg (which is strange, because it's valid for
pcomplete-arg to return a list). But there is no reason for
pcomplete-parse-arguments to care about whether the user wants to cycle
completions, as only really matters in pcomplete-stub. The following
patch fixes the bug by making pcomplete-parse-arguments not care about
the value of pcomplete-cycle-completions.

Best,
Samer

Changes from HEAD~1 to working tree
2 files changed, 6 insertions(+), 2 deletions(-)
 lisp/ChangeLog    |    5 +++++
 lisp/pcomplete.el |    3 +--

	Modified   lisp/ChangeLog
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f413526..c904e03 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-15  Samer Masterson  <samer <at> samertm.com>
+
+	* pcomplete.el (pcomplete-parse-arguments): Parse arguments
+	regardless of pcomplete-cycle-completions's value. (bug#18950)
+
 2015-01-04  Dmitry Gutov  <dgutov <at> yandex.ru>

 	Add mouse interaction to xref.
	Modified   lisp/pcomplete.el
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 17327ea..7bcf2c1 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -755,8 +755,7 @@ this is `comint-dynamic-complete-functions'."
 	    pcomplete-index 0
 	    pcomplete-stub (pcomplete-arg 'last))
       (let ((begin (pcomplete-begin 'last)))
-	(if (and pcomplete-cycle-completions
-		 (listp pcomplete-stub) ;??
+	(if (and (listp pcomplete-stub) ;??
 		 (not pcomplete-expand-only-p))
 	    (let* ((completions pcomplete-stub) ;??
 		   (common-stub (car completions))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18950; Package emacs. (Thu, 15 Jan 2015 15:07:02 GMT) Full text and rfc822 format available.

Message #11 received at 18950 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: samer <samer <at> samertm.com>
Cc: 18950 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#18950: [PATCH] 24.4.51;
 Wrong type argument: stringp on completing an asterisk in eshell with
 pcomplete-cycle-completions disabled
Date: Thu, 15 Jan 2015 10:06:39 -0500
> -	(if (and pcomplete-cycle-completions
> -		 (listp pcomplete-stub) ;??
> +	(if (and (listp pcomplete-stub) ;??

I haven't had time to look more closely at the bug and the code, but
if this indeed works, then it looks like a good change.


        Stefan




Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Fri, 16 Jan 2015 02:38:02 GMT) Full text and rfc822 format available.

Notification sent to Dmitry Gutov <dgutov <at> yandex.ru>:
bug acknowledged by developer. (Fri, 16 Jan 2015 02:38:02 GMT) Full text and rfc822 format available.

Message #16 received at 18950-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>,
 samer <samer <at> samertm.com>
Cc: 18950-done <at> debbugs.gnu.org
Subject: Re: bug#18950: [PATCH] 24.4.51; Wrong type argument: stringp
 on completing an asterisk in eshell with pcomplete-cycle-completions
 disabled
Date: Fri, 16 Jan 2015 05:36:57 +0300
On 01/15/2015 06:06 PM, Stefan Monnier wrote:
>> -	(if (and pcomplete-cycle-completions
>> -		 (listp pcomplete-stub) ;??
>> +	(if (and (listp pcomplete-stub) ;??
>
> I haven't had time to look more closely at the bug and the code, but
> if this indeed works, then it looks like a good change.

It does. Installed and marked as "tiny change".

Thanks, Samer!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Feb 2015 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 213 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.