diff options
author | Eli Zaretskii <eliz@gnu.org> | 2000-11-23 16:23:42 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2000-11-23 16:23:42 +0000 |
commit | c7b8986123876d71514015259491efd430082e67 (patch) | |
tree | fa7946831c1e24f7b6137b98c11662525743cccd /lisp/iswitchb.el | |
parent | 3b34558211b5260b744e7037eaa353fc25bb2eea (diff) | |
download | emacs-c7b8986123876d71514015259491efd430082e67.tar.gz |
(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.
Diffstat (limited to 'lisp/iswitchb.el')
-rw-r--r-- | lisp/iswitchb.el | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index bee6769c89f..1e220deb130 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el @@ -459,6 +459,9 @@ selected.") (defvar iswitchb-bufs-in-frame nil "List of the buffers visible in the current frame.") +(defvar iswitchb-minibuf-depth nil + "Value we expect to be returned by `minibuffer-depth' in the minibuffer.") + ;;; FUNCTIONS ;;; ISWITCHB KEYMAP @@ -571,6 +574,9 @@ If REQUIRE-MATCH is non-nil, an existing-buffer must be selected." (let ((minibuffer-local-completion-map iswitchb-mode-map) (iswitchb-prepost-hooks t) + ;; Record the minibuffer depth that we expect to find once + ;; the minibuffer is set up and iswitchb-entryfn-p is called. + (iswitchb-minibuf-depth (1+ (minibuffer-depth))) (iswitchb-require-match require-match)) ;; prompt the user for the buffer name (setq iswitchb-final-text (completing-read @@ -1292,14 +1298,7 @@ Copied from `icomplete-tidy'." (defun iswitchb-entryfn-p () "Return non-nil if we are using `iswitchb-buffer'." - ;; Testing if `iswitchb-prepost-hooks' is bound does not work when - ;; we're invoking a recursive mini-buffer from an Iswitchb buffer. - ;; In this case, `iswitchb-prepost-hooks' is bound in the second - ;; mini-buffer, although it's not an Iswitchb buffer. - (memq this-command - '(iswitchb-buffer iswitchb-buffer-other-frame - iswitchb-display-buffer - iswitchb-buffer-other-window))) + (eq iswitchb-minibuf-depth (minibuffer-depth))) (defun iswitchb-summaries-to-end () "Move the summaries to the end of the list. |