aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2020-03-12 18:21:19 -0400
committerStefan Monnier2020-03-12 18:21:19 -0400
commit3db5a51384d80306b3279c2c0ceaf48e18e49474 (patch)
treeada31b786d2402d42360f89170a93d6978a239c3
parent2d221c8d87185fd02a6eb7558ddc4c9524153d72 (diff)
downloademacs-3db5a51384d80306b3279c2c0ceaf48e18e49474.tar.gz
emacs-3db5a51384d80306b3279c2c0ceaf48e18e49474.zip
* lisp/emacs-lisp/eldoc.el: Remove redundant `:group` arguments
-rw-r--r--lisp/emacs-lisp/eldoc.el58
1 files changed, 23 insertions, 35 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 660fce4be0b..4a2e7488eb0 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -32,13 +32,9 @@
32;; the one-line documentation for that variable instead, to remind you of 32;; the one-line documentation for that variable instead, to remind you of
33;; that variable's meaning. 33;; that variable's meaning.
34 34
35;; One useful way to enable this minor mode is to put the following in your 35;; This mode is now enabled by default in all major modes that provide
36;; .emacs: 36;; support for it, such as `emacs-lisp-mode'.
37;; 37;; This is controlled by `global-eldoc-mode'.
38;; (add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
39;; (add-hook 'lisp-interaction-mode-hook 'eldoc-mode)
40;; (add-hook 'ielm-mode-hook 'eldoc-mode)
41;; (add-hook 'eval-expression-minibuffer-setup-hook 'eldoc-mode)
42 38
43;; Major modes for other languages may use ElDoc by adding an 39;; Major modes for other languages may use ElDoc by adding an
44;; appropriate function to the buffer-local value of 40;; appropriate function to the buffer-local value of
@@ -57,20 +53,17 @@ If user input arrives before this interval of time has elapsed after the
57last input, no documentation will be printed. 53last input, no documentation will be printed.
58 54
59If this variable is set to 0, no idle time is required." 55If this variable is set to 0, no idle time is required."
60 :type 'number 56 :type 'number)
61 :group 'eldoc)
62 57
63(defcustom eldoc-print-after-edit nil 58(defcustom eldoc-print-after-edit nil
64 "If non-nil eldoc info is only shown when editing. 59 "If non-nil eldoc info is only shown when editing.
65Changing the value requires toggling `eldoc-mode'." 60Changing the value requires toggling `eldoc-mode'."
66 :type 'boolean 61 :type 'boolean)
67 :group 'eldoc)
68 62
69;;;###autoload 63;;;###autoload
70(defcustom eldoc-minor-mode-string (purecopy " ElDoc") 64(defcustom eldoc-minor-mode-string (purecopy " ElDoc")
71 "String to display in mode line when ElDoc Mode is enabled; nil for none." 65 "String to display in mode line when ElDoc Mode is enabled; nil for none."
72 :type '(choice string (const :tag "None" nil)) 66 :type '(choice string (const :tag "None" nil)))
73 :group 'eldoc)
74 67
75(defcustom eldoc-argument-case #'identity 68(defcustom eldoc-argument-case #'identity
76 "Case to display argument names of functions, as a symbol. 69 "Case to display argument names of functions, as a symbol.
@@ -82,8 +75,7 @@ Note that this variable has no effect, unless
82`eldoc-documentation-function' handles it explicitly." 75`eldoc-documentation-function' handles it explicitly."
83 :type '(radio (function-item upcase) 76 :type '(radio (function-item upcase)
84 (function-item downcase) 77 (function-item downcase)
85 function) 78 function))
86 :group 'eldoc)
87(make-obsolete-variable 'eldoc-argument-case nil "25.1") 79(make-obsolete-variable 'eldoc-argument-case nil "25.1")
88 80
89(defcustom eldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit 81(defcustom eldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit
@@ -106,15 +98,13 @@ Note that this variable has no effect, unless
106 :type '(radio (const :tag "Always" t) 98 :type '(radio (const :tag "Always" t)
107 (const :tag "Never" nil) 99 (const :tag "Never" nil)
108 (const :tag "Yes, but truncate symbol names if it will\ 100 (const :tag "Yes, but truncate symbol names if it will\
109 enable argument list to fit on one line" truncate-sym-name-if-fit)) 101 enable argument list to fit on one line" truncate-sym-name-if-fit)))
110 :group 'eldoc)
111 102
112(defface eldoc-highlight-function-argument 103(defface eldoc-highlight-function-argument
113 '((t (:inherit bold))) 104 '((t (:inherit bold)))
114 "Face used for the argument at point in a function's argument list. 105 "Face used for the argument at point in a function's argument list.
115Note that this face has no effect unless the `eldoc-documentation-function' 106Note that this face has no effect unless the `eldoc-documentation-function'
116handles it explicitly." 107handles it explicitly.")
117 :group 'eldoc)
118 108
119;;; No user options below here. 109;;; No user options below here.
120 110
@@ -182,8 +172,7 @@ area displays information about a function or variable in the
182text where point is. If point is on a documented variable, it 172text where point is. If point is on a documented variable, it
183displays the first line of that variable's doc string. Otherwise 173displays the first line of that variable's doc string. Otherwise
184it displays the argument list of the function called in the 174it displays the argument list of the function called in the
185expression point is on." 175expression point is on." :lighter eldoc-minor-mode-string
186 :group 'eldoc :lighter eldoc-minor-mode-string
187 (setq eldoc-last-message nil) 176 (setq eldoc-last-message nil)
188 (cond 177 (cond
189 ((not (eldoc--supported-p)) 178 ((not (eldoc--supported-p))
@@ -193,19 +182,18 @@ expression point is on."
193 (eldoc-mode 182 (eldoc-mode
194 (when eldoc-print-after-edit 183 (when eldoc-print-after-edit
195 (setq-local eldoc-message-commands (eldoc-edit-message-commands))) 184 (setq-local eldoc-message-commands (eldoc-edit-message-commands)))
196 (add-hook 'post-command-hook 'eldoc-schedule-timer nil t) 185 (add-hook 'post-command-hook #'eldoc-schedule-timer nil t)
197 (add-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area nil t)) 186 (add-hook 'pre-command-hook #'eldoc-pre-command-refresh-echo-area nil t))
198 (t 187 (t
199 (kill-local-variable 'eldoc-message-commands) 188 (kill-local-variable 'eldoc-message-commands)
200 (remove-hook 'post-command-hook 'eldoc-schedule-timer t) 189 (remove-hook 'post-command-hook #'eldoc-schedule-timer t)
201 (remove-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area t) 190 (remove-hook 'pre-command-hook #'eldoc-pre-command-refresh-echo-area t)
202 (when eldoc-timer 191 (when eldoc-timer
203 (cancel-timer eldoc-timer) 192 (cancel-timer eldoc-timer)
204 (setq eldoc-timer nil))))) 193 (setq eldoc-timer nil)))))
205 194
206;;;###autoload 195;;;###autoload
207(define-globalized-minor-mode global-eldoc-mode eldoc-mode turn-on-eldoc-mode 196(define-globalized-minor-mode global-eldoc-mode eldoc-mode turn-on-eldoc-mode
208 :group 'eldoc
209 :initialize 'custom-initialize-delay 197 :initialize 'custom-initialize-delay
210 :init-value t 198 :init-value t
211 ;; For `read--expression', the usual global mode mechanism of 199 ;; For `read--expression', the usual global mode mechanism of
@@ -284,7 +272,7 @@ Otherwise work like `message'."
284 (when (stringp format-string) 272 (when (stringp format-string)
285 (apply #'format-message format-string args))) 273 (apply #'format-message format-string args)))
286 (force-mode-line-update))) 274 (force-mode-line-update)))
287 (apply 'message format-string args))) 275 (apply #'message format-string args)))
288 276
289(defun eldoc-message (&optional string) 277(defun eldoc-message (&optional string)
290 "Display STRING as an ElDoc message if it's non-nil. 278 "Display STRING as an ElDoc message if it's non-nil.
@@ -292,9 +280,7 @@ Otherwise work like `message'."
292Also store it in `eldoc-last-message' and return that value." 280Also store it in `eldoc-last-message' and return that value."
293 (let ((omessage eldoc-last-message)) 281 (let ((omessage eldoc-last-message))
294 (setq eldoc-last-message string) 282 (setq eldoc-last-message string)
295 ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages 283 ;; Do not put eldoc messages in the log since they are Legion.
296 ;; are recorded in a log. Do not put eldoc messages in that log since
297 ;; they are Legion.
298 ;; Emacs way of preventing log messages. 284 ;; Emacs way of preventing log messages.
299 (let ((message-log-max nil)) 285 (let ((message-log-max nil))
300 (cond (eldoc-last-message 286 (cond (eldoc-last-message
@@ -307,12 +293,15 @@ Also store it in `eldoc-last-message' and return that value."
307 (and (symbolp command) 293 (and (symbolp command)
308 (intern-soft (symbol-name command) eldoc-message-commands))) 294 (intern-soft (symbol-name command) eldoc-message-commands)))
309 295
310;; This function goes on pre-command-hook for XEmacs or when using idle 296;; This function goes on pre-command-hook.
311;; timers in Emacs. Motion commands clear the echo area for some reason, 297;; Motion commands clear the echo area for some reason,
312;; which make eldoc messages flicker or disappear just before motion 298;; which make eldoc messages flicker or disappear just before motion
313;; begins. This function reprints the last eldoc message immediately 299;; begins. This function reprints the last eldoc message immediately
314;; before the next command executes, which does away with the flicker. 300;; before the next command executes, which does away with the flicker.
315;; This doesn't seem to be required for Emacs 19.28 and earlier. 301;; This doesn't seem to be required for Emacs 19.28 and earlier.
302;; FIXME: The above comment suggests we don't really understand why
303;; this is needed. Maybe it's not needed any more, but if it is
304;; we should figure out why.
316(defun eldoc-pre-command-refresh-echo-area () 305(defun eldoc-pre-command-refresh-echo-area ()
317 "Reprint `eldoc-last-message' in the echo area." 306 "Reprint `eldoc-last-message' in the echo area."
318 (and eldoc-last-message 307 (and eldoc-last-message
@@ -385,7 +374,7 @@ Meant as a value for `eldoc-documentation-function'."
385(defcustom eldoc-documentation-function #'eldoc-documentation-default 374(defcustom eldoc-documentation-function #'eldoc-documentation-default
386 "Function to call to return doc string. 375 "Function to call to return doc string.
387The function of no args should return a one-line string for displaying 376The function of no args should return a one-line string for displaying
388doc about a function etc. appropriate to the context around point. 377doc about a function etc. appropriate to the context around point.
389It should return nil if there's no doc appropriate for the context. 378It should return nil if there's no doc appropriate for the context.
390Typically doc is returned if point is on a function-like name or in its 379Typically doc is returned if point is on a function-like name or in its
391arg list. 380arg list.
@@ -398,8 +387,7 @@ effect."
398 :type '(radio (function-item eldoc-documentation-default) 387 :type '(radio (function-item eldoc-documentation-default)
399 (function-item eldoc-documentation-compose) 388 (function-item eldoc-documentation-compose)
400 (function :tag "Other function")) 389 (function :tag "Other function"))
401 :version "28.1" 390 :version "28.1")
402 :group 'eldoc)
403 391
404(defun eldoc--supported-p () 392(defun eldoc--supported-p ()
405 "Non-nil if an ElDoc function is set for this buffer." 393 "Non-nil if an ElDoc function is set for this buffer."