comparison 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
comparison
equal deleted inserted replaced
72644:d1d94d84ec3f 72645:abc1e4de6197
4982 value of `completion-common-substring'. See also `display-completion-list'.") 4982 value of `completion-common-substring'. See also `display-completion-list'.")
4983 4983
4984 4984
4985 ;; Variables and faces used in `completion-setup-function'. 4985 ;; Variables and faces used in `completion-setup-function'.
4986 4986
4987 (defcustom completion-show-help t
4988 "Non-nil means show help message in *Completions* buffer."
4989 :type 'boolean
4990 :version "22.1"
4991 :group 'completion)
4992
4987 (defface completions-first-difference 4993 (defface completions-first-difference
4988 '((t (:inherit bold))) 4994 '((t (:inherit bold)))
4989 "Face put on the first uncommon character in completions in *Completions* buffer." 4995 "Face put on the first uncommon character in completions in *Completions* buffer."
4990 :group 'completion) 4996 :group 'completion)
4991 4997
5068 (put-text-property element-start element-common-end 5074 (put-text-property element-start element-common-end
5069 'font-lock-face 'completions-common-part)) 5075 'font-lock-face 'completions-common-part))
5070 (if (get-char-property element-common-end 'mouse-face) 5076 (if (get-char-property element-common-end 'mouse-face)
5071 (put-text-property element-common-end (1+ element-common-end) 5077 (put-text-property element-common-end (1+ element-common-end)
5072 'font-lock-face 'completions-first-difference)))))) 5078 'font-lock-face 'completions-first-difference))))))
5073 ;; Insert help string. 5079 ;; Maybe insert help string.
5074 (goto-char (point-min)) 5080 (when completion-show-help
5075 (if (display-mouse-p) 5081 (goto-char (point-min))
5076 (insert (substitute-command-keys 5082 (if (display-mouse-p)
5077 "Click \\[mouse-choose-completion] on a completion to select it.\n"))) 5083 (insert (substitute-command-keys
5078 (insert (substitute-command-keys 5084 "Click \\[mouse-choose-completion] on a completion to select it.\n")))
5079 "In this buffer, type \\[choose-completion] to \ 5085 (insert (substitute-command-keys
5080 select the completion near point.\n\n"))))) 5086 "In this buffer, type \\[choose-completion] to \
5087 select the completion near point.\n\n"))))))
5081 5088
5082 (add-hook 'completion-setup-hook 'completion-setup-function) 5089 (add-hook 'completion-setup-hook 'completion-setup-function)
5083 5090
5084 (define-key minibuffer-local-completion-map [prior] 'switch-to-completions) 5091 (define-key minibuffer-local-completion-map [prior] 'switch-to-completions)
5085 (define-key minibuffer-local-completion-map "\M-v" 'switch-to-completions) 5092 (define-key minibuffer-local-completion-map "\M-v" 'switch-to-completions)