* eshell/em-cmpl.el (eshell-pcomplete): More thoroughly imitate pcomplete.
authorGlenn Morris <rgm@gnu.org>
Mon, 31 Dec 2012 21:28:33 +0000 (13:28 -0800)
committerGlenn Morris <rgm@gnu.org>
Mon, 31 Dec 2012 21:28:33 +0000 (13:28 -0800)
Fixes: debbugs:13293

lisp/ChangeLog
lisp/eshell/em-cmpl.el

index 2a7fc8f..49496ef 100644 (file)
@@ -1,5 +1,8 @@
 2012-12-31  Glenn Morris  <rgm@gnu.org>
 
+       * eshell/em-cmpl.el (eshell-pcomplete):
+       More thoroughly imitate pcomplete.  (Bug#13293)
+
        * files.el (parse-colon-path): Doc fix.  (Bug#12351)
        Return nil for empty path elements.  (Bug#13296)
 
index b4c86e3..4705adb 100644 (file)
@@ -451,11 +451,15 @@ to writing a completion function."
                        (all-completions filename obarray 'functionp))
                   completions)))))))
 
-(defun eshell-pcomplete ()
+(defun eshell-pcomplete (&optional interactively)
   "Eshell wrapper for `pcomplete'."
-  (interactive)
+  (interactive "p")
+  ;; Pretend to be pcomplete so that cycling works (bug#13293).
+  (setq this-command 'pcomplete)
   (condition-case nil
-      (pcomplete)
+      (if interactively
+         (call-interactively 'pcomplete)
+       (pcomplete))
     (text-read-only (completion-at-point)))) ; Workaround for bug#12838.
 
 (provide 'em-cmpl)