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: Sat, 24 Feb 2007 14:46:55 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> Now (try-completion "" '(("") (""))) returns t.
> Previously it returned "".

I attached a patch for the offending occurrence of `try-completion'.
Please test it.  There are two more occurrences that should be checked
though.  And there's an additional problem: When, in *scratch*, I type

(defma )

do M-x PC-lisp-complete-symbol and choose say `defmath', the _entire_
contents of the buffer preceding defma are erased.  I think this is due
to the fact that complete.el doesn't set `completion-base-size'
appropriately.  Should this be corrected too?
*** complete.el Tue Jan 23 07:40:00 2007
--- complete.el Sat Feb 24 14:26:14 2007
***************
*** 661,679 ****
                                (looking-at PC-delim-regex))
                              (setq skip (concat skip
                                                 (regexp-quote prefix)
!                                                PC-ndelims-regex)
!                                   prefix (try-completion
!                                           (PC-chunk-after
!                                            ;; not basestr, because that does
!                                            ;; not reflect insertions
!                                            (buffer-substring
!                                             (+ beg (length dirname)) end)
!                                            skip)
!                                           (mapcar
!                                              (lambda (x)
!                                                (when (string-match skip x)
!                                                  (substring x (match-end 0))))
!                                            poss)))
                              (or (> i 0) (> (length prefix) 0))
                              (or (not (eq mode 'word))
                                  (and first (> (length prefix) 0)
--- 661,683 ----
                                (looking-at PC-delim-regex))
                              (setq skip (concat skip
                                                 (regexp-quote prefix)
!                                                PC-ndelims-regex))
!                             (let ((chunk
!                                    (PC-chunk-after
!                                     ;; not basestr, because that does
!                                     ;; not reflect insertions
!                                     (buffer-substring-no-properties
!                                      (+ beg (length dirname)) end)
!                                     skip)))
!                               (setq prefix (try-completion
!                                             chunk
!                                             (mapcar
!                                              (lambda (x)
!                                                (when (string-match skip x)
!                                                  (substring x (match-end 0))))
!                                              poss)))
!                               (or (stringp prefix)
!                                   (setq prefix (if prefix chunk ""))))
                              (or (> i 0) (> (length prefix) 0))
                              (or (not (eq mode 'word))
                                  (and first (> (length prefix) 0)

reply via email to

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