diff options
| author | Kim F. Storm | 2004-09-11 21:43:42 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-09-11 21:43:42 +0000 |
| commit | 6d8b6cbde4e26eebc73351b861afe7e96391cc8e (patch) | |
| tree | bc66427e6cdd36a837667984c910c20a51c55071 | |
| parent | 72b928360da8655e15bb76f365e369a852491631 (diff) | |
| download | emacs-6d8b6cbde4e26eebc73351b861afe7e96391cc8e.tar.gz emacs-6d8b6cbde4e26eebc73351b861afe7e96391cc8e.zip | |
(ido-enable-dot-prefix): Doc fix.
(ido-enable-dot-prefix): New defcustom.
(ido-set-matches1): Use it.
| -rw-r--r-- | lisp/ido.el | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index ae376741f1b..b82338ef85d 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -482,14 +482,20 @@ Value can be toggled within `ido' using `ido-toggle-regexp'." | |||
| 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'." |
| 490 | :type 'boolean | 489 | :type 'boolean |
| 491 | :group 'ido) | 490 | :group 'ido) |
| 492 | 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." | ||
| 496 | :type 'boolean | ||
| 497 | :group 'ido) | ||
| 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. |
| 495 | This means that \\[ido-complete] must always be followed by \\[ido-exit-minibuffer] | 501 | This means that \\[ido-complete] must always be followed by \\[ido-exit-minibuffer] |
| @@ -2928,13 +2934,22 @@ for first matching file." | |||
| 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))) |