emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/comint.el,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/comint.el,v
Date: Tue, 26 Aug 2008 23:49:01 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/08/26 23:49:01

Index: comint.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/comint.el,v
retrieving revision 1.380
retrieving revision 1.381
diff -u -b -r1.380 -r1.381
--- comint.el   13 Jun 2008 16:22:15 -0000      1.380
+++ comint.el   26 Aug 2008 23:49:01 -0000      1.381
@@ -2821,7 +2821,10 @@
                            " ")
                           (t
                            (cdr comint-completion-addsuffix))))
-        (filename (or (comint-match-partial-filename) ""))
+        (filename (comint-match-partial-filename))
+        (filename-beg (if filename (match-beginning 0)))
+        (filename-end (if filename (match-end 0)))
+        (filename (or filename ""))
         (filedir (file-name-directory filename))
         (filenondir (file-name-nondirectory filename))
         (directory (if filedir (comint-directory filedir) default-directory))
@@ -2839,9 +2842,19 @@
           (comint-dynamic-list-filename-completions))
          (t                            ; Completion string returned.
           (let ((file (concat (file-name-as-directory directory) completion)))
+            (if (or (null read-file-name-completion-ignore-case)
+                    (null filename-beg)
+                    (null filename-end))
             (insert (comint-quote-filename
                      (substring (directory-file-name completion)
-                                (length filenondir))))
+                                    (length filenondir)))))
+            ;; If read-file-name-completion-ignore-case is non-nil,
+            ;; the completion string may have a different case than
+            ;; what's in the prompt.
+            (delete-region filename-beg filename-end)
+            (if filedir (insert filedir))
+            (insert (comint-quote-filename
+                     (directory-file-name completion)))
             (cond ((symbolp (file-name-completion completion directory))
                    ;; We inserted a unique completion.
                    (insert (if (file-directory-p file) dirsuffix filesuffix))




reply via email to

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