comparison lisp/simple.el @ 4217:997e8a52f9fd

(completion-list-mode): Renamed from completion-mode. (completion-list-mode-map): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Thu, 22 Jul 1993 05:47:10 +0000
parents 25a49899f199
children 20486b99584f
comparison
equal deleted inserted replaced
4216:6f940dcec978 4217:997e8a52f9fd
2195 (eval-minibuffer (format "Set %s to value: " var))))))) 2195 (eval-minibuffer (format "Set %s to value: " var)))))))
2196 (set var val)) 2196 (set var val))
2197 2197
2198 ;; Define the major mode for lists of completions. 2198 ;; Define the major mode for lists of completions.
2199 2199
2200 (defvar completion-mode-map nil) 2200 (defvar completion-list-mode-map nil)
2201 (or completion-mode-map 2201 (or completion-list-mode-map
2202 (let ((map (make-sparse-keymap))) 2202 (let ((map (make-sparse-keymap)))
2203 (define-key map [mouse-2] 'mouse-choose-completion) 2203 (define-key map [mouse-2] 'mouse-choose-completion)
2204 (setq completion-mode-map map))) 2204 (setq completion-list-mode-map map)))
2205 2205
2206 ;; Completion mode is suitable only for specially formatted data. 2206 ;; Completion mode is suitable only for specially formatted data.
2207 (put 'completion-mode 'mode-class 'special) 2207 (put 'completion-list-mode 'mode-class 'special)
2208 2208
2209 (defun completion-mode () 2209 (defun completion-list-mode ()
2210 "Major mode for buffers showing lists of possible completions. 2210 "Major mode for buffers showing lists of possible completions.
2211 Type \\<completion-mode-map>\\[mouse-choose-completion] to select 2211 Type \\<completion-list-mode-map>\\[mouse-choose-completion] to select
2212 a completion with the mouse." 2212 a completion with the mouse."
2213 (interactive) 2213 (interactive)
2214 (kill-all-local-variables) 2214 (kill-all-local-variables)
2215 (use-local-map completion-mode-map) 2215 (use-local-map completion-list-mode-map)
2216 (setq mode-name "Completion") 2216 (setq mode-name "Completion List")
2217 (setq major-mode 'completion-mode) 2217 (setq major-mode 'completion-list-mode)
2218 (run-hooks 'completion-mode-hook)) 2218 (run-hooks 'completion-list-mode-hook))
2219 2219
2220 (defun completion-setup-function () 2220 (defun completion-setup-function ()
2221 (save-excursion 2221 (save-excursion
2222 (completion-mode) 2222 (completion-list-mode)
2223 (goto-char (point-min)) 2223 (goto-char (point-min))
2224 (if window-system 2224 (if window-system
2225 (insert (substitute-command-keys 2225 (insert (substitute-command-keys
2226 "Click \\[mouse-choose-completion] on a completion to select it.\n\n"))))) 2226 "Click \\[mouse-choose-completion] on a completion to select it.\n\n")))))
2227 2227