]> code.delx.au - gnu-emacs/commitdiff
* lisp/eshell/em-cmpl.el (eshell-pcomplete): Refine fix for bug#12838:
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 19 Nov 2012 19:22:07 +0000 (14:22 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 19 Nov 2012 19:22:07 +0000 (14:22 -0500)
Fallback on completion-at-point rather than
pcomplete-expand-and-complete, and only if pcomplete actually failed.
(eshell-cmpl-initialize): Setup completion-at-point.
* lisp/pcomplete.el (pcomplete--entries): Obey pcomplete-ignore-case.

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

index d88aac7bc6140e132e733755b83c19de2a82d226..e2299df822fd426fab7122f827ae43724d4baf0d 100644 (file)
@@ -1,5 +1,12 @@
 2012-11-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * eshell/em-cmpl.el (eshell-pcomplete): Refine fix for bug#12838:
+       Fallback on completion-at-point rather than
+       pcomplete-expand-and-complete, and only if pcomplete actually failed.
+       (eshell-cmpl-initialize): Setup completion-at-point.
+
+       * pcomplete.el (pcomplete--entries): Obey pcomplete-ignore-case.
+
        * emacs-lisp/ert.el (ert--expand-should-1): Adapt to cl-lib.
 
 2012-11-19  Michael Albinus  <michael.albinus@gmx.de>
index aa8aae2d24535e9d6ff7c9502243a3152cd9f391..b4c86e39e86a2b1a5f296c501dee400c58477de9 100644 (file)
@@ -297,6 +297,8 @@ to writing a completion function."
   (define-key eshell-command-map [? ] 'pcomplete-expand)
   (define-key eshell-mode-map [tab] 'eshell-pcomplete)
   (define-key eshell-mode-map [(control ?i)] 'eshell-pcomplete)
+  (add-hook 'completion-at-point-functions
+            #'pcomplete-completions-at-point nil t)
   ;; jww (1999-10-19): Will this work on anything but X?
   (if (featurep 'xemacs)
       (define-key eshell-mode-map [iso-left-tab] 'pcomplete-reverse)
@@ -452,9 +454,9 @@ to writing a completion function."
 (defun eshell-pcomplete ()
   "Eshell wrapper for `pcomplete'."
   (interactive)
-  (if eshell-cmpl-ignore-case
-      (pcomplete-expand-and-complete)  ; hack workaround for bug#12838
-    (pcomplete)))
+  (condition-case nil
+      (pcomplete)
+    (text-read-only (completion-at-point)))) ; Workaround for bug#12838.
 
 (provide 'em-cmpl)
 
index 9e55976a8bd7f148a311ec5655213d26b7360a42..13cf7356e7ffb3758645718ab98101826a2d0e92 100644 (file)
@@ -833,7 +833,8 @@ this is `comint-dynamic-complete-functions'."
                       . ,(lambda (comps)
                            (sort comps pcomplete-compare-entry-function)))
                      ,@(cdr (completion-file-name-table s p a)))
-        (let ((completion-ignored-extensions nil))
+        (let ((completion-ignored-extensions nil)
+             (completion-ignore-case pcomplete-ignore-case))
           (completion-table-with-predicate
            #'comint-completion-file-name-table pred 'strict s p a))))))