diff options
| author | John Wiegley | 2010-04-05 23:38:56 -0400 |
|---|---|---|
| committer | John Wiegley | 2010-04-05 23:38:56 -0400 |
| commit | f9a27d86155b3f436daa755e2b9d89c71afa8e8d (patch) | |
| tree | 429106f27f8365bd19e3883ff8e3f9b88bffed6a | |
| parent | 9caf8a8f7f3a3ef2c37a603b3818c25dbacf9605 (diff) | |
| download | emacs-f9a27d86155b3f436daa755e2b9d89c71afa8e8d.tar.gz emacs-f9a27d86155b3f436daa755e2b9d89c71afa8e8d.zip | |
Minor fixes to a recent contribution to ido.el
* ido.el (ido-use-virtual-buffers, ido-virtual): Moved a ChangeLog
comment to code, and added a :version tag.
(ido-virtual-buffers): Moved defvar to fix byte-compiler warning.
| -rw-r--r-- | lisp/ChangeLog | 19 | ||||
| -rw-r--r-- | lisp/ido.el | 17 |
2 files changed, 23 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d875b01e858..5cd9e08d5e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-04-06 John Wiegley <jwiegley@gmail.com> | ||
| 2 | |||
| 3 | * ido.el (ido-use-virtual-buffers, ido-virtual): Moved a ChangeLog | ||
| 4 | comment to code, and added a :version tag. | ||
| 5 | (ido-virtual-buffers): Moved defvar to fix byte-compiler warning. | ||
| 6 | |||
| 1 | 2010-04-06 Juanma Barranquero <lekktu@gmail.com> | 7 | 2010-04-06 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 8 | ||
| 3 | Enable recentf-mode if using virtual buffers. | 9 | Enable recentf-mode if using virtual buffers. |
| @@ -41,18 +47,7 @@ | |||
| 41 | 2010-04-04 John Wiegley <jwiegley@gmail.com> | 47 | 2010-04-04 John Wiegley <jwiegley@gmail.com> |
| 42 | 48 | ||
| 43 | * ido.el (ido-use-virtual-buffers): New variable to indicate | 49 | * ido.el (ido-use-virtual-buffers): New variable to indicate |
| 44 | whether "virtual buffer" support is enabled for IDO. Essentially | 50 | whether "virtual buffer" support is enabled for IDO. |
| 45 | it works as follows: Say you are visiting a file and the buffer | ||
| 46 | gets cleaned up by mignight.el. Later, you want to switch to that | ||
| 47 | buffer, but find it's no longer open. With virtual buffers | ||
| 48 | enabled, the buffer name stays in the buffer list (using the | ||
| 49 | ido-virtual face, and always at the end), and if you select it, it | ||
| 50 | opens the file back up again. This allows you to think less about | ||
| 51 | whether recently opened files are still open or not. Most of the | ||
| 52 | time you can quit Emacs, restart, and then switch to a file buffer | ||
| 53 | that was previously open as if it still were. NOTE: This feature | ||
| 54 | has been present in iswitchb for several years now, and I'm | ||
| 55 | porting the same logic to IDO. | ||
| 56 | (ido-virtual): Face used to indicate virtual buffers in the list. | 51 | (ido-virtual): Face used to indicate virtual buffers in the list. |
| 57 | (ido-buffer-internal): If a buffer is chosen, and no such buffer | 52 | (ido-buffer-internal): If a buffer is chosen, and no such buffer |
| 58 | exists, but a virtual buffer of that name does (which would be why | 53 | exists, but a virtual buffer of that name does (which would be why |
diff --git a/lisp/ido.el b/lisp/ido.el index 4200475bfce..53b18374d1e 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -777,8 +777,19 @@ can be completed using TAB, | |||
| 777 | 777 | ||
| 778 | (defcustom ido-use-virtual-buffers nil | 778 | (defcustom ido-use-virtual-buffers nil |
| 779 | "If non-nil, refer to past buffers as well as existing ones. | 779 | "If non-nil, refer to past buffers as well as existing ones. |
| 780 | This feature relies upon the `recentf' package, which will be | 780 | Essentially it works as follows: Say you are visiting a file and |
| 781 | the buffer gets cleaned up by mignight.el. Later, you want to | ||
| 782 | switch to that buffer, but find it's no longer open. With | ||
| 783 | virtual buffers enabled, the buffer name stays in the buffer | ||
| 784 | list (using the ido-virtual face, and always at the end), and if | ||
| 785 | you select it, it opens the file back up again. This allows you | ||
| 786 | to think less about whether recently opened files are still open | ||
| 787 | or not. Most of the time you can quit Emacs, restart, and then | ||
| 788 | switch to a file buffer that was previously open as if it still | ||
| 789 | were. | ||
| 790 | This feature relies upon the `recentf' package, which will be | ||
| 781 | enabled if this variable is configured to a non-nil value." | 791 | enabled if this variable is configured to a non-nil value." |
| 792 | :version "24.1" | ||
| 782 | :type 'boolean | 793 | :type 'boolean |
| 783 | :group 'ido) | 794 | :group 'ido) |
| 784 | 795 | ||
| @@ -808,6 +819,7 @@ subdirs in the alternatives." | |||
| 808 | 819 | ||
| 809 | (defface ido-virtual '((t (:inherit font-lock-builtin-face))) | 820 | (defface ido-virtual '((t (:inherit font-lock-builtin-face))) |
| 810 | "Face used by ido for matching virtual buffer names." | 821 | "Face used by ido for matching virtual buffer names." |
| 822 | :version "24.1" | ||
| 811 | :group 'ido) | 823 | :group 'ido) |
| 812 | 824 | ||
| 813 | (defface ido-indicator '((((min-colors 88) (class color)) | 825 | (defface ido-indicator '((((min-colors 88) (class color)) |
| @@ -1124,6 +1136,9 @@ Only used if `ido-use-virtual-buffers' is non-nil.") | |||
| 1124 | ;; Set to 'ignore to inhibit switching between find-file/switch-buffer. | 1136 | ;; Set to 'ignore to inhibit switching between find-file/switch-buffer. |
| 1125 | (defvar ido-context-switch-command) | 1137 | (defvar ido-context-switch-command) |
| 1126 | 1138 | ||
| 1139 | ;; Caches list of names generated by `ido-add-virtual-buffers-to-list' | ||
| 1140 | (defvar ido-virtual-buffers nil) | ||
| 1141 | |||
| 1127 | ;;; FUNCTIONS | 1142 | ;;; FUNCTIONS |
| 1128 | 1143 | ||
| 1129 | (defun ido-active (&optional merge) | 1144 | (defun ido-active (&optional merge) |