]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/icomplete.el (icomplete-minibuffer-setup, icomplete-completions):
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 22 Jun 2012 17:37:28 +0000 (13:37 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 22 Jun 2012 17:37:28 +0000 (13:37 -0400)
Move the non-essential binding to the post/pre-command-hook where it is
more obviously correct.

lisp/ChangeLog
lisp/icomplete.el

index 5c8bcaecfa0b4849210a9d13cf765d907f258f26..42342c60386291e5e6c4acde1a1bffa6904455be 100644 (file)
@@ -1,5 +1,9 @@
 2012-06-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * icomplete.el (icomplete-minibuffer-setup, icomplete-completions):
+       Move the non-essential binding to the post/pre-command-hook where it is
+       more obviously correct.
+
        * subr.el (read-passwd): Don't use a history at all.
        * savehist.el (savehist-save): Remove password saved accidentally
        because of the above bug.
index 97a14b12891cd3b0675a761dda00f94264a5d20b..a4e3e3394706085ccccfca2d14f35a3f53ae0a02 100644 (file)
@@ -209,10 +209,12 @@ Usually run by inclusion in `minibuffer-setup-hook'."
   (when (and icomplete-mode (icomplete-simple-completing-p))
     (set (make-local-variable 'completion-show-inline-help) nil)
     (add-hook 'pre-command-hook
-             (lambda () (run-hooks 'icomplete-pre-command-hook))
+             (lambda () (let ((non-essential t))
+                      (run-hooks 'icomplete-pre-command-hook)))
              nil t)
     (add-hook 'post-command-hook
-             (lambda () (run-hooks 'icomplete-post-command-hook))
+             (lambda () (let ((non-essential t)) ;E.g. don't prompt for password!
+                      (run-hooks 'icomplete-post-command-hook)))
              nil t)
     (run-hooks 'icomplete-minibuffer-setup-hook)))
 ;\f
@@ -285,8 +287,7 @@ The displays for unambiguous matches have ` [Matched]' appended
 matches exist.  \(Keybindings for uniquely matched commands
 are exhibited within the square braces.)"
 
-  (let* ((non-essential t)
-         (md (completion--field-metadata (field-beginning)))
+  (let* ((md (completion--field-metadata (field-beginning)))
         (comps (completion-all-sorted-completions))
          (last (if (consp comps) (last comps)))
          (base-size (cdr last))