diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-10-14 16:56:21 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-10-14 16:56:21 +0000 |
commit | 3f87f67ee215ffeecbd2f53bd7f342cdf03f47df (patch) | |
tree | 16f2af9111af08a94d608d96a957f5c3ec5effcc /lisp/ido.el | |
parent | 350e4fb815d7413ef6d339dd664014706f742927 (diff) | |
parent | 7a210b69c7f92650c524766d1b9d3f3eefdd67c7 (diff) | |
download | emacs-3f87f67ee215ffeecbd2f53bd7f342cdf03f47df.tar.gz |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-371
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-372
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-373
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-374
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-375
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-376
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-377
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-378
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-379
Merge from erc--emacs--21
* emacs@sv.gnu.org/emacs--devo--0--patch-380
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-381
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-382
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-383
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-384
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-385
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-386
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-387
Fix ERC bug introduced in last patch
* emacs@sv.gnu.org/emacs--devo--0--patch-388
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-389
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-390
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-391
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-392
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-393
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-394
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-395
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-396
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-397
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-398
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-399
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-400
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-401
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-402
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-403
Rcirc update from Ryan Yeske
* emacs@sv.gnu.org/emacs--devo--0--patch-404
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-405
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-406
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-407
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-408
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-409
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-410
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-411
Miscellaneous tq-related fixes.
* emacs@sv.gnu.org/emacs--devo--0--patch-412
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-121
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-122
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-123
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-124
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-125
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-126
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-127
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-581
Diffstat (limited to 'lisp/ido.el')
-rw-r--r-- | lisp/ido.el | 68 |
1 files changed, 39 insertions, 29 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index be1cba62f27..2d531728b67 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1840,6 +1840,7 @@ If INITIAL is non-nil, it specifies the initial input string." (and d (cdr d))))))) (if (member ido-default-item ido-ignore-item-temp-list) (setq ido-default-item nil)) + (ido-trace "new default" ido-default-item) (setq ido-set-default-item nil)) (if ido-process-ignore-lists-inhibit @@ -3528,37 +3529,40 @@ for first matching file." (let* ((case-fold-search ido-case-fold) (slash (and (not ido-enable-prefix) (ido-final-slash ido-text))) (text (if slash (substring ido-text 0 -1) ido-text)) - (rexq (concat (if ido-enable-regexp text (regexp-quote text)) (if slash ".*/" ""))) + (rex0 (if ido-enable-regexp text (regexp-quote text))) + (rexq (concat rex0 (if slash ".*/" ""))) (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) - (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" re)) - (concat "\\`" re "\\'"))) + (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) + (concat "\\`" rex0 (if slash "/" "") "\\'"))) + (suffix-re (and do-full slash + (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) + (concat rex0 "/\\'"))) (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) + full-matches suffix-matches prefix-matches matches) (setq ido-incomplete-regexp nil) (condition-case error (mapcar (lambda (item) (let ((name (ido-name item))) - (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))) - ((and prefix-re (string-match prefix-re name)) - (setq prefix-matches (cons item prefix-matches))) - (t (setq matches (cons item matches)))))) - t) + (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))) + ((and suffix-re (string-match suffix-re name)) + (setq suffix-matches (cons item suffix-matches))) + ((and prefix-re (string-match prefix-re name)) + (setq prefix-matches (cons item prefix-matches))) + (t (setq matches (cons item matches)))))) + t) items) (invalid-regexp (setq ido-incomplete-regexp t @@ -3566,10 +3570,15 @@ for first matching file." ;; special-case single match, and handle appropriately ;; elsewhere. matches (cdr error)))) - (if prefix-matches - (setq matches (nconc prefix-matches matches))) - (if full-matches - (setq matches (nconc full-matches matches))) + (when prefix-matches + (ido-trace "prefix match" prefix-matches) + (setq matches (nconc prefix-matches matches))) + (when suffix-matches + (ido-trace "suffix match" (list text suffix-re suffix-matches)) + (setq matches (nconc suffix-matches matches))) + (when full-matches + (ido-trace "full match" (list text full-re full-matches)) + (setq matches (nconc full-matches matches))) (when (and (null matches) ido-enable-flex-matching (> (length ido-text) 1) @@ -4096,12 +4105,13 @@ For details of keybindings, do `\\[describe-function] ido-find-file'." try-single-dir-match refresh) - (ido-trace "\nexhibit" this-command) - (ido-trace "dir" ido-current-directory) - (ido-trace "contents" contents) - (ido-trace "list" ido-cur-list) - (ido-trace "matches" ido-matches) - (ido-trace "rescan" ido-rescan) + (when ido-trace-enable + (ido-trace "\nexhibit" this-command) + (ido-trace "dir" ido-current-directory) + (ido-trace "contents" contents) + (ido-trace "list" ido-cur-list) + (ido-trace "matches" ido-matches) + (ido-trace "rescan" ido-rescan)) (save-excursion (goto-char (point-max)) |