Show
Ignore:
Timestamp:
09/09/06 16:30:10 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/ido.el

    r4111 r4161  
    18411841        (if (member ido-default-item ido-ignore-item-temp-list) 
    18421842            (setq ido-default-item nil)) 
     1843        (ido-trace "new default" ido-default-item) 
    18431844        (setq ido-set-default-item nil)) 
    18441845 
     
    35293530         (slash (and (not ido-enable-prefix) (ido-final-slash ido-text))) 
    35303531         (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 ".*/" ""))) 
    35323534         (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 "/\\'"))) 
    35353540         (prefix-re (and full-re (not ido-enable-prefix) 
    35363541                         (concat "\\`" rexq))) 
     
    35393544                             ido-enable-prefix 
    35403545                             (= (length ido-text) 0))) 
    3541  
    3542          full-matches 
    3543          prefix-matches 
    3544          matches) 
     3546         full-matches suffix-matches prefix-matches matches) 
    35453547    (setq ido-incomplete-regexp nil) 
    35463548    (condition-case error 
     
    35483550         (lambda (item) 
    35493551           (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) 
    35623566         items) 
    35633567      (invalid-regexp 
     
    35673571             ;; elsewhere. 
    35683572             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))) 
    35733582    (when (and (null matches) 
    35743583               ido-enable-flex-matching 
     
    37733782  "Switch to BUFFER according to METHOD. 
    37743783Record command in `command-history' if optional RECORD is non-nil." 
    3775  
     3784  (if (bufferp buffer) 
     3785      (setq buffer (buffer-name buffer))) 
    37763786  (let (win newframe) 
    37773787    (cond 
     
    40974107          refresh) 
    40984108 
    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)) 
    41054116 
    41064117      (save-excursion