emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Partial completion


From: Glenn Morris
Subject: Re: Partial completion
Date: Sat, 03 Mar 2007 19:37:35 -0500
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Glenn Morris wrote:

> Glenn Morris wrote:
>
>> The 1+ part fixes a different bug that seems to be present in 21.4
>> as well.
>
> Whoops, no it doesn't. I don't use partial completion, but it seems to
> be pretty broken when one selects completion from a list.

This patch seems to do better, but is pretty much just
trial-and-error.

*** complete.el 03 Mar 2007 15:51:14 -0800      1.59
--- complete.el 03 Mar 2007 16:36:13 -0800      
***************
*** 617,623 ****
  
          ;; If ambiguous, try for a partial completion
          (let ((improved nil)
!               prefix
                (pt nil)
                (skip "\\`"))
  
--- 617,623 ----
  
          ;; If ambiguous, try for a partial completion
          (let ((improved nil)
!               prefix temp
                (pt nil)
                (skip "\\`"))
  
***************
*** 662,668 ****
                              (setq skip (concat skip
                                                 (regexp-quote prefix)
                                                 PC-ndelims-regex)
!                                   prefix (try-completion
                                            (PC-chunk-after
                                             ;; not basestr, because that does
                                             ;; not reflect insertions
--- 662,668 ----
                              (setq skip (concat skip
                                                 (regexp-quote prefix)
                                                 PC-ndelims-regex)
!                                   temp (try-completion
                                            (PC-chunk-after
                                             ;; not basestr, because that does
                                             ;; not reflect insertions
***************
*** 674,679 ****
--- 674,680 ----
                                                 (when (string-match skip x)
                                                   (substring x (match-end 0))))
                                             poss)))
+                               (if (stringp temp) (setq prefix temp))
                              (or (> i 0) (> (length prefix) 0))
                              (or (not (eq mode 'word))
                                  (and first (> (length prefix) 0)
***************
*** 709,715 ****
                        ;; Record which part of the buffer we are completing
                        ;; so that choosing a completion from the list
                        ;; knows how much old text to replace.
!                       (setq completion-base-size dirlength)))
                  (PC-temp-minibuffer-message " [Next char not unique]"))
                nil)))))
  
--- 710,716 ----
                        ;; Record which part of the buffer we are completing
                        ;; so that choosing a completion from the list
                        ;; knows how much old text to replace.
!                       (setq completion-base-size (1- beg))))
                  (PC-temp-minibuffer-message " [Next char not unique]"))
                nil)))))
  





reply via email to

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