summaryrefslogtreecommitdiff
path: root/lisp/ido.el
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2004-09-11 21:43:42 +0000
committerKim F. Storm <storm@cua.dk>2004-09-11 21:43:42 +0000
commit6d8b6cbde4e26eebc73351b861afe7e96391cc8e (patch)
treebc66427e6cdd36a837667984c910c20a51c55071 /lisp/ido.el
parent72b928360da8655e15bb76f365e369a852491631 (diff)
downloademacs-6d8b6cbde4e26eebc73351b861afe7e96391cc8e.tar.gz
(ido-enable-dot-prefix): Doc fix.
(ido-enable-dot-prefix): New defcustom. (ido-set-matches1): Use it.
Diffstat (limited to 'lisp/ido.el')
-rw-r--r--lisp/ido.el25
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'."
:group 'ido)
(defcustom ido-enable-prefix nil
- "*Nil means that `ido' will match if the inserted text is an
-arbitrary substring (default). If non-nil `ido' will only match if the inserted
-text is a prefix \(this behavior is like the standard unix- or
-emacs-completion works).
+ "*Non-nil means only match if the entered text is a prefix of file name.
+This behavior is like the standard emacs-completion.
+Nil means to match if the entered text is an arbitrary substring.
Value can be toggled within `ido' using `ido-toggle-prefix'."
:type 'boolean
:group 'ido)
+(defcustom ido-enable-dot-prefix nil
+ "*Non-nil means to match leading dot as prefix.
+I.e. hidden files and buffers will match only if you type a dot
+as first char even if `ido-enable-prefix' is nil."
+ :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,13 +2934,22 @@ for first matching file."
(concat "\\`" re "\\'")))
(prefix-re (and full-re (not ido-enable-prefix)
(concat "\\`" rexq)))
+ (non-prefix-dot (or (not ido-enable-dot-prefix)
+ (not ido-process-ignore-lists)
+ ido-enable-prefix
+ (= (length ido-text) 0)))
+
full-matches
prefix-matches
matches)
(mapcar
(lambda (item)
(let ((name (ido-name item)))
- (if (string-match re name)
+ (if (and (or non-prefix-dot
+ (if (= (aref ido-text 0) ?.)
+ (= (aref name 0) ?.)
+ (/= (aref name 0) ?.)))
+ (string-match re name))
(cond
((and full-re (string-match full-re name))
(setq full-matches (cons item full-matches)))