diff options
| author | Kim F. Storm | 2005-12-07 09:22:53 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-12-07 09:22:53 +0000 |
| commit | facf67fd3c97e1a166607b84f40d28b6134f160d (patch) | |
| tree | 8dca3976c0ab554dcdf6b40266d191e7fb833c6f | |
| parent | b89a8e1a6dc1fad78af79026f2ca09d88b9b9580 (diff) | |
| download | emacs-facf67fd3c97e1a166607b84f40d28b6134f160d.tar.gz emacs-facf67fd3c97e1a166607b84f40d28b6134f160d.zip | |
(ido-completion-map): Renamed from ido-mode-map.
(ido-common-completion-map, ido-file-completion-map)
(ido-file-dir-completion-map, ido-buffer-completion-map):
Renamed from ido-mode-....-map.
(ido-init-completion-maps): Renamed from ido-init-mode-maps.
(ido-setup-completion-map): Renamed from ido-define-mode-map.
(ido-read-internal): Bind minibuffer-local-filename-completion-map
to ido-completion-map.
| -rw-r--r-- | lisp/ido.el | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index a6bd99cdeea..e6dcea5fd21 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -252,7 +252,7 @@ | |||
| 252 | ;; | 252 | ;; |
| 253 | ;;(defun ido-my-keys () | 253 | ;;(defun ido-my-keys () |
| 254 | ;; "Add my keybindings for ido." | 254 | ;; "Add my keybindings for ido." |
| 255 | ;; (define-key ido-mode-map " " 'ido-next-match) | 255 | ;; (define-key ido-completion-map " " 'ido-next-match) |
| 256 | ;; ) | 256 | ;; ) |
| 257 | 257 | ||
| 258 | ;; Seeing all the matching buffers or files | 258 | ;; Seeing all the matching buffers or files |
| @@ -716,7 +716,7 @@ ask user whether to create buffer, or 'never to never create new buffer." | |||
| 716 | "*Hook run after the ido variables and keymap have been setup. | 716 | "*Hook run after the ido variables and keymap have been setup. |
| 717 | The dynamic variable `ido-cur-item' contains the current type of item that | 717 | The dynamic variable `ido-cur-item' contains the current type of item that |
| 718 | is read by ido, possible values are file, dir, buffer, and list. | 718 | is read by ido, possible values are file, dir, buffer, and list. |
| 719 | Additional keys can be defined in `ido-mode-map'." | 719 | Additional keys can be defined in `ido-completion-map'." |
| 720 | :type 'hook | 720 | :type 'hook |
| 721 | :group 'ido) | 721 | :group 'ido) |
| 722 | 722 | ||
| @@ -898,19 +898,19 @@ The fallback command is passed as an argument to the functions." | |||
| 898 | 898 | ||
| 899 | ;; Persistent variables | 899 | ;; Persistent variables |
| 900 | 900 | ||
| 901 | (defvar ido-mode-map nil | 901 | (defvar ido-completion-map nil |
| 902 | "Currently active keymap for ido commands.") | 902 | "Currently active keymap for ido commands.") |
| 903 | 903 | ||
| 904 | (defvar ido-mode-common-map nil | 904 | (defvar ido-common-completion-map nil |
| 905 | "Keymap for all ido commands.") | 905 | "Keymap for all ido commands.") |
| 906 | 906 | ||
| 907 | (defvar ido-mode-file-map nil | 907 | (defvar ido-file-completion-map nil |
| 908 | "Keymap for ido file commands.") | 908 | "Keymap for ido file commands.") |
| 909 | 909 | ||
| 910 | (defvar ido-mode-file-dir-map nil | 910 | (defvar ido-file-dir-completion-map nil |
| 911 | "Keymap for ido file and directory commands.") | 911 | "Keymap for ido file and directory commands.") |
| 912 | 912 | ||
| 913 | (defvar ido-mode-buffer-map nil | 913 | (defvar ido-buffer-completion-map nil |
| 914 | "Keymap for ido buffer commands.") | 914 | "Keymap for ido buffer commands.") |
| 915 | 915 | ||
| 916 | (defvar ido-file-history nil | 916 | (defvar ido-file-history nil |
| @@ -1345,7 +1345,7 @@ This function also adds a hook to the minibuffer." | |||
| 1345 | 1345 | ||
| 1346 | (ido-everywhere (if ido-everywhere 1 -1)) | 1346 | (ido-everywhere (if ido-everywhere 1 -1)) |
| 1347 | (when ido-mode | 1347 | (when ido-mode |
| 1348 | (ido-init-mode-maps)) | 1348 | (ido-init-completion-maps)) |
| 1349 | 1349 | ||
| 1350 | (when ido-mode | 1350 | (when ido-mode |
| 1351 | (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup) | 1351 | (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup) |
| @@ -1354,12 +1354,7 @@ This function also adds a hook to the minibuffer." | |||
| 1354 | 1354 | ||
| 1355 | (add-hook 'kill-emacs-hook 'ido-kill-emacs-hook) | 1355 | (add-hook 'kill-emacs-hook 'ido-kill-emacs-hook) |
| 1356 | 1356 | ||
| 1357 | (if ido-minor-mode-map-entry | 1357 | (let ((map (make-sparse-keymap))) |
| 1358 | (setcdr ido-minor-mode-map-entry (make-sparse-keymap)) | ||
| 1359 | (setq ido-minor-mode-map-entry (cons 'ido-mode (make-sparse-keymap))) | ||
| 1360 | (add-to-list 'minor-mode-map-alist ido-minor-mode-map-entry)) | ||
| 1361 | |||
| 1362 | (let ((map (cdr ido-minor-mode-map-entry))) | ||
| 1363 | (when (memq ido-mode '(file both)) | 1358 | (when (memq ido-mode '(file both)) |
| 1364 | (define-key map [remap find-file] 'ido-find-file) | 1359 | (define-key map [remap find-file] 'ido-find-file) |
| 1365 | (define-key map [remap find-file-read-only] 'ido-find-file-read-only) | 1360 | (define-key map [remap find-file-read-only] 'ido-find-file-read-only) |
| @@ -1379,7 +1374,13 @@ This function also adds a hook to the minibuffer." | |||
| 1379 | (define-key map [remap switch-to-buffer-other-frame] 'ido-switch-buffer-other-frame) | 1374 | (define-key map [remap switch-to-buffer-other-frame] 'ido-switch-buffer-other-frame) |
| 1380 | (define-key map [remap insert-buffer] 'ido-insert-buffer) | 1375 | (define-key map [remap insert-buffer] 'ido-insert-buffer) |
| 1381 | (define-key map [remap kill-buffer] 'ido-kill-buffer) | 1376 | (define-key map [remap kill-buffer] 'ido-kill-buffer) |
| 1382 | (define-key map [remap display-buffer] 'ido-display-buffer))))) | 1377 | (define-key map [remap display-buffer] 'ido-display-buffer)) |
| 1378 | |||
| 1379 | (if ido-minor-mode-map-entry | ||
| 1380 | (setcdr ido-minor-mode-map-entry map) | ||
| 1381 | (setq ido-minor-mode-map-entry (cons 'ido-mode map)) | ||
| 1382 | (add-to-list 'minor-mode-map-alist ido-minor-mode-map-entry))))) | ||
| 1383 | |||
| 1383 | 1384 | ||
| 1384 | (defun ido-everywhere (arg) | 1385 | (defun ido-everywhere (arg) |
| 1385 | "Toggle using ido speed-ups everywhere file and directory names are read. | 1386 | "Toggle using ido speed-ups everywhere file and directory names are read. |
| @@ -1404,8 +1405,8 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise." | |||
| 1404 | 1405 | ||
| 1405 | 1406 | ||
| 1406 | ;;; IDO KEYMAP | 1407 | ;;; IDO KEYMAP |
| 1407 | (defun ido-init-mode-maps () | 1408 | (defun ido-init-completion-maps () |
| 1408 | "Set up the keymaps used by `ido'." | 1409 | "Set up the completion keymaps used by `ido'." |
| 1409 | 1410 | ||
| 1410 | ;; Common map | 1411 | ;; Common map |
| 1411 | (let ((map (make-sparse-keymap))) | 1412 | (let ((map (make-sparse-keymap))) |
| @@ -1431,7 +1432,7 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise." | |||
| 1431 | (define-key map "\C-f" 'ido-magic-forward-char) | 1432 | (define-key map "\C-f" 'ido-magic-forward-char) |
| 1432 | (define-key map "\C-d" 'ido-magic-delete-char) | 1433 | (define-key map "\C-d" 'ido-magic-delete-char) |
| 1433 | (set-keymap-parent map minibuffer-local-map) | 1434 | (set-keymap-parent map minibuffer-local-map) |
| 1434 | (setq ido-mode-common-map map)) | 1435 | (setq ido-common-completion-map map)) |
| 1435 | 1436 | ||
| 1436 | ;; File and directory map | 1437 | ;; File and directory map |
| 1437 | (let ((map (make-sparse-keymap))) | 1438 | (let ((map (make-sparse-keymap))) |
| @@ -1457,8 +1458,8 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise." | |||
| 1457 | (define-key map [(meta control ?o)] 'ido-next-work-file) | 1458 | (define-key map [(meta control ?o)] 'ido-next-work-file) |
| 1458 | (define-key map [(meta ?p)] 'ido-prev-work-directory) | 1459 | (define-key map [(meta ?p)] 'ido-prev-work-directory) |
| 1459 | (define-key map [(meta ?s)] 'ido-merge-work-directories) | 1460 | (define-key map [(meta ?s)] 'ido-merge-work-directories) |
| 1460 | (set-keymap-parent map ido-mode-common-map) | 1461 | (set-keymap-parent map ido-common-completion-map) |
| 1461 | (setq ido-mode-file-dir-map map)) | 1462 | (setq ido-file-dir-completion-map map)) |
| 1462 | 1463 | ||
| 1463 | ;; File only map | 1464 | ;; File only map |
| 1464 | (let ((map (make-sparse-keymap))) | 1465 | (let ((map (make-sparse-keymap))) |
| @@ -1467,19 +1468,19 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise." | |||
| 1467 | (define-key map "\C-w" 'ido-copy-current-file-name) | 1468 | (define-key map "\C-w" 'ido-copy-current-file-name) |
| 1468 | (define-key map [(meta ?l)] 'ido-toggle-literal) | 1469 | (define-key map [(meta ?l)] 'ido-toggle-literal) |
| 1469 | (define-key map "\C-v" 'ido-toggle-vc) | 1470 | (define-key map "\C-v" 'ido-toggle-vc) |
| 1470 | (set-keymap-parent map ido-mode-file-dir-map) | 1471 | (set-keymap-parent map ido-file-dir-completion-map) |
| 1471 | (setq ido-mode-file-map map)) | 1472 | (setq ido-file-completion-map map)) |
| 1472 | 1473 | ||
| 1473 | ;; Buffer map | 1474 | ;; Buffer map |
| 1474 | (let ((map (make-sparse-keymap))) | 1475 | (let ((map (make-sparse-keymap))) |
| 1475 | (define-key map "\C-x\C-f" 'ido-enter-find-file) | 1476 | (define-key map "\C-x\C-f" 'ido-enter-find-file) |
| 1476 | (define-key map "\C-x\C-b" 'ido-fallback-command) | 1477 | (define-key map "\C-x\C-b" 'ido-fallback-command) |
| 1477 | (define-key map "\C-k" 'ido-kill-buffer-at-head) | 1478 | (define-key map "\C-k" 'ido-kill-buffer-at-head) |
| 1478 | (set-keymap-parent map ido-mode-common-map) | 1479 | (set-keymap-parent map ido-common-completion-map) |
| 1479 | (setq ido-mode-buffer-map map))) | 1480 | (setq ido-buffer-completion-map map))) |
| 1480 | 1481 | ||
| 1481 | 1482 | ||
| 1482 | (defun ido-define-mode-map () | 1483 | (defun ido-setup-completion-map () |
| 1483 | "Set up the keymap for `ido'." | 1484 | "Set up the keymap for `ido'." |
| 1484 | 1485 | ||
| 1485 | ;; generated every time so that it can inherit new functions. | 1486 | ;; generated every time so that it can inherit new functions. |
| @@ -1500,18 +1501,18 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise." | |||
| 1500 | (define-key map [remap viper-delete-backward-word] 'ido-delete-backward-word-updir)) | 1501 | (define-key map [remap viper-delete-backward-word] 'ido-delete-backward-word-updir)) |
| 1501 | (set-keymap-parent map | 1502 | (set-keymap-parent map |
| 1502 | (if (eq ido-cur-item 'file) | 1503 | (if (eq ido-cur-item 'file) |
| 1503 | ido-mode-file-map | 1504 | ido-file-completion-map |
| 1504 | ido-mode-file-dir-map))) | 1505 | ido-file-dir-completion-map))) |
| 1505 | 1506 | ||
| 1506 | ((eq ido-cur-item 'buffer) | 1507 | ((eq ido-cur-item 'buffer) |
| 1507 | (when ido-context-switch-command | 1508 | (when ido-context-switch-command |
| 1508 | (define-key map "\C-x\C-f" ido-context-switch-command)) | 1509 | (define-key map "\C-x\C-f" ido-context-switch-command)) |
| 1509 | (set-keymap-parent map ido-mode-buffer-map)) | 1510 | (set-keymap-parent map ido-buffer-completion-map)) |
| 1510 | 1511 | ||
| 1511 | (t | 1512 | (t |
| 1512 | (set-keymap-parent map ido-mode-common-map))) | 1513 | (set-keymap-parent map ido-common-completion-map))) |
| 1513 | 1514 | ||
| 1514 | (setq ido-mode-map map))) | 1515 | (setq ido-completion-map map))) |
| 1515 | 1516 | ||
| 1516 | (defun ido-final-slash (dir &optional fix-it) | 1517 | (defun ido-final-slash (dir &optional fix-it) |
| 1517 | ;; return DIR if DIR has final slash. | 1518 | ;; return DIR if DIR has final slash. |
| @@ -1683,7 +1684,7 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1683 | (ido-enable-regexp ido-enable-regexp) | 1684 | (ido-enable-regexp ido-enable-regexp) |
| 1684 | ) | 1685 | ) |
| 1685 | 1686 | ||
| 1686 | (ido-define-mode-map) | 1687 | (ido-setup-completion-map) |
| 1687 | (setq ido-text-init initial) | 1688 | (setq ido-text-init initial) |
| 1688 | (setq ido-input-stack nil) | 1689 | (setq ido-input-stack nil) |
| 1689 | 1690 | ||
| @@ -1788,7 +1789,8 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1788 | (if (and ido-matches (eq ido-try-merged-list 'auto)) | 1789 | (if (and ido-matches (eq ido-try-merged-list 'auto)) |
| 1789 | (setq ido-try-merged-list t)) | 1790 | (setq ido-try-merged-list t)) |
| 1790 | (let | 1791 | (let |
| 1791 | ((minibuffer-local-completion-map ido-mode-map) | 1792 | ((minibuffer-local-completion-map ido-completion-map) |
| 1793 | (minibuffer-local-filename-completion-map ido-completion-map) | ||
| 1792 | (max-mini-window-height (or ido-max-window-height | 1794 | (max-mini-window-height (or ido-max-window-height |
| 1793 | (and (boundp 'max-mini-window-height) max-mini-window-height))) | 1795 | (and (boundp 'max-mini-window-height) max-mini-window-height))) |
| 1794 | (ido-completing-read t) | 1796 | (ido-completing-read t) |
| @@ -3670,7 +3672,7 @@ As you type in a string, all of the buffers matching the string are | |||
| 3670 | displayed if substring-matching is used \(default). Look at | 3672 | displayed if substring-matching is used \(default). Look at |
| 3671 | `ido-enable-prefix' and `ido-toggle-prefix'. When you have found the | 3673 | `ido-enable-prefix' and `ido-toggle-prefix'. When you have found the |
| 3672 | buffer you want, it can then be selected. As you type, most keys have | 3674 | buffer you want, it can then be selected. As you type, most keys have |
| 3673 | their normal keybindings, except for the following: \\<ido-mode-buffer-map> | 3675 | their normal keybindings, except for the following: \\<ido-buffer-completion-map> |
| 3674 | 3676 | ||
| 3675 | RET Select the buffer at the front of the list of matches. If the | 3677 | RET Select the buffer at the front of the list of matches. If the |
| 3676 | list is empty, possibly prompt to create new buffer. | 3678 | list is empty, possibly prompt to create new buffer. |
| @@ -3758,7 +3760,7 @@ type in a string, all of the filenames matching the string are displayed | |||
| 3758 | if substring-matching is used \(default). Look at `ido-enable-prefix' and | 3760 | if substring-matching is used \(default). Look at `ido-enable-prefix' and |
| 3759 | `ido-toggle-prefix'. When you have found the filename you want, it can | 3761 | `ido-toggle-prefix'. When you have found the filename you want, it can |
| 3760 | then be selected. As you type, most keys have their normal keybindings, | 3762 | then be selected. As you type, most keys have their normal keybindings, |
| 3761 | except for the following: \\<ido-mode-file-map> | 3763 | except for the following: \\<ido-file-completion-map> |
| 3762 | 3764 | ||
| 3763 | RET Select the file at the front of the list of matches. If the | 3765 | RET Select the file at the front of the list of matches. If the |
| 3764 | list is empty, possibly prompt to create new file. | 3766 | list is empty, possibly prompt to create new file. |