diff lisp/simple.el @ 72645:abc1e4de6197

(completion-show-help): New defcustom. (completion-setup-function): Heed it.
author John Paul Wallington <jpw@pobox.com>
date Mon, 04 Sep 2006 18:24:48 +0000
parents abebf4e18f10
children aa474eace5e0 c358d0861b16
line wrap: on
line diff
--- a/lisp/simple.el	Mon Sep 04 16:54:25 2006 +0000
+++ b/lisp/simple.el	Mon Sep 04 18:24:48 2006 +0000
@@ -4984,6 +4984,12 @@
 
 ;; Variables and faces used in `completion-setup-function'.
 
+(defcustom completion-show-help t
+  "Non-nil means show help message in *Completions* buffer."
+  :type 'boolean
+  :version "22.1"
+  :group 'completion)
+
 (defface completions-first-difference
   '((t (:inherit bold)))
   "Face put on the first uncommon character in completions in *Completions* buffer."
@@ -5070,14 +5076,15 @@
 	      (if (get-char-property element-common-end 'mouse-face)
 		  (put-text-property element-common-end (1+ element-common-end)
 				     'font-lock-face 'completions-first-difference))))))
-      ;; Insert help string.
-      (goto-char (point-min))
-      (if (display-mouse-p)
-	  (insert (substitute-command-keys
-		   "Click \\[mouse-choose-completion] on a completion to select it.\n")))
-      (insert (substitute-command-keys
-	       "In this buffer, type \\[choose-completion] to \
-select the completion near point.\n\n")))))
+      ;; Maybe insert help string.
+      (when completion-show-help
+	(goto-char (point-min))
+	(if (display-mouse-p)
+	    (insert (substitute-command-keys
+		     "Click \\[mouse-choose-completion] on a completion to select it.\n")))
+	(insert (substitute-command-keys
+		 "In this buffer, type \\[choose-completion] to \
+select the completion near point.\n\n"))))))
 
 (add-hook 'completion-setup-hook 'completion-setup-function)