emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp complete.el


From: Chong Yidong
Subject: [Emacs-diffs] emacs/lisp complete.el
Date: Wed, 28 Jan 2009 15:34:32 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/01/28 15:34:32

Modified files:
        lisp           : complete.el 

Log message:
        (PC-do-completion): Correct case when completion is unambiguous.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/complete.el?cvsroot=emacs&r1=1.94&r2=1.95

Patches:
Index: complete.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/complete.el,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -b -r1.94 -r1.95
--- complete.el 9 Jan 2009 04:44:19 -0000       1.94
+++ complete.el 28 Jan 2009 15:34:32 -0000      1.95
@@ -737,8 +737,6 @@
                     (setq prefix (PC-try-completion
                                   (PC-chunk-after basestr skip) poss)))
                (let ((first t) i)
-                 ;; Retain capitalization of user input even if
-                 ;; completion-ignore-case is set.
                  (if (eq mode 'word)
                      (setq prefix (PC-chop-word prefix basestr)))
                  (goto-char (+ beg (length dirname)))
@@ -746,15 +744,13 @@
                                (setq i 0) ; index into prefix string
                                (while (< i (length prefix))
                                  (if (and (< (point) end)
-                                          (eq (downcase (aref prefix i))
-                                              (downcase (following-char))))
-                                     ;; same char (modulo case); no action
-                                     (forward-char 1)
-                                   (if (and (< (point) end)
+                                           (or (eq (downcase (aref prefix i))
+                                                  (downcase (following-char)))
                                             (and (looking-at " ")
                                                   (memq (aref prefix i)
-                                                       PC-delims-list)))
+                                                         PC-delims-list))))
                                        ;; replace " " by the actual delimiter
+                                      ;; or input char by prefix char
                                        (progn
                                          (delete-char 1)
                                          (insert (substring prefix i (1+ i))))
@@ -766,7 +762,7 @@
                                                (setq end (1- end))))
                                        (setq improved t)
                                         (insert (substring prefix i (1+ i)))
-                                       (setq end (1+ end)))))
+                                     (setq end (1+ end))))
                                  (setq i (1+ i)))
                                (or pt (setq pt (point)))
                                (looking-at PC-delim-regex))




reply via email to

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