emacs-devel
[Top][All Lists]
Advanced

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

`ido.el' improvement


From: Paul Pogonyshev
Subject: `ido.el' improvement
Date: Sat, 11 Sep 2004 20:16:06 -0200
User-agent: KMail/1.4.3

Hi.

Will you mind this change (basically explained in
`defcustom's comment)?  Note that it doesn't change
`ido's default behaviour and so must be acceptable
even now.  It is also very simple.

Paul


2004-09-11  Paul Pogonyshev  <address@hidden>

        * ido.el (ido-match-leading-dot): New defcustom.
        (ido-set-matches1): Add handling of `ido-match-leading-dot'
        option.


*** ido.el      22 Aug 2004 08:58:16 -0200      1.40
--- ido.el      11 Sep 2004 20:12:40 -0200      
***************
*** 490,495 ****
--- 490,503 ----
    :type 'boolean
    :group 'ido)
  
+ (defcustom ido-match-leading-dot nil
+   "*Non-nil means that `ido' will match leading dot as prefix
+ even if the rest of text is matched as substring.  I.e. hidden
+ files and corresponding buffers will match only if you type a dot
+ first."
+   :type 'boolean
+   :group 'ido)
+ 
  (defcustom ido-confirm-unique-completion nil
    "*Non-nil means that even a unique completion must be confirmed.
  This means that \\[ido-complete] must always be followed by 
\\[ido-exit-minibuffer]
***************
*** 2928,2940 ****
                       (concat "\\`" re "\\'")))
         (prefix-re (and full-re (not ido-enable-prefix)
                         (concat "\\`" rexq)))
         full-matches
         prefix-matches
         matches)
      (mapcar
       (lambda (item)
         (let ((name (ido-name item)))
!        (if (string-match re name)
             (cond
              ((and full-re (string-match full-re name))
               (setq full-matches (cons item full-matches)))
--- 2936,2954 ----
                       (concat "\\`" re "\\'")))
         (prefix-re (and full-re (not ido-enable-prefix)
                         (concat "\\`" rexq)))
+        (dont-match-leading-dot (or (not ido-match-leading-dot)
+                                    ido-enable-prefix
+                                    (= (length ido-text) 0)))
         full-matches
         prefix-matches
         matches)
      (mapcar
       (lambda (item)
         (let ((name (ido-name item)))
!        (if (and (or dont-match-leading-dot
!                     (funcall (if (= (aref ido-text 0) ?.) '= '/=)
!                              (aref name 0) ?.))
!                 (string-match re name))
             (cond
              ((and full-re (string-match full-re name))
               (setq full-matches (cons item full-matches)))





reply via email to

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