/[emacs]/emacs/lisp/ido.el
ViewVC logotype

Diff of /emacs/lisp/ido.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by rost, Tue Jul 23 02:26:56 2002 UTC revision 1.12 by kfstorm, Mon Sep 2 10:40:56 2002 UTC
# Line 835  whenever a file is opened with ido-find- Line 835  whenever a file is opened with ido-find-
835    "List of file-name-all-completions results.    "List of file-name-all-completions results.
836  Each element in the list is of the form (dir (mtime) file...).")  Each element in the list is of the form (dir (mtime) file...).")
837    
838    (defvar ido-ignore-item-temp-list nil
839      "List of items to ignore in current ido invocation.
840    Intended to be let-bound by functions which calls ido repeatedly.
841    Should never be set permanently.")
842    
843  ;; Temporary storage  ;; Temporary storage
844    
845  (defvar ido-eoinput 1  (defvar ido-eoinput 1
# Line 1451  If INITIAL is non-nil, it specifies the Line 1456  If INITIAL is non-nil, it specifies the
1456        (setq ido-rescan t)        (setq ido-rescan t)
1457        (setq ido-rotate nil)        (setq ido-rotate nil)
1458        (setq ido-text "")        (setq ido-text "")
1459        (if ido-set-default-item        (when ido-set-default-item
1460         (setq ido-default-item          (setq ido-default-item
1461               (cond                (cond
1462                ((eq item 'buffer)                 ((eq item 'buffer)
1463                 (if (bufferp default) (buffer-name default) default))                  (if (bufferp default) (buffer-name default) default))
1464                ((stringp default) default)                 ((stringp default) default)
1465                ((eq item 'file)                 ((eq item 'file)
1466                 (and ido-enable-last-directory-history                  (and ido-enable-last-directory-history
1467                      (let ((d (assoc ido-current-directory ido-last-directory-list)))                       (let ((d (assoc ido-current-directory ido-last-directory-list)))
1468                        (and d (cdr d))))))                         (and d (cdr d)))))))
1469               ido-set-default-item nil))          (if (member ido-default-item ido-ignore-item-temp-list)
1470                (setq ido-default-item nil))
1471            (setq ido-set-default-item nil))
1472    
1473        (if ido-process-ignore-lists-inhibit        (if ido-process-ignore-lists-inhibit
1474            (setq ido-process-ignore-lists nil))            (setq ido-process-ignore-lists nil))
# Line 1620  If INITIAL is non-nil, it specifies the Line 1627  If INITIAL is non-nil, it specifies the
1627    
1628         (t         (t
1629          (setq ido-selected          (setq ido-selected
1630                (if (and ido-matches (equal ido-final-text ""))                (if (or (eq ido-exit 'takeprompt)
1631                    (ido-name (car ido-matches))  ;; possibly choose the default file                        (null ido-matches))
1632                  (if (or (eq ido-exit 'takeprompt)                    ido-final-text
1633                          (null ido-matches))                  ;; else take head of list
1634                      ido-final-text                  (ido-name (car ido-matches))))
                   ;; else take head of list  
                   (ido-name (car ido-matches)))))  
1635    
1636          (cond          (cond
1637           ((eq item 'buffer)           ((eq item 'buffer)
# Line 1641  If INITIAL is non-nil, it specifies the Line 1646  If INITIAL is non-nil, it specifies the
1646            (or (ido-is-root-directory)            (or (ido-is-root-directory)
1647                (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))))                (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))))
1648            (setq ido-set-default-item t))            (setq ido-set-default-item t))
   
1649           ((and (string-equal ido-current-directory "/")           ((and (string-equal ido-current-directory "/")
1650                 (string-match "..:\\'" ido-selected)) ;; Ange-ftp                 (string-match "..:\\'" ido-selected)) ;; Ange-ftp
1651            (ido-set-current-directory "/" ido-selected)            (ido-set-current-directory "/" ido-selected)
# Line 1700  If INITIAL is non-nil, it specifies the Line 1704  If INITIAL is non-nil, it specifies the
1704    
1705         ;; Check buf is non-nil.         ;; Check buf is non-nil.
1706         ((not buf) nil)         ((not buf) nil)
1707           ((= (length buf) 0) nil)
1708    
1709         ;; View buffer if it exists         ;; View buffer if it exists
1710         ((get-buffer buf)         ((get-buffer buf)
# Line 2526  for first matching file." Line 2531  for first matching file."
2531          (mapcar          (mapcar
2532           (lambda (x)           (lambda (x)
2533             (let ((name (buffer-name x)))             (let ((name (buffer-name x)))
2534               (if (not (or (ido-ignore-item-p name ido-ignore-buffers) (memq name visible)))               (if (not (or (ido-ignore-item-p name ido-ignore-buffers) (member name visible)))
2535                   name)))                   name)))
2536           (buffer-list frame))))           (buffer-list frame))))
2537    
# Line 2716  for first matching file." Line 2721  for first matching file."
2721  (defun ido-get-bufname (win)  (defun ido-get-bufname (win)
2722    ;; Used by `ido-get-buffers-in-frames' to walk through all windows    ;; Used by `ido-get-buffers-in-frames' to walk through all windows
2723    (let ((buf (buffer-name (window-buffer win))))    (let ((buf (buffer-name (window-buffer win))))
2724          (if (not (member buf ido-bufs-in-frame))          (unless (or (member buf ido-bufs-in-frame)
2725              ;; Only add buf if it is not already in list.                      (member buf ido-ignore-item-temp-list))
2726              ;; This prevents same buf in two different windows being            ;; Only add buf if it is not already in list.
2727              ;; put into the list twice.            ;; This prevents same buf in two different windows being
2728              (setq ido-bufs-in-frame            ;; put into the list twice.
2729                    (cons buf ido-bufs-in-frame)))))            (setq ido-bufs-in-frame
2730                    (cons buf ido-bufs-in-frame)))))
2731    
2732  ;;; FIND MATCHING ITEMS  ;;; FIND MATCHING ITEMS
2733    
# Line 2777  for first matching file." Line 2783  for first matching file."
2783                    
2784  (defun ido-ignore-item-p (name re-list &optional ignore-ext)  (defun ido-ignore-item-p (name re-list &optional ignore-ext)
2785    ;; Return t if the buffer or file NAME should be ignored.    ;; Return t if the buffer or file NAME should be ignored.
2786    (and ido-process-ignore-lists re-list    (or (member name ido-ignore-item-temp-list)
2787          (and
2788           ido-process-ignore-lists re-list
2789         (let ((data       (match-data))         (let ((data       (match-data))
2790               (ext-list   (and ignore-ext ido-ignore-extensions               (ext-list   (and ignore-ext ido-ignore-extensions
2791                                completion-ignored-extensions))                                completion-ignored-extensions))
# Line 2808  for first matching file." Line 2816  for first matching file."
2816           (if ignorep           (if ignorep
2817               (setq ido-ignored-list (cons name ido-ignored-list)))               (setq ido-ignored-list (cons name ido-ignored-list)))
2818           (set-match-data data)           (set-match-data data)
2819           ignorep)))           ignorep))))
2820    
2821    
2822  ;; Private variable used by `ido-word-matching-substring'.  ;; Private variable used by `ido-word-matching-substring'.
# Line 3009  Record command in command-history if opt Line 3017  Record command in command-history if opt
3017    ;; If BUFFER is visible in the current frame, return nil.    ;; If BUFFER is visible in the current frame, return nil.
3018    (let ((blist (ido-get-buffers-in-frames 'current)))    (let ((blist (ido-get-buffers-in-frames 'current)))
3019      ;;If the buffer is visible in current frame, return nil      ;;If the buffer is visible in current frame, return nil
3020      (if (memq buffer blist)      (if (member buffer blist)
3021          nil          nil
3022        ;;  maybe in other frame or icon        ;;  maybe in other frame or icon
3023        (get-buffer-window buffer 0) ; better than 'visible        (get-buffer-window buffer 0) ; better than 'visible

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26