emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: case-insensitive partial-completion-mode issue]


From: Richard Stallman
Subject: Re: address@hidden: case-insensitive partial-completion-mode issue]
Date: Thu, 06 Dec 2007 16:43:25 -0500

    AFAIS error is in line 555 of completion.el

    ;; Convert search pattern to a standard regular expression
    (setq regex (regexp-quote basestr)

    Value of `read-file-name-completion-ignore-case' seems
    not readed in.

    If `read-file-name-completion-ignore-case' is t,
    `regexp-quote' probably can't be used.

How does that conclusion follow?

Can this be fixed by binding `case-fold-search' to the proper value
(probably `completion-ignore-case') around the calls that search for
or match with that regexp?  If that approach won't work, can you
explain why not?

Here's a patch that I think ought to do the job.
Does it work?


*** complete.el 06 Dec 2007 08:26:56 -0500      1.81
--- complete.el 06 Dec 2007 13:10:34 -0500      
***************
*** 632,655 ****
                                        table
                                        pred)))
          (setq p compl)
!             (when (and compl abbreviated)
!               (if filename
!                   (progn
!                     (setq p nil)
!                     (dolist (x compl)
!                       (when (string-match regex x)
!                         (push x p)))
!                     (setq basestr (try-completion "" p)))
!                   (setq basestr (mapconcat 'list str "-"))
!                   (delete-region beg end)
!                   (setq end (+ beg (length basestr)))
!                   (insert basestr))))
          (while p
            (and (string-match regex (car p))
                 (progn
                   (set-text-properties 0 (length (car p)) '() (car p))
                   (setq poss (cons (car p) poss))))
!             (setq p (cdr p))))
  
        ;; If table had duplicates, they can be here.
        (delete-dups poss)
--- 632,657 ----
                                        table
                                        pred)))
          (setq p compl)
!         (when (and compl abbreviated)
!           (if filename
!               (progn
!                 (setq p nil)
!                 (let ((case-fold-search completion-ignore-case))
!                   (dolist (x compl)
!                     (when (string-match regex x)
!                       (push x p))))
!                 (setq basestr (try-completion "" p)))
!             (setq basestr (mapconcat 'list str "-"))
!             (delete-region beg end)
!             (setq end (+ beg (length basestr)))
!             (insert basestr))))
!       (let ((case-fold-search completion-ignore-case))
          (while p
            (and (string-match regex (car p))
                 (progn
                   (set-text-properties 0 (length (car p)) '() (car p))
                   (setq poss (cons (car p) poss))))
!           (setq p (cdr p)))))
  
        ;; If table had duplicates, they can be here.
        (delete-dups poss)




reply via email to

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