comparison lisp/emacs-lisp/eldoc.el @ 17445:f2db4e8bb6ed

Add defgroup; use defcustom for user vars.
author Richard M. Stallman <rms@gnu.org>
date Mon, 14 Apr 1997 07:33:28 +0000
parents b47c3949b98e
children 161cc8316f98
comparison
equal deleted inserted replaced
17444:eec449c1f774 17445:f2db4e8bb6ed
5 ;; Author: Noah Friedman <friedman@prep.ai.mit.edu> 5 ;; Author: Noah Friedman <friedman@prep.ai.mit.edu>
6 ;; Maintainer: friedman@prep.ai.mit.edu 6 ;; Maintainer: friedman@prep.ai.mit.edu
7 ;; Keywords: extensions 7 ;; Keywords: extensions
8 ;; Created: 1995-10-06 8 ;; Created: 1995-10-06
9 9
10 ;; $Id: eldoc.el,v 1.10 1997/02/19 10:24:26 friedman Exp $ 10 ;; $Id: eldoc.el,v 1.11 1997/03/27 10:44:56 friedman Exp rms $
11 11
12 ;; This file is part of GNU Emacs. 12 ;; This file is part of GNU Emacs.
13 13
14 ;; GNU Emacs is free software; you can redistribute it and/or modify 14 ;; GNU Emacs is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by 15 ;; it under the terms of the GNU General Public License as published by
52 ;; XEmacs (which doesn't have timer.el as of 19.14), and I would like to 52 ;; XEmacs (which doesn't have timer.el as of 19.14), and I would like to
53 ;; maintain compatibility with that since I must use it sometimes. --Noah 53 ;; maintain compatibility with that since I must use it sometimes. --Noah
54 (or (featurep 'timer) 54 (or (featurep 'timer)
55 (load "timer" t)) 55 (load "timer" t))
56 56
57 (defgroup eldoc nil
58 "Show function arglist or variable docstring in echo area."
59 :group 'extensions)
60
57 ;;;###autoload 61 ;;;###autoload
58 (defvar eldoc-mode nil 62 (defcustom eldoc-mode nil
59 "*If non-nil, show the defined parameters for the elisp function near point. 63 "*If non-nil, show the defined parameters for the elisp function near point.
60 64
61 For the emacs lisp function at the beginning of the sexp which point is 65 For the emacs lisp function at the beginning of the sexp which point is
62 within, show the defined parameters for the function in the echo area. 66 within, show the defined parameters for the function in the echo area.
63 This information is extracted directly from the function or macro if it is 67 This information is extracted directly from the function or macro if it is
65 from the documentation string if possible. 69 from the documentation string if possible.
66 70
67 If point is over a documented variable, print that variable's docstring 71 If point is over a documented variable, print that variable's docstring
68 instead. 72 instead.
69 73
70 This variable is buffer-local.") 74 This variable is buffer-local."
75 :type 'boolean
76 :group 'eldoc)
71 (make-variable-buffer-local 'eldoc-mode) 77 (make-variable-buffer-local 'eldoc-mode)
72 78
73 (defvar eldoc-idle-delay 0.50 79 (defcustom eldoc-idle-delay 0.50
74 "*Number of seconds of idle time to wait before printing. 80 "*Number of seconds of idle time to wait before printing.
75 If user input arrives before this interval of time has elapsed after the 81 If user input arrives before this interval of time has elapsed after the
76 last input, no documentation will be printed. 82 last input, no documentation will be printed.
77 83
78 If this variable is set to 0, no idle time is required.") 84 If this variable is set to 0, no idle time is required."
79 85 :type 'number
80 (defvar eldoc-minor-mode-string " ElDoc" 86 :group 'eldoc)
81 "*String to display in mode line when Eldoc Mode is enabled.") 87
88 (defcustom eldoc-minor-mode-string " ElDoc"
89 "*String to display in mode line when Eldoc Mode is enabled."
90 :type 'string
91 :group 'eldoc)
82 92
83 ;; Put this minor mode on the global minor-mode-alist. 93 ;; Put this minor mode on the global minor-mode-alist.
84 (or (assq 'eldoc-mode (default-value 'minor-mode-alist)) 94 (or (assq 'eldoc-mode (default-value 'minor-mode-alist))
85 (setq-default minor-mode-alist 95 (setq-default minor-mode-alist
86 (append (default-value 'minor-mode-alist) 96 (append (default-value 'minor-mode-alist)
87 '((eldoc-mode eldoc-minor-mode-string))))) 97 '((eldoc-mode eldoc-minor-mode-string)))))
88 98
89 (defvar eldoc-argument-case 'upcase 99 (defcustom eldoc-argument-case 'upcase
90 "Case to display argument names of functions, as a symbol. 100 "Case to display argument names of functions, as a symbol.
91 This has two preferred values: `upcase' or `downcase'. 101 This has two preferred values: `upcase' or `downcase'.
92 Actually, any name of a function which takes a string as an argument and 102 Actually, any name of a function which takes a string as an argument and
93 returns another string is acceptable.") 103 returns another string is acceptable."
104 :type '(choice (const upcase) (const downcase))
105 :group 'eldoc)
94 106
95 ;; No user options below here. 107 ;; No user options below here.
96 108
97 (defvar eldoc-message-commands nil 109 (defvar eldoc-message-commands nil
98 "Commands after which it is appropriate to print in the echo area. 110 "Commands after which it is appropriate to print in the echo area.