GNU bug report logs - #51858
Completion in shell buffers not ignoring case

Previous Next

Package: emacs;

Reported by: Carlos Pita <carlosjosepita2 <at> gmail.com>

Date: Mon, 15 Nov 2021 05:48:02 UTC

Severity: normal

Found in version 29.0.50

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Carlos Pita <carlosjosepita2 <at> gmail.com>
Cc: 51858 <at> debbugs.gnu.org
Subject: bug#51858: 29.0.50; pcomplete not ignoring case
Date: Mon, 15 Nov 2021 09:00:38 +0100
Carlos Pita <carlosjosepita2 <at> gmail.com> writes:

>> Just to clarify -- read-file-name-completion-ignore-case works
>> everywhere else, but doesn't work in a *shell* buffer?
>
> C-x C-f ~/desk<tab>  --> ~/Desktop
>
> M-x shell<enter> cd ~/desk<tab>  --> no completion
>
> M-x shell<enter> cd ~/Desk<tab>  --> ~/Desktop

I think that's a "yes".  😀

Following the call sequence here is quite complicated.  The following
fixes the issue, but is it the correct solution here?

diff --git a/lisp/comint.el b/lisp/comint.el
index 544f0b8b82..0182839d5c 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -3289,22 +3289,23 @@ comint-filename-completion
     (comint--complete-file-name-data)))
 
 (defun comint-completion-file-name-table (string pred action)
-  (if (not (file-name-absolute-p string))
-      (completion-file-name-table string pred action)
-    (cond
-     ((memq action '(t lambda))
-      (completion-file-name-table
-       (concat comint-file-name-prefix string) pred action))
-     ((null action)
-      (let ((res (completion-file-name-table
-                  (concat comint-file-name-prefix string) pred action)))
-        (if (and (stringp res)
-                 (string-match
-                  (concat "\\`" (regexp-quote comint-file-name-prefix))
-                  res))
-            (substring res (match-end 0))
-          res)))
-     (t (completion-file-name-table string pred action)))))
+  (let ((completion-ignore-case read-file-name-completion-ignore-case))
+    (if (not (file-name-absolute-p string))
+        (completion-file-name-table string pred action)
+      (cond
+       ((memq action '(t lambda))
+        (completion-file-name-table
+         (concat comint-file-name-prefix string) pred action))
+       ((null action)
+        (let ((res (completion-file-name-table
+                    (concat comint-file-name-prefix string) pred action)))
+          (if (and (stringp res)
+                   (string-match
+                    (concat "\\`" (regexp-quote comint-file-name-prefix))
+                    res))
+              (substring res (match-end 0))
+            res)))
+       (t (completion-file-name-table string pred action))))))
 
 (defvar comint-unquote-function #'comint--unquote-argument
   "Function to use for completion of quoted data.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 2 years and 325 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.