[Top][All Lists]

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

Re: address@hidden: Case-insensitive partial-completion bug]

From: Michael Ernst
Subject: Re: address@hidden: Case-insensitive partial-completion bug]
Date: Mon, 20 Nov 2006 09:21:03 -0500

> The complaint was:
>     I expected it to change "foo" to "Foo", because all possible
>     completions begin with "Foo".  That's what it does if you don't enable
>     partial-completion-mode.  But with partial-completion-mode enabled, it
>     stays "foo" and Emacs displays the list of possible completions.
> Michael Ernst wrote the patch which implemented this behavior.
> Michael, why is it desirable for partial-completion mode to handle
> this case differently from ordinary completion?

Thanks for forwarding the bug report.  I'm aware of this problem, and I
agree it should be fixed, but I haven't yet found time to correct it
(though it remains on my to-do list).  I have noticed it once in the 6
months I have been using the new code, and the new code corrects problems
that I noticed much more frequently.

My notes state that the problem is near the "same char (modulo case); no
action" comment, and near

                  ;; Retain capitalization of user input even if
                  ;; completion-ignore-case is set.

If the list `poss' has many possibilities with different capitalization,
then we want to retain the capitalization as input by the user.  However,
if they are all the same, we want to adjust the capitalization.

Below my signature is a test case that illustrates the problem in a
reproducible way.

                    -Michael Ernst

(defun completion-test-4 (initial-input &optional ignore-case)
  (let ((completion-ignore-case ignore-case))
    (completing-read "Input: "
                     '(("getMillis" . 1)
                       ("getMillisToDecideToPopup" . 2)
                       ("getMillisToPopup" . 3)
                       ("getMillisecond" . 4))
                     nil                ; no predicate, all answers acceptable
                     t                  ; require match

(partial-completion-mode 1)
(setq PC-meta-flag t)

(completion-test-4 "getmilli" t)
;; user types:  M-TAB    [normal completion]
;; result:  getMillis    [chooses the element that matches modulo case]
;; user types:  RET      [partial completion]
;; result:  getmillis    [problem:  all lower-case, second RET doesn't select]

;; Actually, it seems like a problem that normal completion chooses the
;; matching element immediately rather than giving a list of all
;; possibilities.  Is this a bug in normal completion?

reply via email to

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