diff options
| author | Kim F. Storm | 2005-05-05 22:15:58 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-05-05 22:15:58 +0000 |
| commit | 3729cc8734eac9394d8c4abc7d141b113b471d8d (patch) | |
| tree | d9269d950a98bd43ffd93e7cfa85c95ba32286aa | |
| parent | dc1a7e261841bd963d8dbcebfa449f4295bb1ab2 (diff) | |
| download | emacs-3729cc8734eac9394d8c4abc7d141b113b471d8d.tar.gz emacs-3729cc8734eac9394d8c4abc7d141b113b471d8d.zip | |
(ido-setup-hook): New hook.
(ido-define-mode-map-hook): Remove hook; use ido-setup-hook instead.
(ido-input-stack): New var.
(ido-define-mode-map): Bind M-b to ido-push-dir. Move old
ido-next-work-file binding to M-O.
Bind M-f to ido-wide-find-file-or-pop-dir.
(ido-define-mode-map): Don't run ido-define-mode-map-hook.
(ido-read-internal): Run ido-setup-hook.
Catch quit in read-file-name and read-string to cancel edit.
Handle new push, pop, and pop-all exit codes (for M-b/M-f).
Automatically pop-all when completing a directory name (RET).
(ido-file-internal): Add with-no-warnings around ffap and dired code.
(ido-exit-minibuffer): Use exit-minibuffer instead of throw.
(ido-wide-find-file, ido-wide-find-dir): Catch quit to cancel find.
(ido-push-dir, ido-pop-dir, ido-wide-find-file-or-pop-dir): New
functions for M-b/M-f to move among the directory components.
(ido-make-merged-file-list): Catch quit to cancel merge.
(ido-make-dir-list): Delete "." when ido-input-stack is non-empty.
(ido-completion-help): No warnings for ido-completion-buffer-full.
| -rw-r--r-- | lisp/ido.el | 233 |
1 files changed, 154 insertions, 79 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index 7ed2d62386c..519d57cbb88 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -251,8 +251,8 @@ | |||
| 251 | ;; | 251 | ;; |
| 252 | ;; Customize the `ido' group to change the `ido' functionality. | 252 | ;; Customize the `ido' group to change the `ido' functionality. |
| 253 | ;; | 253 | ;; |
| 254 | ;; To modify the keybindings, use the hook provided. For example: | 254 | ;; To modify the keybindings, use the ido-setup-hook. For example: |
| 255 | ;;(add-hook 'ido-define-mode-map-hook 'ido-my-keys) | 255 | ;;(add-hook 'ido-setup-hook 'ido-my-keys) |
| 256 | ;; | 256 | ;; |
| 257 | ;;(defun ido-my-keys () | 257 | ;;(defun ido-my-keys () |
| 258 | ;; "Add my keybindings for ido." | 258 | ;; "Add my keybindings for ido." |
| @@ -705,8 +705,11 @@ ask user whether to create buffer, or 'never to never create new buffer." | |||
| 705 | (const never)) | 705 | (const never)) |
| 706 | :group 'ido) | 706 | :group 'ido) |
| 707 | 707 | ||
| 708 | (defcustom ido-define-mode-map-hook nil | 708 | (defcustom ido-setup-hook nil |
| 709 | "*Hook to define keys in `ido-mode-map' for extra keybindings." | 709 | "*Hook run after the ido variables and keymap has been setup. |
| 710 | The dynamic variable `ido-cur-item' contains the current type of item that | ||
| 711 | is read by ido, possible values are file, dir, buffer, and list. | ||
| 712 | Additional keys can be defined in `ido-mode-map'." | ||
| 710 | :type 'hook | 713 | :type 'hook |
| 711 | :group 'ido) | 714 | :group 'ido) |
| 712 | 715 | ||
| @@ -931,6 +934,9 @@ Copied from `icomplete-eoinput'.") | |||
| 931 | (defvar ido-text-init nil | 934 | (defvar ido-text-init nil |
| 932 | "The initial string for the users string it is typed in.") | 935 | "The initial string for the users string it is typed in.") |
| 933 | 936 | ||
| 937 | (defvar ido-input-stack nil | ||
| 938 | "Stores the users strings when user hits M-b/M-f.") | ||
| 939 | |||
| 934 | (defvar ido-matches nil | 940 | (defvar ido-matches nil |
| 935 | "List of files currently matching `ido-text'.") | 941 | "List of files currently matching `ido-text'.") |
| 936 | 942 | ||
| @@ -1399,13 +1405,14 @@ This function also adds a hook to the minibuffer." | |||
| 1399 | (define-key map [(meta backspace)] 'ido-delete-backward-word-updir) | 1405 | (define-key map [(meta backspace)] 'ido-delete-backward-word-updir) |
| 1400 | (define-key map [(control backspace)] 'ido-up-directory) | 1406 | (define-key map [(control backspace)] 'ido-up-directory) |
| 1401 | (define-key map "\C-l" 'ido-reread-directory) | 1407 | (define-key map "\C-l" 'ido-reread-directory) |
| 1402 | (define-key map [(meta ?b)] 'ido-next-work-file) | ||
| 1403 | (define-key map [(meta ?d)] 'ido-wide-find-dir) | 1408 | (define-key map [(meta ?d)] 'ido-wide-find-dir) |
| 1404 | (define-key map [(meta ?f)] 'ido-wide-find-file) | 1409 | (define-key map [(meta ?b)] 'ido-push-dir) |
| 1410 | (define-key map [(meta ?f)] 'ido-wide-find-file-or-pop-dir) | ||
| 1405 | (define-key map [(meta ?k)] 'ido-forget-work-directory) | 1411 | (define-key map [(meta ?k)] 'ido-forget-work-directory) |
| 1406 | (define-key map [(meta ?m)] 'ido-make-directory) | 1412 | (define-key map [(meta ?m)] 'ido-make-directory) |
| 1407 | (define-key map [(meta ?n)] 'ido-next-work-directory) | 1413 | (define-key map [(meta ?n)] 'ido-next-work-directory) |
| 1408 | (define-key map [(meta ?o)] 'ido-prev-work-file) | 1414 | (define-key map [(meta ?o)] 'ido-prev-work-file) |
| 1415 | (define-key map [(meta ?O)] 'ido-next-work-file) | ||
| 1409 | (define-key map [(meta ?p)] 'ido-prev-work-directory) | 1416 | (define-key map [(meta ?p)] 'ido-prev-work-directory) |
| 1410 | (define-key map [(meta ?s)] 'ido-merge-work-directories) | 1417 | (define-key map [(meta ?s)] 'ido-merge-work-directories) |
| 1411 | ) | 1418 | ) |
| @@ -1431,8 +1438,7 @@ This function also adds a hook to the minibuffer." | |||
| 1431 | (define-key map [remap viper-del-backward-char-in-insert] 'ido-delete-backward-updir) | 1438 | (define-key map [remap viper-del-backward-char-in-insert] 'ido-delete-backward-updir) |
| 1432 | (define-key map [remap viper-delete-backward-word] 'ido-delete-backward-word-updir))) | 1439 | (define-key map [remap viper-delete-backward-word] 'ido-delete-backward-word-updir))) |
| 1433 | 1440 | ||
| 1434 | (setq ido-mode-map map) | 1441 | (setq ido-mode-map map))) |
| 1435 | (run-hooks 'ido-define-mode-map-hook))) | ||
| 1436 | 1442 | ||
| 1437 | (defun ido-final-slash (dir &optional fix-it) | 1443 | (defun ido-final-slash (dir &optional fix-it) |
| 1438 | ;; return DIR if DIR has final slash. | 1444 | ;; return DIR if DIR has final slash. |
| @@ -1601,6 +1607,10 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1601 | 1607 | ||
| 1602 | (ido-define-mode-map) | 1608 | (ido-define-mode-map) |
| 1603 | (setq ido-text-init initial) | 1609 | (setq ido-text-init initial) |
| 1610 | (setq ido-input-stack nil) | ||
| 1611 | |||
| 1612 | (run-hooks 'ido-setup-hook) | ||
| 1613 | |||
| 1604 | (while (not done) | 1614 | (while (not done) |
| 1605 | (ido-trace "\n_LOOP_" ido-text-init) | 1615 | (ido-trace "\n_LOOP_" ido-text-init) |
| 1606 | (setq ido-exit nil) | 1616 | (setq ido-exit nil) |
| @@ -1742,9 +1752,11 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1742 | (setq ido-text-init "") | 1752 | (setq ido-text-init "") |
| 1743 | (while new | 1753 | (while new |
| 1744 | (setq new (if edit | 1754 | (setq new (if edit |
| 1745 | (read-file-name (concat prompt "[EDIT] ") | 1755 | (condition-case nil |
| 1746 | (expand-file-name d) | 1756 | (read-file-name (concat prompt "[EDIT] ") |
| 1747 | (concat d f) nil f) | 1757 | (expand-file-name d) |
| 1758 | (concat d f) nil f) | ||
| 1759 | (quit (concat d f))) | ||
| 1748 | f) | 1760 | f) |
| 1749 | d (or (file-name-directory new) "/") | 1761 | d (or (file-name-directory new) "/") |
| 1750 | f (file-name-nondirectory new) | 1762 | f (file-name-nondirectory new) |
| @@ -1763,7 +1775,11 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1763 | (setq ido-text-init f | 1775 | (setq ido-text-init f |
| 1764 | new nil)))))) | 1776 | new nil)))))) |
| 1765 | (t | 1777 | (t |
| 1766 | (setq ido-text-init (read-string (concat prompt "[EDIT] ") ido-final-text)))) | 1778 | (setq ido-text-init |
| 1779 | (condition-case nil | ||
| 1780 | (read-string (concat prompt "[EDIT] ") ido-final-text) | ||
| 1781 | (quit ido-final-text))))) | ||
| 1782 | |||
| 1767 | nil) | 1783 | nil) |
| 1768 | 1784 | ||
| 1769 | ((eq ido-exit 'keep) | 1785 | ((eq ido-exit 'keep) |
| @@ -1772,7 +1788,7 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1772 | ((memq ido-exit '(dired fallback find-file switch-to-buffer insert-buffer insert-file)) | 1788 | ((memq ido-exit '(dired fallback find-file switch-to-buffer insert-buffer insert-file)) |
| 1773 | (setq done t)) | 1789 | (setq done t)) |
| 1774 | 1790 | ||
| 1775 | ((eq ido-exit 'updir) | 1791 | ((memq ido-exit '(updir push)) |
| 1776 | ;; cannot go up if already at the root-dir (Unix) or at the | 1792 | ;; cannot go up if already at the root-dir (Unix) or at the |
| 1777 | ;; root-dir of a certain drive (Windows or MS-DOS). | 1793 | ;; root-dir of a certain drive (Windows or MS-DOS). |
| 1778 | (if (ido-is-tramp-root) | 1794 | (if (ido-is-tramp-root) |
| @@ -1781,9 +1797,31 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1781 | (ido-set-current-directory (match-string 1 ido-current-directory)) | 1797 | (ido-set-current-directory (match-string 1 ido-current-directory)) |
| 1782 | (setq ido-set-default-item t)) | 1798 | (setq ido-set-default-item t)) |
| 1783 | (unless (ido-is-root-directory) | 1799 | (unless (ido-is-root-directory) |
| 1800 | (when (eq ido-exit 'push) | ||
| 1801 | (setq ido-input-stack (cons (cons ido-cur-item ido-text) ido-input-stack)) | ||
| 1802 | (setq ido-cur-item 'dir) | ||
| 1803 | (setq ido-text-init (file-name-nondirectory (substring ido-current-directory 0 -1))) | ||
| 1804 | (ido-trace "push" ido-input-stack)) | ||
| 1784 | (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))) | 1805 | (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))) |
| 1785 | (setq ido-set-default-item t)))) | 1806 | (setq ido-set-default-item t)))) |
| 1786 | 1807 | ||
| 1808 | ((eq ido-exit 'pop) | ||
| 1809 | (ido-trace "pop" ido-input-stack) | ||
| 1810 | (let ((elt (car ido-input-stack))) | ||
| 1811 | (setq ido-input-stack (cdr ido-input-stack)) | ||
| 1812 | (ido-set-current-directory (concat ido-current-directory ido-text)) | ||
| 1813 | (setq ido-cur-item (car elt)) | ||
| 1814 | (setq ido-text-init (cdr elt)))) | ||
| 1815 | |||
| 1816 | ((eq ido-exit 'pop-all) | ||
| 1817 | (ido-trace "pop-all" ido-input-stack) | ||
| 1818 | (while ido-input-stack | ||
| 1819 | (let ((elt (car ido-input-stack))) | ||
| 1820 | (setq ido-input-stack (cdr ido-input-stack)) | ||
| 1821 | (ido-set-current-directory (concat ido-current-directory ido-text)) | ||
| 1822 | (setq ido-cur-item (car elt)) | ||
| 1823 | (setq ido-text-init (cdr elt))))) | ||
| 1824 | |||
| 1787 | ;; Handling the require-match must be done in a better way. | 1825 | ;; Handling the require-match must be done in a better way. |
| 1788 | ((and require-match | 1826 | ((and require-match |
| 1789 | (not (if ido-directory-too-big | 1827 | (not (if ido-directory-too-big |
| @@ -1838,7 +1876,14 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1838 | (setq ido-last-directory-list | 1876 | (setq ido-last-directory-list |
| 1839 | (cons (cons ido-current-directory ido-selected) ido-last-directory-list))))) | 1877 | (cons (cons ido-current-directory ido-selected) ido-last-directory-list))))) |
| 1840 | (ido-set-current-directory ido-current-directory ido-selected) | 1878 | (ido-set-current-directory ido-current-directory ido-selected) |
| 1841 | (setq ido-set-default-item t)) | 1879 | (if ido-input-stack |
| 1880 | (while ido-input-stack | ||
| 1881 | (let ((elt (car ido-input-stack))) | ||
| 1882 | (if (setq ido-input-stack (cdr ido-input-stack)) | ||
| 1883 | (ido-set-current-directory ido-current-directory (cdr elt)) | ||
| 1884 | (setq ido-text-init (cdr elt))) | ||
| 1885 | (setq ido-cur-item (car elt)))) | ||
| 1886 | (setq ido-set-default-item t))) | ||
| 1842 | 1887 | ||
| 1843 | (t | 1888 | (t |
| 1844 | (setq done t)))))) | 1889 | (setq done t)))))) |
| @@ -1968,10 +2013,11 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1968 | (require 'ffap) | 2013 | (require 'ffap) |
| 1969 | ;; Duplicate code from ffap-guesser as we want different behaviour for files and URLs. | 2014 | ;; Duplicate code from ffap-guesser as we want different behaviour for files and URLs. |
| 1970 | (cond | 2015 | (cond |
| 1971 | ((and ido-use-url-at-point | 2016 | ((with-no-warnings |
| 1972 | ffap-url-regexp | 2017 | (and ido-use-url-at-point |
| 1973 | (ffap-fixup-url (or (ffap-url-at-point) | 2018 | ffap-url-regexp |
| 1974 | (ffap-gopher-at-point)))) | 2019 | (ffap-fixup-url (or (ffap-url-at-point) |
| 2020 | (ffap-gopher-at-point))))) | ||
| 1975 | (setq ido-exit 'ffap | 2021 | (setq ido-exit 'ffap |
| 1976 | filename t)) | 2022 | filename t)) |
| 1977 | 2023 | ||
| @@ -2041,7 +2087,8 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 2041 | (ido-record-work-directory) | 2087 | (ido-record-work-directory) |
| 2042 | (funcall method ido-current-directory) | 2088 | (funcall method ido-current-directory) |
| 2043 | (if (eq method 'dired) | 2089 | (if (eq method 'dired) |
| 2044 | (dired-goto-file (expand-file-name file)))) | 2090 | (with-no-warnings |
| 2091 | (dired-goto-file (expand-file-name file))))) | ||
| 2045 | ((string-match "[[*?]" filename) | 2092 | ((string-match "[[*?]" filename) |
| 2046 | (setq dirname (concat ido-current-directory filename)) | 2093 | (setq dirname (concat ido-current-directory filename)) |
| 2047 | (ido-record-command method dirname) | 2094 | (ido-record-command method dirname) |
| @@ -2283,7 +2330,7 @@ timestamp has not changed (e.g. with ftp or on Windows)." | |||
| 2283 | (interactive) | 2330 | (interactive) |
| 2284 | (if (or (not ido-require-match) | 2331 | (if (or (not ido-require-match) |
| 2285 | (ido-existing-item-p)) | 2332 | (ido-existing-item-p)) |
| 2286 | (throw 'exit nil))) | 2333 | (exit-minibuffer))) |
| 2287 | 2334 | ||
| 2288 | (defun ido-select-text () | 2335 | (defun ido-select-text () |
| 2289 | "Select the buffer or file named by the prompt. | 2336 | "Select the buffer or file named by the prompt. |
| @@ -2432,7 +2479,9 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one. | |||
| 2432 | (unless file | 2479 | (unless file |
| 2433 | (let ((enable-recursive-minibuffers t)) | 2480 | (let ((enable-recursive-minibuffers t)) |
| 2434 | (setq file | 2481 | (setq file |
| 2435 | (read-string (concat "Wide find file: " ido-current-directory) ido-text)))) | 2482 | (condition-case nil |
| 2483 | (read-string (concat "Wide find file: " ido-current-directory) ido-text) | ||
| 2484 | (quit ""))))) | ||
| 2436 | (when (> (length file) 0) | 2485 | (when (> (length file) 0) |
| 2437 | (setq ido-use-merged-list t ido-try-merged-list 'wide) | 2486 | (setq ido-use-merged-list t ido-try-merged-list 'wide) |
| 2438 | (setq ido-exit 'refresh) | 2487 | (setq ido-exit 'refresh) |
| @@ -2446,7 +2495,9 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one. | |||
| 2446 | (unless dir | 2495 | (unless dir |
| 2447 | (let ((enable-recursive-minibuffers t)) | 2496 | (let ((enable-recursive-minibuffers t)) |
| 2448 | (setq dir | 2497 | (setq dir |
| 2449 | (read-string (concat "Wide find directory: " ido-current-directory) ido-text)))) | 2498 | (condition-case nil |
| 2499 | (read-string (concat "Wide find directory: " ido-current-directory) ido-text) | ||
| 2500 | (quit ""))))) | ||
| 2450 | (when (> (length dir) 0) | 2501 | (when (> (length dir) 0) |
| 2451 | (setq ido-use-merged-list t ido-try-merged-list 'wide) | 2502 | (setq ido-use-merged-list t ido-try-merged-list 'wide) |
| 2452 | (setq ido-exit 'refresh) | 2503 | (setq ido-exit 'refresh) |
| @@ -2454,6 +2505,26 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one. | |||
| 2454 | (setq ido-rotate-temp t) | 2505 | (setq ido-rotate-temp t) |
| 2455 | (exit-minibuffer))) | 2506 | (exit-minibuffer))) |
| 2456 | 2507 | ||
| 2508 | (defun ido-push-dir () | ||
| 2509 | "Move to previous directory in file name, push current input on stack." | ||
| 2510 | (interactive) | ||
| 2511 | (setq ido-exit 'push) | ||
| 2512 | (exit-minibuffer)) | ||
| 2513 | |||
| 2514 | (defun ido-pop-dir (arg) | ||
| 2515 | "Pop directory from input stack back to input. | ||
| 2516 | With \\[universal-argument], pop all element." | ||
| 2517 | (interactive "P") | ||
| 2518 | (when ido-input-stack | ||
| 2519 | (setq ido-exit (if arg 'pop-all 'pop)) | ||
| 2520 | (exit-minibuffer))) | ||
| 2521 | |||
| 2522 | (defun ido-wide-find-file-or-pop-dir (arg) | ||
| 2523 | (interactive "P") | ||
| 2524 | (if ido-input-stack | ||
| 2525 | (ido-pop-dir arg) | ||
| 2526 | (ido-wide-find-file))) | ||
| 2527 | |||
| 2457 | (defun ido-make-directory (&optional dir) | 2528 | (defun ido-make-directory (&optional dir) |
| 2458 | "Prompt for DIR to create in current directory." | 2529 | "Prompt for DIR to create in current directory." |
| 2459 | (interactive) | 2530 | (interactive) |
| @@ -2771,67 +2842,69 @@ for first matching file." | |||
| 2771 | (defun ido-make-merged-file-list (text auto wide) | 2842 | (defun ido-make-merged-file-list (text auto wide) |
| 2772 | (let (res) | 2843 | (let (res) |
| 2773 | (message "Searching for `%s'...." text) | 2844 | (message "Searching for `%s'...." text) |
| 2774 | (if (and (ido-final-slash text) ido-dir-file-cache) | 2845 | (condition-case nil |
| 2775 | (if wide | 2846 | (if (and (ido-final-slash text) ido-dir-file-cache) |
| 2776 | (setq res (ido-wide-find-dirs-or-files | 2847 | (if wide |
| 2777 | ido-current-directory (substring text 0 -1) ido-enable-prefix t)) | 2848 | (setq res (ido-wide-find-dirs-or-files |
| 2778 | ;; Use list of cached directories | 2849 | ido-current-directory (substring text 0 -1) ido-enable-prefix t)) |
| 2779 | (let ((re (concat (regexp-quote (substring text 0 -1)) "[^/:]*/\\'")) | 2850 | ;; Use list of cached directories |
| 2780 | (dirs ido-dir-file-cache) | 2851 | (let ((re (concat (regexp-quote (substring text 0 -1)) "[^/:]*/\\'")) |
| 2781 | dir b d f) | 2852 | (dirs ido-dir-file-cache) |
| 2782 | (if nil ;; simple | 2853 | dir b d f) |
| 2783 | (while dirs | 2854 | (if nil ;; simple |
| 2784 | (setq dir (car (car dirs)) | 2855 | (while dirs |
| 2785 | dirs (cdr dirs)) | 2856 | (setq dir (car (car dirs)) |
| 2786 | (when (and (string-match re dir) | 2857 | dirs (cdr dirs)) |
| 2787 | (not (ido-ignore-item-p dir ido-ignore-directories-merge)) | 2858 | (when (and (string-match re dir) |
| 2788 | (file-directory-p dir)) | 2859 | (not (ido-ignore-item-p dir ido-ignore-directories-merge)) |
| 2789 | (setq b (substring dir 0 -1) | 2860 | (file-directory-p dir)) |
| 2790 | f (concat (file-name-nondirectory b) "/") | 2861 | (setq b (substring dir 0 -1) |
| 2791 | d (file-name-directory b) | 2862 | f (concat (file-name-nondirectory b) "/") |
| 2792 | res (cons (cons f d) res)))) | 2863 | d (file-name-directory b) |
| 2864 | res (cons (cons f d) res)))) | ||
| 2865 | (while dirs | ||
| 2866 | (setq dir (car dirs) | ||
| 2867 | d (car dir) | ||
| 2868 | dirs (cdr dirs)) | ||
| 2869 | (when (not (ido-ignore-item-p d ido-ignore-directories-merge)) | ||
| 2870 | (setq dir (cdr (cdr dir))) | ||
| 2871 | (while dir | ||
| 2872 | (setq f (car dir) | ||
| 2873 | dir (cdr dir)) | ||
| 2874 | (if (and (string-match re f) | ||
| 2875 | (not (ido-ignore-item-p f ido-ignore-directories))) | ||
| 2876 | (setq res (cons (cons f d) res))))) | ||
| 2877 | (if (and auto (input-pending-p)) | ||
| 2878 | (setq dirs nil | ||
| 2879 | res t)))))) | ||
| 2880 | (if wide | ||
| 2881 | (setq res (ido-wide-find-dirs-or-files | ||
| 2882 | ido-current-directory text ido-enable-prefix nil)) | ||
| 2883 | (let ((ido-text text) | ||
| 2884 | (dirs ido-work-directory-list) | ||
| 2885 | (must-match (and text (> (length text) 0))) | ||
| 2886 | dir fl) | ||
| 2887 | (if (and auto (not (member ido-current-directory dirs))) | ||
| 2888 | (setq dirs (cons ido-current-directory dirs))) | ||
| 2793 | (while dirs | 2889 | (while dirs |
| 2794 | (setq dir (car dirs) | 2890 | (setq dir (car dirs) |
| 2795 | d (car dir) | ||
| 2796 | dirs (cdr dirs)) | 2891 | dirs (cdr dirs)) |
| 2797 | (when (not (ido-ignore-item-p d ido-ignore-directories-merge)) | 2892 | (when (and dir (stringp dir) |
| 2798 | (setq dir (cdr (cdr dir))) | 2893 | (or ido-merge-ftp-work-directories |
| 2799 | (while dir | 2894 | (not (ido-is-ftp-directory dir))) |
| 2800 | (setq f (car dir) | 2895 | (file-directory-p dir) |
| 2801 | dir (cdr dir)) | 2896 | ;; TODO. check for nonreadable and too-big. |
| 2802 | (if (and (string-match re f) | 2897 | (setq fl (if (eq ido-cur-item 'file) |
| 2803 | (not (ido-ignore-item-p f ido-ignore-directories))) | 2898 | (ido-make-file-list1 dir t) |
| 2804 | (setq res (cons (cons f d) res))))) | 2899 | (ido-make-dir-list1 dir t)))) |
| 2900 | (if must-match | ||
| 2901 | (setq fl (ido-set-matches1 fl))) | ||
| 2902 | (if fl | ||
| 2903 | (setq res (nconc fl res)))) | ||
| 2805 | (if (and auto (input-pending-p)) | 2904 | (if (and auto (input-pending-p)) |
| 2806 | (setq dirs nil | 2905 | (setq dirs nil |
| 2807 | res t)))))) | 2906 | res t)))))) |
| 2808 | (if wide | 2907 | (quit (setq res t))) |
| 2809 | (setq res (ido-wide-find-dirs-or-files | ||
| 2810 | ido-current-directory text ido-enable-prefix nil)) | ||
| 2811 | (let ((ido-text text) | ||
| 2812 | (dirs ido-work-directory-list) | ||
| 2813 | (must-match (and text (> (length text) 0))) | ||
| 2814 | dir fl) | ||
| 2815 | (if (and auto (not (member ido-current-directory dirs))) | ||
| 2816 | (setq dirs (cons ido-current-directory dirs))) | ||
| 2817 | (while dirs | ||
| 2818 | (setq dir (car dirs) | ||
| 2819 | dirs (cdr dirs)) | ||
| 2820 | (when (and dir (stringp dir) | ||
| 2821 | (or ido-merge-ftp-work-directories | ||
| 2822 | (not (ido-is-ftp-directory dir))) | ||
| 2823 | (file-directory-p dir) | ||
| 2824 | ;; TODO. check for nonreadable and too-big. | ||
| 2825 | (setq fl (if (eq ido-cur-item 'file) | ||
| 2826 | (ido-make-file-list1 dir t) | ||
| 2827 | (ido-make-dir-list1 dir t)))) | ||
| 2828 | (if must-match | ||
| 2829 | (setq fl (ido-set-matches1 fl))) | ||
| 2830 | (if fl | ||
| 2831 | (setq res (nconc fl res)))) | ||
| 2832 | (if (and auto (input-pending-p)) | ||
| 2833 | (setq dirs nil | ||
| 2834 | res t)))))) | ||
| 2835 | (if (and res (not (eq res t))) | 2908 | (if (and res (not (eq res t))) |
| 2836 | (setq res (ido-sort-merged-list res auto))) | 2909 | (setq res (ido-sort-merged-list res auto))) |
| 2837 | (when (and (or ido-rotate-temp ido-rotate-file-list-default) | 2910 | (when (and (or ido-rotate-temp ido-rotate-file-list-default) |
| @@ -3063,7 +3136,8 @@ for first matching file." | |||
| 3063 | (setq ido-temp-list | 3136 | (setq ido-temp-list |
| 3064 | (cons default ido-temp-list)))) | 3137 | (cons default ido-temp-list)))) |
| 3065 | (setq ido-temp-list (delete "." ido-temp-list)) | 3138 | (setq ido-temp-list (delete "." ido-temp-list)) |
| 3066 | (setq ido-temp-list (cons "." ido-temp-list)) | 3139 | (unless ido-input-stack |
| 3140 | (setq ido-temp-list (cons "." ido-temp-list))) | ||
| 3067 | (run-hooks 'ido-make-dir-list-hook) | 3141 | (run-hooks 'ido-make-dir-list-hook) |
| 3068 | ido-temp-list)) | 3142 | ido-temp-list)) |
| 3069 | 3143 | ||
| @@ -3265,7 +3339,8 @@ for first matching file." | |||
| 3265 | (if (pos-visible-in-window-p (point-max) win) | 3339 | (if (pos-visible-in-window-p (point-max) win) |
| 3266 | (if (or ido-completion-buffer-all-completions (boundp 'ido-completion-buffer-full)) | 3340 | (if (or ido-completion-buffer-all-completions (boundp 'ido-completion-buffer-full)) |
| 3267 | (set-window-start win (point-min)) | 3341 | (set-window-start win (point-min)) |
| 3268 | (set (make-local-variable 'ido-completion-buffer-full) t) | 3342 | (with-no-warnings |
| 3343 | (set (make-local-variable 'ido-completion-buffer-full) t)) | ||
| 3269 | (setq full-list t | 3344 | (setq full-list t |
| 3270 | display-it t)) | 3345 | display-it t)) |
| 3271 | (scroll-other-window)) | 3346 | (scroll-other-window)) |