emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Partial completion]


From: martin rudalics
Subject: Re: address@hidden: Partial completion]
Date: Sun, 25 Feb 2007 10:31:48 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> I don't use partial completion (complete.el) so the OP will have to test it.
> However the above function is not equivalent to the old try-completion e.g
>
> old (try-completion "" '((""))) returns t
>
> (try-completion-old "" '((""))) returns ""

Right.  But complete.el has the following stretch of code:

            ...
            (if (and (not (eq mode 'help))
                     (setq prefix (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)))
                      ...

where `PC-chop-word' is defined as

(defun PC-chop-word (new old)
  (let ((i -1)
        (j -1))
    (while (and (setq i (string-match PC-delim-regex old (1+ i)))
                (setq j (string-match PC-delim-regex new (1+ j)))))
    (if (and j
             (or (not PC-word-failed-flag)
                 (setq j (string-match PC-delim-regex new (1+ j)))))
        (substring new 0 (1+ j))
      new)))

which, in my opinion, could choke on t with the old `try-completion' as
well.  I don't use partial completion either and hardly anyone else does
(at least for completing Lisp symbols).  Otherwise, the other bug where
entire buffer contents could get erased would have been noticed earlier.
In any case, people using PC mode for filename completion would have to
test whether the `dirlength' change breaks anything for them.  If it
does, I'd opt for removing `PC-lisp-complete-symbol' altogether.





reply via email to

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