Changeset 4161 for trunk/lisp/ido.el
- Timestamp:
- 09/09/06 16:30:10 (2 years ago)
- Files:
-
- trunk/lisp/ido.el (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/ido.el
r4111 r4161 1841 1841 (if (member ido-default-item ido-ignore-item-temp-list) 1842 1842 (setq ido-default-item nil)) 1843 (ido-trace "new default" ido-default-item) 1843 1844 (setq ido-set-default-item nil)) 1844 1845 … … 3529 3530 (slash (and (not ido-enable-prefix) (ido-final-slash ido-text))) 3530 3531 (text (if slash (substring ido-text 0 -1) ido-text)) 3531 (rexq (concat (if ido-enable-regexp text (regexp-quote text)) (if slash ".*/" ""))) 3532 (rex0 (if ido-enable-regexp text (regexp-quote text))) 3533 (rexq (concat rex0 (if slash ".*/" ""))) 3532 3534 (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) 3533 (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" re)) 3534 (concat "\\`" re "\\'"))) 3535 (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) 3536 (concat "\\`" rex0 (if slash "/" "") "\\'"))) 3537 (suffix-re (and do-full slash 3538 (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) 3539 (concat rex0 "/\\'"))) 3535 3540 (prefix-re (and full-re (not ido-enable-prefix) 3536 3541 (concat "\\`" rexq))) … … 3539 3544 ido-enable-prefix 3540 3545 (= (length ido-text) 0))) 3541 3542 full-matches 3543 prefix-matches 3544 matches) 3546 full-matches suffix-matches prefix-matches matches) 3545 3547 (setq ido-incomplete-regexp nil) 3546 3548 (condition-case error … … 3548 3550 (lambda (item) 3549 3551 (let ((name (ido-name item))) 3550 (if (and (or non-prefix-dot 3551 (if (= (aref ido-text 0) ?.) 3552 (= (aref name 0) ?.) 3553 (/= (aref name 0) ?.))) 3554 (string-match re name)) 3555 (cond 3556 ((and full-re (string-match full-re name)) 3557 (setq full-matches (cons item full-matches))) 3558 ((and prefix-re (string-match prefix-re name)) 3559 (setq prefix-matches (cons item prefix-matches))) 3560 (t (setq matches (cons item matches)))))) 3561 t) 3552 (if (and (or non-prefix-dot 3553 (if (= (aref ido-text 0) ?.) 3554 (= (aref name 0) ?.) 3555 (/= (aref name 0) ?.))) 3556 (string-match re name)) 3557 (cond 3558 ((and full-re (string-match full-re name)) 3559 (setq full-matches (cons item full-matches))) 3560 ((and suffix-re (string-match suffix-re name)) 3561 (setq suffix-matches (cons item suffix-matches))) 3562 ((and prefix-re (string-match prefix-re name)) 3563 (setq prefix-matches (cons item prefix-matches))) 3564 (t (setq matches (cons item matches)))))) 3565 t) 3562 3566 items) 3563 3567 (invalid-regexp … … 3567 3571 ;; elsewhere. 3568 3572 matches (cdr error)))) 3569 (if prefix-matches 3570 (setq matches (nconc prefix-matches matches))) 3571 (if full-matches 3572 (setq matches (nconc full-matches matches))) 3573 (when prefix-matches 3574 (ido-trace "prefix match" prefix-matches) 3575 (setq matches (nconc prefix-matches matches))) 3576 (when suffix-matches 3577 (ido-trace "suffix match" (list text suffix-re suffix-matches)) 3578 (setq matches (nconc suffix-matches matches))) 3579 (when full-matches 3580 (ido-trace "full match" (list text full-re full-matches)) 3581 (setq matches (nconc full-matches matches))) 3573 3582 (when (and (null matches) 3574 3583 ido-enable-flex-matching … … 3773 3782 "Switch to BUFFER according to METHOD. 3774 3783 Record command in `command-history' if optional RECORD is non-nil." 3775 3784 (if (bufferp buffer) 3785 (setq buffer (buffer-name buffer))) 3776 3786 (let (win newframe) 3777 3787 (cond … … 4097 4107 refresh) 4098 4108 4099 (ido-trace "\nexhibit" this-command) 4100 (ido-trace "dir" ido-current-directory) 4101 (ido-trace "contents" contents) 4102 (ido-trace "list" ido-cur-list) 4103 (ido-trace "matches" ido-matches) 4104 (ido-trace "rescan" ido-rescan) 4109 (when ido-trace-enable 4110 (ido-trace "\nexhibit" this-command) 4111 (ido-trace "dir" ido-current-directory) 4112 (ido-trace "contents" contents) 4113 (ido-trace "list" ido-cur-list) 4114 (ido-trace "matches" ido-matches) 4115 (ido-trace "rescan" ido-rescan)) 4105 4116 4106 4117 (save-excursion
