Mercurial > emacs
comparison lisp/iswitchb.el @ 33818:42ed3c6a1d89
(iswitchb-minibuf-depth): New variable.
(iswitchb-read-buffer): Record in iswitchb-minibuf-depth the value
we expect to be returned by minibuffer-depth once we prompt the
user in the minibuffer.
(iswitchb-entryfn-p): If minibuffer-depth returns the same value
as recorded in iswitchb-minibuf-depth, return non-nil.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Thu, 23 Nov 2000 16:23:42 +0000 |
parents | 47476840057c |
children | 6059c5943d9f |
comparison
equal
deleted
inserted
replaced
33817:c0bef67fde0c | 33818:42ed3c6a1d89 |
---|---|
456 (defvar iswitchb-temp-buflist nil | 456 (defvar iswitchb-temp-buflist nil |
457 "Stores a temporary version of the buffer list being created.") | 457 "Stores a temporary version of the buffer list being created.") |
458 | 458 |
459 (defvar iswitchb-bufs-in-frame nil | 459 (defvar iswitchb-bufs-in-frame nil |
460 "List of the buffers visible in the current frame.") | 460 "List of the buffers visible in the current frame.") |
461 | |
462 (defvar iswitchb-minibuf-depth nil | |
463 "Value we expect to be returned by `minibuffer-depth' in the minibuffer.") | |
461 | 464 |
462 ;;; FUNCTIONS | 465 ;;; FUNCTIONS |
463 | 466 |
464 ;;; ISWITCHB KEYMAP | 467 ;;; ISWITCHB KEYMAP |
465 (defun iswitchb-define-mode-map () | 468 (defun iswitchb-define-mode-map () |
569 (iswitchb-make-buflist iswitchb-default) | 572 (iswitchb-make-buflist iswitchb-default) |
570 (iswitchb-set-matches) | 573 (iswitchb-set-matches) |
571 (let | 574 (let |
572 ((minibuffer-local-completion-map iswitchb-mode-map) | 575 ((minibuffer-local-completion-map iswitchb-mode-map) |
573 (iswitchb-prepost-hooks t) | 576 (iswitchb-prepost-hooks t) |
577 ;; Record the minibuffer depth that we expect to find once | |
578 ;; the minibuffer is set up and iswitchb-entryfn-p is called. | |
579 (iswitchb-minibuf-depth (1+ (minibuffer-depth))) | |
574 (iswitchb-require-match require-match)) | 580 (iswitchb-require-match require-match)) |
575 ;; prompt the user for the buffer name | 581 ;; prompt the user for the buffer name |
576 (setq iswitchb-final-text (completing-read | 582 (setq iswitchb-final-text (completing-read |
577 prompt ;the prompt | 583 prompt ;the prompt |
578 '(("dummy" . 1)) ;table | 584 '(("dummy" . 1)) ;table |
1290 (make-local-variable 'iswitchb-eoinput) | 1296 (make-local-variable 'iswitchb-eoinput) |
1291 (setq iswitchb-eoinput 1))) | 1297 (setq iswitchb-eoinput 1))) |
1292 | 1298 |
1293 (defun iswitchb-entryfn-p () | 1299 (defun iswitchb-entryfn-p () |
1294 "Return non-nil if we are using `iswitchb-buffer'." | 1300 "Return non-nil if we are using `iswitchb-buffer'." |
1295 ;; Testing if `iswitchb-prepost-hooks' is bound does not work when | 1301 (eq iswitchb-minibuf-depth (minibuffer-depth))) |
1296 ;; we're invoking a recursive mini-buffer from an Iswitchb buffer. | |
1297 ;; In this case, `iswitchb-prepost-hooks' is bound in the second | |
1298 ;; mini-buffer, although it's not an Iswitchb buffer. | |
1299 (memq this-command | |
1300 '(iswitchb-buffer iswitchb-buffer-other-frame | |
1301 iswitchb-display-buffer | |
1302 iswitchb-buffer-other-window))) | |
1303 | 1302 |
1304 (defun iswitchb-summaries-to-end () | 1303 (defun iswitchb-summaries-to-end () |
1305 "Move the summaries to the end of the list. | 1304 "Move the summaries to the end of the list. |
1306 This is an example function which can be hooked on to | 1305 This is an example function which can be hooked on to |
1307 `iswitchb-make-buflist-hook'. Any buffer matching the regexps | 1306 `iswitchb-make-buflist-hook'. Any buffer matching the regexps |