]> code.delx.au - gnu-emacs/commitdiff
(iswitchb-entryfn-p): Test this-command instead
authorGerd Moellmann <gerd@gnu.org>
Sun, 30 Jul 2000 14:03:38 +0000 (14:03 +0000)
committerGerd Moellmann <gerd@gnu.org>
Sun, 30 Jul 2000 14:03:38 +0000 (14:03 +0000)
of testing if iswitchb-prepost-hooks is bound, because the
latter will always be true when invoking a recursive minibuffer
from an active Iswitchb buffer.

lisp/ChangeLog
lisp/iswitchb.el

index 99f458e5566781e5dadfcecfa6e009d4c406b7ea..768bae5c84385df7e886f30e3ec5f8d8ba2d1b32 100644 (file)
@@ -1,3 +1,10 @@
+2000-07-30  Gerd Moellmann  <gerd@gnu.org>
+
+       * iswitchb.el (iswitchb-entryfn-p): Test this-command instead
+       of testing if iswitchb-prepost-hooks is bound, because the
+       latter will always be true when invoking a recursive minibuffer
+       from an active Iswitchb buffer.
+
 2000-07-30  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * files.el (shell-quote-wildcard-pattern): New function.
index 6cd519bcc9f1a909eb04257120798d7bf5b527d0..6ab5f01f095e1bb5dbeddd764753fa0ca7ec4d65 100644 (file)
@@ -1088,7 +1088,6 @@ This is a hack for XEmacs, and should really be handled by `iswitchb-exhibit'."
 Copied from `icomplete-exhibit' with two changes:
 1. It prints a default buffer name when there is no text yet entered.
 2. It calls my completion routine rather than the standard completion."
-
   (if iswitchb-use-mycompletion
       (let ((contents (buffer-substring (minibuffer-prompt-end) (point-max)))
            (buffer-undo-list t))
@@ -1108,16 +1107,13 @@ Copied from `icomplete-exhibit' with two changes:
          (iswitchb-set-common-completion)
 
          ;; Insert the match-status information:
-         (insert-string
-          (iswitchb-completions 
-           contents
-           minibuffer-completion-table
-           minibuffer-completion-predicate
-           (not minibuffer-completion-confirm)))
-         ))))
-
-(defun iswitchb-completions
-  (name candidates predicate require-match)
+         (insert-string (iswitchb-completions 
+                         contents
+                         minibuffer-completion-table
+                         minibuffer-completion-predicate
+                         (not minibuffer-completion-confirm)))))))
+
+(defun iswitchb-completions (name candidates predicate require-match)
   "Return the string that is displayed after the user's text.
 Modified from `icomplete-completions'."
   
@@ -1249,17 +1245,15 @@ Copied from `icomplete-tidy'."
     (setq iswitchb-eoinput 1)))
 
 (defun iswitchb-entryfn-p ()
-  "Return non-nil if `this-command' shows we are using `iswitchb-buffer'."
-  (or (boundp 'iswitchb-prepost-hooks)
-      ;; I think the of this may be redundant, since the prepost hooks
-      ;; will always be set in the iswitchb defuns.
-      ;;(and (symbolp this-command)            ; ignore lambda functions
-      ;;(memq this-command
-      ;;        '(iswitchb-buffer
-      ;;          iswitchb-buffer-other-frame
-      ;;       iswitchb-display-buffer
-      ;;       iswitchb-buffer-other-window))))
-  ))
+  "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)))
 
 (defun iswitchb-summaries-to-end ()
   "Move the summaries to the end of the list.