emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3db5a51: * lisp/emacs-lisp/eldoc.el: Remove redundant `:group` ar


From: Stefan Monnier
Subject: master 3db5a51: * lisp/emacs-lisp/eldoc.el: Remove redundant `:group` arguments
Date: Thu, 12 Mar 2020 18:21:24 -0400 (EDT)

branch: master
commit 3db5a51384d80306b3279c2c0ceaf48e18e49474
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/emacs-lisp/eldoc.el: Remove redundant `:group` arguments
---
 lisp/emacs-lisp/eldoc.el | 58 +++++++++++++++++++-----------------------------
 1 file changed, 23 insertions(+), 35 deletions(-)

diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 660fce4..4a2e748 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -32,13 +32,9 @@
 ;; the one-line documentation for that variable instead, to remind you of
 ;; that variable's meaning.
 
-;; One useful way to enable this minor mode is to put the following in your
-;; .emacs:
-;;
-;;      (add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
-;;      (add-hook 'lisp-interaction-mode-hook 'eldoc-mode)
-;;      (add-hook 'ielm-mode-hook 'eldoc-mode)
-;;      (add-hook 'eval-expression-minibuffer-setup-hook 'eldoc-mode)
+;; This mode is now enabled by default in all major modes that provide
+;; support for it, such as `emacs-lisp-mode'.
+;; This is controlled by `global-eldoc-mode'.
 
 ;; Major modes for other languages may use ElDoc by adding an
 ;; 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
 last input, no documentation will be printed.
 
 If this variable is set to 0, no idle time is required."
-  :type 'number
-  :group 'eldoc)
+  :type 'number)
 
 (defcustom eldoc-print-after-edit nil
   "If non-nil eldoc info is only shown when editing.
 Changing the value requires toggling `eldoc-mode'."
-  :type 'boolean
-  :group 'eldoc)
+  :type 'boolean)
 
 ;;;###autoload
 (defcustom eldoc-minor-mode-string (purecopy " ElDoc")
   "String to display in mode line when ElDoc Mode is enabled; nil for none."
-  :type '(choice string (const :tag "None" nil))
-  :group 'eldoc)
+  :type '(choice string (const :tag "None" nil)))
 
 (defcustom eldoc-argument-case #'identity
   "Case to display argument names of functions, as a symbol.
@@ -82,8 +75,7 @@ Note that this variable has no effect, unless
 `eldoc-documentation-function' handles it explicitly."
   :type '(radio (function-item upcase)
                (function-item downcase)
-                function)
-  :group 'eldoc)
+                function))
 (make-obsolete-variable 'eldoc-argument-case nil "25.1")
 
 (defcustom eldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit
@@ -106,15 +98,13 @@ Note that this variable has no effect, unless
   :type '(radio (const :tag "Always" t)
                 (const :tag "Never" nil)
                 (const :tag "Yes, but truncate symbol names if it will\
- enable argument list to fit on one line" truncate-sym-name-if-fit))
-  :group 'eldoc)
+ enable argument list to fit on one line" truncate-sym-name-if-fit)))
 
 (defface eldoc-highlight-function-argument
   '((t (:inherit bold)))
   "Face used for the argument at point in a function's argument list.
 Note that this face has no effect unless the `eldoc-documentation-function'
-handles it explicitly."
-  :group 'eldoc)
+handles it explicitly.")
 
 ;;; No user options below here.
 
@@ -182,8 +172,7 @@ area displays information about a function or variable in 
the
 text where point is.  If point is on a documented variable, it
 displays the first line of that variable's doc string.  Otherwise
 it displays the argument list of the function called in the
-expression point is on."
-  :group 'eldoc :lighter eldoc-minor-mode-string
+expression point is on." :lighter eldoc-minor-mode-string
   (setq eldoc-last-message nil)
   (cond
    ((not (eldoc--supported-p))
@@ -193,19 +182,18 @@ expression point is on."
    (eldoc-mode
     (when eldoc-print-after-edit
       (setq-local eldoc-message-commands (eldoc-edit-message-commands)))
-    (add-hook 'post-command-hook 'eldoc-schedule-timer nil t)
-    (add-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area nil t))
+    (add-hook 'post-command-hook #'eldoc-schedule-timer nil t)
+    (add-hook 'pre-command-hook #'eldoc-pre-command-refresh-echo-area nil t))
    (t
     (kill-local-variable 'eldoc-message-commands)
-    (remove-hook 'post-command-hook 'eldoc-schedule-timer t)
-    (remove-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area t)
+    (remove-hook 'post-command-hook #'eldoc-schedule-timer t)
+    (remove-hook 'pre-command-hook #'eldoc-pre-command-refresh-echo-area t)
     (when eldoc-timer
       (cancel-timer eldoc-timer)
       (setq eldoc-timer nil)))))
 
 ;;;###autoload
 (define-globalized-minor-mode global-eldoc-mode eldoc-mode turn-on-eldoc-mode
-  :group 'eldoc
   :initialize 'custom-initialize-delay
   :init-value t
   ;; For `read--expression', the usual global mode mechanism of
@@ -284,7 +272,7 @@ Otherwise work like `message'."
                 (when (stringp format-string)
                   (apply #'format-message format-string args)))
           (force-mode-line-update)))
-    (apply 'message format-string args)))
+    (apply #'message format-string args)))
 
 (defun eldoc-message (&optional string)
   "Display STRING as an ElDoc message if it's non-nil.
@@ -292,9 +280,7 @@ Otherwise work like `message'."
 Also store it in `eldoc-last-message' and return that value."
   (let ((omessage eldoc-last-message))
     (setq eldoc-last-message string)
-    ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages
-    ;; are recorded in a log.  Do not put eldoc messages in that log since
-    ;; they are Legion.
+    ;; Do not put eldoc messages in the log since they are Legion.
     ;; Emacs way of preventing log messages.
     (let ((message-log-max nil))
       (cond (eldoc-last-message
@@ -307,12 +293,15 @@ Also store it in `eldoc-last-message' and return that 
value."
   (and (symbolp command)
        (intern-soft (symbol-name command) eldoc-message-commands)))
 
-;; This function goes on pre-command-hook for XEmacs or when using idle
-;; timers in Emacs.  Motion commands clear the echo area for some reason,
+;; This function goes on pre-command-hook.
+;; Motion commands clear the echo area for some reason,
 ;; which make eldoc messages flicker or disappear just before motion
 ;; begins.  This function reprints the last eldoc message immediately
 ;; before the next command executes, which does away with the flicker.
 ;; This doesn't seem to be required for Emacs 19.28 and earlier.
+;; FIXME: The above comment suggests we don't really understand why
+;; this is needed.  Maybe it's not needed any more, but if it is
+;; we should figure out why.
 (defun eldoc-pre-command-refresh-echo-area ()
   "Reprint `eldoc-last-message' in the echo area."
   (and eldoc-last-message
@@ -385,7 +374,7 @@ Meant as a value for `eldoc-documentation-function'."
 (defcustom eldoc-documentation-function #'eldoc-documentation-default
   "Function to call to return doc string.
 The function of no args should return a one-line string for displaying
-doc about a function etc. appropriate to the context around point.
+doc about a function etc.  appropriate to the context around point.
 It should return nil if there's no doc appropriate for the context.
 Typically doc is returned if point is on a function-like name or in its
 arg list.
@@ -398,8 +387,7 @@ effect."
   :type '(radio (function-item eldoc-documentation-default)
                 (function-item eldoc-documentation-compose)
                 (function :tag "Other function"))
-  :version "28.1"
-  :group 'eldoc)
+  :version "28.1")
 
 (defun eldoc--supported-p ()
   "Non-nil if an ElDoc function is set for this buffer."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]