Subject: bug#18950: [PATCH] 24.4.51; Wrong type argument: stringp on completing an asterisk in eshell with pcomplete-cycle-completions disabled

From: samer <[email-masked]>
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  <[email-masked]>
+
+	* pcomplete.el (pcomplete-parse-arguments): Parse arguments
+	regardless of pcomplete-cycle-completions's value. (bug#18950)
+
  2015-01-04  Dmitry Gutov  <[email-masked]>

  	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))