From a38efb313331e4b66bba0de2b5736b339ea45004 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 20 Oct 2018 14:53:47 +0200 Subject: [PATCH] [EShell] Add workaround for faulty completing when not ignoring case Is this a general issue? Should this be reported? --- site-lisp/db-eshell.el | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/site-lisp/db-eshell.el b/site-lisp/db-eshell.el index 46d64cd..721fd92 100644 --- a/site-lisp/db-eshell.el +++ b/site-lisp/db-eshell.el @@ -84,11 +84,25 @@ (bind-key "M-N" #'eshell-next-prompt eshell-mode-map))) -;; Git Completion -;; https://tsdh.wordpress.com/2013/05/31/eshell-completion-for-git-bzr-and-hg/ +;; File Completion (require 'pcomplete) +;; Ignoring case when completing file names seems to have a bug: when a ~ is +;; encountered, it is implicitly expaned by `pcomplete-insert-entry’, +;; overwriting the prompt as a side effect. Keeping the case as it is does not +;; seem to have this issue. This problem occurs by default only on Windows +;; systems (in all flavors), because this is the only time +;; `pcomplete-ignore-case’ is non-nil by default. + +(when on-windows + (add-to-list 'eshell-mode-hook + (lambda () + (setq pcomplete-ignore-case nil)))) + +;; Git Completion +;; https://tsdh.wordpress.com/2013/05/31/eshell-completion-for-git-bzr-and-hg/ + (defun pcmpl-git-commands () "Return the most common git commands by parsing the git output." (with-temp-buffer