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:07:27 -0500
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Johan Bockgård wrote:

> $ emacs -Q -l complete
> Insert (defma )
> Place point after "a" and run M-x PC-lisp-complete-symbol
>
>   => Wrong type argument: sequencep, t

How about the following patch? The 1+ part fixes a different bug that
seems to be present in 21.4 as well.


*** complete.el 03 Mar 2007 15:51:14 -0800      1.59
--- complete.el 03 Mar 2007 16:04:05 -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+ dirlength))))
                  (PC-temp-minibuffer-message " [Next char not unique]"))
                nil)))))
  





reply via email to

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