comparison lisp/ido.el @ 57065:4bf76a50a989

(ido-enable-dot-prefix): Doc fix. (ido-enable-dot-prefix): New defcustom. (ido-set-matches1): Use it.
author Kim F. Storm <storm@cua.dk>
date Sat, 11 Sep 2004 21:43:42 +0000
parents 5ea587a67aae
children bd5d1158ebcf 566253900690
comparison
equal deleted inserted replaced
57064:b20cb8dd9053 57065:4bf76a50a989
480 Value can be toggled within `ido' using `ido-toggle-regexp'." 480 Value can be toggled within `ido' using `ido-toggle-regexp'."
481 :type 'boolean 481 :type 'boolean
482 :group 'ido) 482 :group 'ido)
483 483
484 (defcustom ido-enable-prefix nil 484 (defcustom ido-enable-prefix nil
485 "*Nil means that `ido' will match if the inserted text is an 485 "*Non-nil means only match if the entered text is a prefix of file name.
486 arbitrary substring (default). If non-nil `ido' will only match if the inserted 486 This behavior is like the standard emacs-completion.
487 text is a prefix \(this behavior is like the standard unix- or 487 Nil means to match if the entered text is an arbitrary substring.
488 emacs-completion works).
489 Value can be toggled within `ido' using `ido-toggle-prefix'." 488 Value can be toggled within `ido' using `ido-toggle-prefix'."
489 :type 'boolean
490 :group 'ido)
491
492 (defcustom ido-enable-dot-prefix nil
493 "*Non-nil means to match leading dot as prefix.
494 I.e. hidden files and buffers will match only if you type a dot
495 as first char even if `ido-enable-prefix' is nil."
490 :type 'boolean 496 :type 'boolean
491 :group 'ido) 497 :group 'ido)
492 498
493 (defcustom ido-confirm-unique-completion nil 499 (defcustom ido-confirm-unique-completion nil
494 "*Non-nil means that even a unique completion must be confirmed. 500 "*Non-nil means that even a unique completion must be confirmed.
2926 (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) 2932 (re (if ido-enable-prefix (concat "\\`" rexq) rexq))
2927 (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" re)) 2933 (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" re))
2928 (concat "\\`" re "\\'"))) 2934 (concat "\\`" re "\\'")))
2929 (prefix-re (and full-re (not ido-enable-prefix) 2935 (prefix-re (and full-re (not ido-enable-prefix)
2930 (concat "\\`" rexq))) 2936 (concat "\\`" rexq)))
2937 (non-prefix-dot (or (not ido-enable-dot-prefix)
2938 (not ido-process-ignore-lists)
2939 ido-enable-prefix
2940 (= (length ido-text) 0)))
2941
2931 full-matches 2942 full-matches
2932 prefix-matches 2943 prefix-matches
2933 matches) 2944 matches)
2934 (mapcar 2945 (mapcar
2935 (lambda (item) 2946 (lambda (item)
2936 (let ((name (ido-name item))) 2947 (let ((name (ido-name item)))
2937 (if (string-match re name) 2948 (if (and (or non-prefix-dot
2949 (if (= (aref ido-text 0) ?.)
2950 (= (aref name 0) ?.)
2951 (/= (aref name 0) ?.)))
2952 (string-match re name))
2938 (cond 2953 (cond
2939 ((and full-re (string-match full-re name)) 2954 ((and full-re (string-match full-re name))
2940 (setq full-matches (cons item full-matches))) 2955 (setq full-matches (cons item full-matches)))
2941 ((and prefix-re (string-match prefix-re name)) 2956 ((and prefix-re (string-match prefix-re name))
2942 (setq prefix-matches (cons item prefix-matches))) 2957 (setq prefix-matches (cons item prefix-matches)))