emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103884: Fix bad interaction between


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103884: Fix bad interaction between icomplete and completion inline help (Bug#5849).
Date: Sun, 10 Apr 2011 17:31:14 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 103884
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2011-04-10 17:31:14 -0400
message:
  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.
modified:
  lisp/ChangeLog
  lisp/icomplete.el
  lisp/minibuffer.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-04-10 16:33:22 +0000
+++ b/lisp/ChangeLog    2011-04-10 21:31:14 +0000
@@ -1,3 +1,13 @@
+2011-04-10  Chong Yidong  <address@hidden>
+
+       * 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.
+
+       * icomplete.el (icomplete-mode): Bind completion-show-inline-help
+       to avoid interference from inline help (Bug#5849).
+
 2011-04-10  Leo Liu  <address@hidden>
 
        * emacs-lisp/tabulated-list.el (tabulated-list-print-entry): Fix

=== modified file 'lisp/icomplete.el'
--- a/lisp/icomplete.el 2011-01-26 08:36:39 +0000
+++ b/lisp/icomplete.el 2011-04-10 21:31:14 +0000
@@ -179,8 +179,11 @@
   (if icomplete-mode
       ;; The following is not really necessary after first time -
       ;; no great loss.
-      (add-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup)
-    (remove-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup)))
+      (progn
+       (setq completion-show-inline-help nil)
+       (add-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup))
+    (remove-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup)
+    (setq completion-show-inline-help t)))
 
 ;;;_ > icomplete-simple-completing-p ()
 (defun icomplete-simple-completing-p ()

=== modified file 'lisp/minibuffer.el'
--- a/lisp/minibuffer.el        2011-04-05 21:19:42 +0000
+++ b/lisp/minibuffer.el        2011-04-10 21:31:14 +0000
@@ -381,6 +381,9 @@
   ;; is on, the field doesn't cover the entire minibuffer contents.
   (delete-region (minibuffer-prompt-end) (point-max)))
 
+(defvar completion-show-inline-help t
+  "If non-nil, print helpful inline messages during completion.")
+
 (defcustom completion-auto-help t
   "Non-nil means automatically provide help for invalid completion input.
 If the value is t the *Completion* buffer is displayed whenever completion
@@ -568,8 +571,9 @@
     (cond
      ((null comp)
       (minibuffer-hide-completions)
-      (unless completion-fail-discreetly
-        (ding) (minibuffer-message "No match"))
+      (when (and (not completion-fail-discreetly) completion-show-inline-help)
+       (ding)
+       (minibuffer-message "No match"))
       (minibuffer--bitset nil nil nil))
      ((eq t comp)
       (minibuffer-hide-completions)
@@ -639,9 +643,10 @@
               (minibuffer-hide-completions))
              ;; Show the completion table, if requested.
              ((not exact)
-              (if (case completion-auto-help
-                    (lazy (eq this-command last-command))
-                    (t completion-auto-help))
+             (if (cond ((null completion-show-inline-help) t)
+                       ((eq completion-auto-help 'lazy)
+                        (eq this-command last-command))
+                       (t completion-auto-help))
                   (minibuffer-completion-help)
                 (minibuffer-message "Next char not unique")))
              ;; If the last exact completion and this one were the same, it
@@ -683,9 +688,11 @@
     t)
    (t (case (completion--do-completion)
         (#b000 nil)
-        (#b001 (minibuffer-message "Sole completion")
+        (#b001 (if completion-show-inline-help
+                  (minibuffer-message "Sole completion"))
                t)
-        (#b011 (minibuffer-message "Complete, but not unique")
+        (#b011 (if completion-show-inline-help
+                  (minibuffer-message "Complete, but not unique"))
                t)
         (t     t)))))
 
@@ -743,7 +750,9 @@
          (end (field-end))
          (all (completion-all-sorted-completions)))
     (if (not (consp all))
-        (minibuffer-message (if all "No more completions" "No completions"))
+       (if completion-show-inline-help
+           (minibuffer-message
+            (if all "No more completions" "No completions")))
       (setq completion-cycling t)
       (goto-char end)
       (insert (car all))
@@ -931,9 +940,11 @@
   (interactive)
   (case (completion--do-completion 'completion--try-word-completion)
     (#b000 nil)
-    (#b001 (minibuffer-message "Sole completion")
+    (#b001 (if completion-show-inline-help
+              (minibuffer-message "Sole completion"))
            t)
-    (#b011 (minibuffer-message "Complete, but not unique")
+    (#b011 (if completion-show-inline-help
+              (minibuffer-message "Complete, but not unique"))
            t)
     (t     t)))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]