help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Order of eshell/pcomplete completions when cycling


From: Tassilo Horn
Subject: Re: Order of eshell/pcomplete completions when cycling
Date: Fri, 10 Apr 2015 15:53:07 +0200
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I suspect that there has been a time where that used to work, and in
>> the meantime the completion stuff has changed and forgotten that some
>> completion users want sorted completions also without calling
>> `completion-all-sorted-completions'.
>
> Indeed, it seems that the pcomplete completion UI code was somehow
> broken when its innards were separated to provide
> pcomplete-completion-at-point.
>
> The right fix moving forward (which I've been meaning to do but
> haven't found time for yet) is to change Eshell to not use the
> `pcomplete' command any more, but to use `completion-at-point' instead
> and to finally obsolete the `pcomplete' command.

I've just tried that:

--8<---------------cut here---------------start------------->8---
diff -u --label /home/horn/Repos/el/emacs/lisp/eshell/em-cmpl.el --label 
\#\<buffer\ em-cmpl.el\> /home/horn/Repos/el/emacs/lisp/eshell/em-cmpl.el 
/tmp/buffer-content-2696WcN
--- /home/horn/Repos/el/emacs/lisp/eshell/em-cmpl.el
+++ #<buffer em-cmpl.el>
@@ -463,11 +463,7 @@
   (interactive "p")
   ;; Pretend to be pcomplete so that cycling works (bug#13293).
   (setq this-command 'pcomplete)
-  (condition-case nil
-      (if interactively
-         (call-interactively 'pcomplete)
-       (pcomplete))
-    (text-read-only (completion-at-point)))) ; Workaround for bug#12838.
+  (completion-at-point))
 
 (provide 'em-cmpl)
--8<---------------cut here---------------end--------------->8---

As far as I can tell, I don't see any difference to before, i.e., all
pcomplete/<command> functions are still considered, and also the order
when cycling completions is now test/, test1/, test11/, test2/ so my
value of `eshell-cmpl-compare-entry-function' seems to take effect.

It seems I can also remove the this-command workaround for bug#13293
without any negative effect.  (But I didn't test too hard.)

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]