aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-04-10 17:31:14 -0400
committerChong Yidong2011-04-10 17:31:14 -0400
commit369e974dc086452033227a5d350c357602c6274e (patch)
treed480a3320659ae79e8f361591c5e4e66b40d8f71
parent8a2cbd723c0b453b70dc1fcefe5b489f58605258 (diff)
downloademacs-369e974dc086452033227a5d350c357602c6274e.tar.gz
emacs-369e974dc086452033227a5d350c357602c6274e.zip
Fix bad interaction between icomplete and completion inline help (Bug#5849).
* lisp/minibuffer.el (completion-show-inline-help): New var. (completion--do-completion, minibuffer-complete) (minibuffer-force-complete, minibuffer-complete-word): Inhibit minibuffer messages if completion-show-inline-help is nil. * lisp/icomplete.el (icomplete-mode): Bind completion-show-inline-help to avoid interference from inline help.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/icomplete.el7
-rw-r--r--lisp/minibuffer.el31
3 files changed, 36 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 51f8066077d..8de276b8480 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12011-04-10 Chong Yidong <cyd@stupidchicken.com>
2
3 * minibuffer.el (completion-show-inline-help): New var.
4 (completion--do-completion, minibuffer-complete)
5 (minibuffer-force-complete, minibuffer-complete-word): Inhibit
6 minibuffer messages if completion-show-inline-help is nil.
7
8 * icomplete.el (icomplete-mode): Bind completion-show-inline-help
9 to avoid interference from inline help (Bug#5849).
10
12011-04-10 Leo Liu <sdl.web@gmail.com> 112011-04-10 Leo Liu <sdl.web@gmail.com>
2 12
3 * emacs-lisp/tabulated-list.el (tabulated-list-print-entry): Fix 13 * emacs-lisp/tabulated-list.el (tabulated-list-print-entry): Fix
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 490b2b2ebfc..ab67fcfcdfd 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -179,8 +179,11 @@ otherwise turn it off."
179 (if icomplete-mode 179 (if icomplete-mode
180 ;; The following is not really necessary after first time - 180 ;; The following is not really necessary after first time -
181 ;; no great loss. 181 ;; no great loss.
182 (add-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup) 182 (progn
183 (remove-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup))) 183 (setq completion-show-inline-help nil)
184 (add-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup))
185 (remove-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup)
186 (setq completion-show-inline-help t)))
184 187
185;;;_ > icomplete-simple-completing-p () 188;;;_ > icomplete-simple-completing-p ()
186(defun icomplete-simple-completing-p () 189(defun icomplete-simple-completing-p ()
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 19084aad5d6..d6e11b5a7c5 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -381,6 +381,9 @@ If the current buffer is not a minibuffer, erase its entire contents."
381 ;; is on, the field doesn't cover the entire minibuffer contents. 381 ;; is on, the field doesn't cover the entire minibuffer contents.
382 (delete-region (minibuffer-prompt-end) (point-max))) 382 (delete-region (minibuffer-prompt-end) (point-max)))
383 383
384(defvar completion-show-inline-help t
385 "If non-nil, print helpful inline messages during completion.")
386
384(defcustom completion-auto-help t 387(defcustom completion-auto-help t
385 "Non-nil means automatically provide help for invalid completion input. 388 "Non-nil means automatically provide help for invalid completion input.
386If the value is t the *Completion* buffer is displayed whenever completion 389If the value is t the *Completion* buffer is displayed whenever completion
@@ -568,8 +571,9 @@ E = after completion we now have an Exact match.
568 (cond 571 (cond
569 ((null comp) 572 ((null comp)
570 (minibuffer-hide-completions) 573 (minibuffer-hide-completions)
571 (unless completion-fail-discreetly 574 (when (and (not completion-fail-discreetly) completion-show-inline-help)
572 (ding) (minibuffer-message "No match")) 575 (ding)
576 (minibuffer-message "No match"))
573 (minibuffer--bitset nil nil nil)) 577 (minibuffer--bitset nil nil nil))
574 ((eq t comp) 578 ((eq t comp)
575 (minibuffer-hide-completions) 579 (minibuffer-hide-completions)
@@ -639,9 +643,10 @@ E = after completion we now have an Exact match.
639 (minibuffer-hide-completions)) 643 (minibuffer-hide-completions))
640 ;; Show the completion table, if requested. 644 ;; Show the completion table, if requested.
641 ((not exact) 645 ((not exact)
642 (if (case completion-auto-help 646 (if (cond ((null completion-show-inline-help) t)
643 (lazy (eq this-command last-command)) 647 ((eq completion-auto-help 'lazy)
644 (t completion-auto-help)) 648 (eq this-command last-command))
649 (t completion-auto-help))
645 (minibuffer-completion-help) 650 (minibuffer-completion-help)
646 (minibuffer-message "Next char not unique"))) 651 (minibuffer-message "Next char not unique")))
647 ;; If the last exact completion and this one were the same, it 652 ;; If the last exact completion and this one were the same, it
@@ -683,9 +688,11 @@ scroll the window of possible completions."
683 t) 688 t)
684 (t (case (completion--do-completion) 689 (t (case (completion--do-completion)
685 (#b000 nil) 690 (#b000 nil)
686 (#b001 (minibuffer-message "Sole completion") 691 (#b001 (if completion-show-inline-help
692 (minibuffer-message "Sole completion"))
687 t) 693 t)
688 (#b011 (minibuffer-message "Complete, but not unique") 694 (#b011 (if completion-show-inline-help
695 (minibuffer-message "Complete, but not unique"))
689 t) 696 t)
690 (t t))))) 697 (t t)))))
691 698
@@ -743,7 +750,9 @@ Repeated uses step through the possible completions."
743 (end (field-end)) 750 (end (field-end))
744 (all (completion-all-sorted-completions))) 751 (all (completion-all-sorted-completions)))
745 (if (not (consp all)) 752 (if (not (consp all))
746 (minibuffer-message (if all "No more completions" "No completions")) 753 (if completion-show-inline-help
754 (minibuffer-message
755 (if all "No more completions" "No completions")))
747 (setq completion-cycling t) 756 (setq completion-cycling t)
748 (goto-char end) 757 (goto-char end)
749 (insert (car all)) 758 (insert (car all))
@@ -931,9 +940,11 @@ Return nil if there is no valid completion, else t."
931 (interactive) 940 (interactive)
932 (case (completion--do-completion 'completion--try-word-completion) 941 (case (completion--do-completion 'completion--try-word-completion)
933 (#b000 nil) 942 (#b000 nil)
934 (#b001 (minibuffer-message "Sole completion") 943 (#b001 (if completion-show-inline-help
944 (minibuffer-message "Sole completion"))
935 t) 945 t)
936 (#b011 (minibuffer-message "Complete, but not unique") 946 (#b011 (if completion-show-inline-help
947 (minibuffer-message "Complete, but not unique"))
937 t) 948 t)
938 (t t))) 949 (t t)))
939 950