49 |
|
|
50 |
;;; Example |
;;; Example |
51 |
|
|
52 |
;;If I have two buffers called "123456" and "123", with "123456" the |
;; If I have two buffers called "123456" and "123", with "123456" the |
53 |
;;most recent, when I use iswitchb, I first of all get presented with |
;; most recent, when I use iswitchb, I first of all get presented with |
54 |
;;the list of all the buffers |
;; the list of all the buffers |
55 |
;; |
;; |
56 |
;; iswitch {123456,123} |
;; iswitch {123456,123} |
57 |
;; |
;; |
73 |
;; wanted the second in the list, I could press C-s to move it to the |
;; wanted the second in the list, I could press C-s to move it to the |
74 |
;; top of the list and then RET to select it. |
;; top of the list and then RET to select it. |
75 |
;; |
;; |
76 |
;;However, If I type 4, I only have one match left: |
;; However, if I type 4, I only have one match left: |
77 |
;; iswitch 234[123456] [Matched] |
;; iswitch 234[123456] [Matched] |
78 |
;; |
;; |
79 |
;;Since there is only one matching buffer left, it is given in [] and we |
;; Since there is only one matching buffer left, it is given in [] and we |
80 |
;;see the text [Matched] afterwards. I can now press TAB or RET to go |
;; see the text [Matched] afterwards. I can now press TAB or RET to go |
81 |
;;to that buffer. |
;; to that buffer. |
82 |
;; |
;; |
83 |
;; If however, I now type "a": |
;; If however, I now type "a": |
84 |
;; iswitch 234a [No match] |
;; iswitch 234a [No match] |
103 |
;; If you find that the file you are after is not in a buffer, you can |
;; If you find that the file you are after is not in a buffer, you can |
104 |
;; press C-x C-f to immediately drop into find-file. |
;; press C-x C-f to immediately drop into find-file. |
105 |
|
|
106 |
;; |
;; See the doc string of iswitchb for full keybindings and features. |
107 |
;; See the doc string of iswitchb for full keybindings and features. |
;; (describe-function 'iswitchb) |
|
;; (describe-function 'iswitchb) |
|
108 |
|
|
109 |
;; Case matching: The case of strings when matching can be ignored or |
;; Case matching: The case of strings when matching can be ignored or |
110 |
;; used depending on the value of iswitchb-case (default is the same |
;; used depending on the value of iswitchb-case (default is the same |
175 |
;; for the normal buffer selection routine `read-buffer'. To use |
;; for the normal buffer selection routine `read-buffer'. To use |
176 |
;; iswitch for all buffer selections in Emacs, add: |
;; iswitch for all buffer selections in Emacs, add: |
177 |
;; (setq read-buffer-function 'iswitchb-read-buffer) |
;; (setq read-buffer-function 'iswitchb-read-buffer) |
178 |
;; (This variable should be present in Emacs 20.3+) |
;; (This variable was introduced in Emacs 20.3.) |
179 |
;; XEmacs users can get the same behaviour by doing: |
;; XEmacs users can get the same behaviour by doing: |
180 |
;; (defalias 'read-buffer 'iswitchb-read-buffer) |
;; (defalias 'read-buffer 'iswitchb-read-buffer) |
181 |
;; since `read-buffer' is defined in lisp. |
;; since `read-buffer' is defined in lisp. |
182 |
|
|
183 |
|
;; Using iswitchb for other completion tasks. |
184 |
|
|
185 |
|
;; Kin Cho (kin@neoscale.com sent the following suggestion to use |
186 |
|
;; iswitchb for other completion tasks. |
187 |
|
;; |
188 |
|
;; (defun my-icompleting-read (prompt choices) |
189 |
|
;; "Use iswitch as a completing-read replacement to choose from |
190 |
|
;; choices. PROMPT is a string to prompt with. CHOICES is a list of |
191 |
|
;; strings to choose from." |
192 |
|
;; (let ((iswitchb-make-buflist-hook |
193 |
|
;; (lambda () |
194 |
|
;; (setq iswitchb-temp-buflist choices)))) |
195 |
|
;; (iswitchb-read-buffer prompt))) |
196 |
|
;; |
197 |
|
;; example: |
198 |
|
;; (my-icompleting-read "Which fruit? " ' |
199 |
|
;; ("apple" "pineapple" "pear" "bananas" "oranges") ) |
200 |
|
|
201 |
|
;; Other lisp packages extend iswitchb behaviour to other tasks. See |
202 |
|
;; ido.el (by Kim Storm) and mcomplete.el (Yuji Minejima). |
203 |
|
|
204 |
|
;; Window managers: Switching frames/focus follows mouse; Sawfish. |
205 |
|
|
206 |
|
;; If you switch to a buffer that is visible in another frame, |
207 |
|
;; iswitchb can switch focus to that frame. If your window manager |
208 |
|
;; uses "click to focus" policy for window selection, you should also |
209 |
|
;; set focus-follows-mouse to nil. |
210 |
|
|
211 |
|
;; iswitch functionality has also been implemented for switching |
212 |
|
;; between windows in the Sawfish window manager. |
213 |
|
|
214 |
;; Regexp matching |
;; Regexp matching |
215 |
|
|
216 |
;; There is limited provision for regexp matching within iswitchb, |
;; There is limited provision for regexp matching within iswitchb, |
997 |
(or (eq iswitchb-method 'always-frame) |
(or (eq iswitchb-method 'always-frame) |
998 |
(y-or-n-p "Jump to frame? "))) |
(y-or-n-p "Jump to frame? "))) |
999 |
(setq newframe (window-frame win)) |
(setq newframe (window-frame win)) |
1000 |
(raise-frame newframe) |
(if (not iswitchb-xemacs) |
1001 |
(select-frame newframe) |
(select-frame-set-input-focus newframe) |
1002 |
(select-window win) |
(raise-frame newframe) |
1003 |
(if (not iswitchb-xemacs) |
(select-frame newframe) |
1004 |
;; reposition mouse to make frame active. not needed in XEmacs |
) |
1005 |
;; This line came from the other-frame defun in Emacs. |
(select-window win)) |
|
(set-mouse-position (selected-frame) (1- (frame-width)) 0))) |
|
1006 |
(t |
(t |
1007 |
;; No buffer in other frames... |
;; No buffer in other frames... |
1008 |
(switch-to-buffer buffer) |
(switch-to-buffer buffer) |
1018 |
(progn |
(progn |
1019 |
(switch-to-buffer-other-frame buffer) |
(switch-to-buffer-other-frame buffer) |
1020 |
(if (not iswitchb-xemacs) |
(if (not iswitchb-xemacs) |
1021 |
(set-mouse-position (selected-frame) (1- (frame-width)) 0)) |
(select-frame-set-input-focus (selected-frame))) |
1022 |
))))) |
))))) |
1023 |
|
|
1024 |
(defun iswitchb-possible-new-buffer (buf) |
(defun iswitchb-possible-new-buffer (buf) |