emacs-diffs
[Top][All Lists]
Advanced

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

scratch/bug-44858 e4fd496 4/6: Fill some auto-generated docstring lines


From: Stefan Kangas
Subject: scratch/bug-44858 e4fd496 4/6: Fill some auto-generated docstring lines
Date: Fri, 24 Sep 2021 13:19:52 -0400 (EDT)

branch: scratch/bug-44858
commit e4fd4962ac1847390ed4ac59144ffc53254e7078
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Fill some auto-generated docstring lines
    
    * lisp/cedet/mode-local.el (define-mode-local-override):
    * lisp/cedet/semantic/decorate/mode.el (define-semantic-decoration-style):
    * lisp/cedet/semantic/idle.el (define-semantic-idle-service):
    * lisp/emacs-lisp/derived.el (derived-mode-make-docstring):
    * lisp/emacs-lisp/eieio.el (defclass): Fill auto-generated docstring
    lines.
---
 lisp/cedet/mode-local.el             |  9 +++++----
 lisp/cedet/semantic/decorate/mode.el |  5 +++--
 lisp/cedet/semantic/idle.el          | 14 ++++++++------
 lisp/emacs-lisp/cl-macs.el           |  7 ++++---
 lisp/emacs-lisp/derived.el           | 16 +++++++++-------
 lisp/emacs-lisp/eieio.el             |  5 +++--
 6 files changed, 32 insertions(+), 24 deletions(-)

diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el
index 02d69a1..18fb05e 100644
--- a/lisp/cedet/mode-local.el
+++ b/lisp/cedet/mode-local.el
@@ -600,16 +600,17 @@ BODY is the implementation of this function."
     `(progn
        (eval-and-compile
         (defun ,newname ,args
-          ,(format "%s\n\nOverride %s in `%s' buffers."
-                   docstring name mode)
+           ,(concat docstring "\n"
+                    (internal--format-docstring-line
+                     "Override `%s' in `%s' buffers."
+                     name mode))
           ;; The body for this implementation
           ,@body)
          ;; For find-func to locate the definition of NEWNAME.
          (put ',newname 'definition-name ',name))
        (mode-local-bind '((,name . ,newname))
                         '(override-flag t)
-                        ',mode))
-    ))
+                        ',mode))))
 
 ;;; Read/Query Support
 (defun mode-local-read-function (prompt &optional initial hist default)
diff --git a/lisp/cedet/semantic/decorate/mode.el 
b/lisp/cedet/semantic/decorate/mode.el
index c6bf152..2763410 100644
--- a/lisp/cedet/semantic/decorate/mode.el
+++ b/lisp/cedet/semantic/decorate/mode.el
@@ -409,8 +409,9 @@ decoration API found in this library."
        ;; Create an override method to specify if a given tag belongs
        ;; to this type of decoration
        (define-overloadable-function ,predicate (tag)
-         ,(format "Return non-nil to decorate TAG with `%s' style.\n%s"
-                  name doc))
+         ,(internal--format-docstring-line
+           "Return non-nil to decorate TAG with `%s' style.\n%s"
+           name doc))
        ;; Create an override method that will perform the highlight
        ;; operation if the -p method returns non-nil.
        (define-overloadable-function ,highlighter (tag)
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index b1805f7..a149944 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -577,10 +577,11 @@ This routine creates the following functions and 
variables:"
     `(progn
        (define-minor-mode ,global
         ,(concat "Toggle " (symbol-name global) ".
-With ARG, turn the minor mode on if ARG is positive, off otherwise.
-
-When this minor mode is enabled, `" (symbol-name mode) "' is
-turned on in every Semantic-supported buffer.")
+With ARG, turn the minor mode on if ARG is positive, off otherwise.\n\n"
+                  (internal--format-docstring-line
+                   "When this minor mode is enabled, `%s' is \
+turned on in every Semantic-supported buffer."
+                   (symbol-name mode)))
          :global t
         :group 'semantic
         :group 'semantic-modes
@@ -618,8 +619,9 @@ turned on in every Semantic-supported buffer.")
                                "")     ; idle schedulers are quiet?
 
        (defun ,func ()
-        ,(concat "Perform idle activity for the minor mode `"
-                 (symbol-name mode) "'.")
+         ,(internal--format-docstring-line
+           "Perform idle activity for the minor mode `%s'."
+           (symbol-name mode))
         ,@forms))))
 
 ;;; SUMMARY MODE
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 6d6482c..833c1d1 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -3083,9 +3083,10 @@ Supported keywords for slots are:
              ;; The arg "cl-x" is referenced by name in eg pred-form
              ;; and pred-check, so changing it is not straightforward.
              (push `(,defsym ,accessor (cl-x)
-                       ,(format "Access slot \"%s\" of `%s' struct CL-X.%s"
-                                slot name
-                                (if doc (concat "\n" doc) ""))
+                       ,(internal--format-docstring-line
+                         "Access slot \"%s\" of `%s' struct CL-X.%s"
+                         slot name
+                         (if doc (concat "\n" doc) ""))
                        (declare (side-effect-free t))
                        ,access-body)
                     forms)
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 5e9644d..31a3a92 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -321,7 +321,7 @@ No problems result if this variable is not bound.
              (format "Major mode derived from `%s' by `define-derived-mode'.
 It inherits all of the parent's attributes, but has its own keymap%s:
 
-  `%s'%s
+%s
 
 which more-or-less shadow%s %s's corresponding table%s."
                      parent
@@ -330,12 +330,14 @@ which more-or-less shadow%s %s's corresponding table%s."
                            (abbrev "\nand abbrev table")
                            (syntax "\nand syntax table")
                            (t ""))
-                     map
-                     (cond ((and abbrev syntax)
-                            (format ", `%s' and `%s'" abbrev syntax))
-                           ((or abbrev syntax)
-                            (format " and `%s'" (or abbrev syntax)))
-                           (t ""))
+                      (internal--format-docstring-line
+                       "  `%s'%s"
+                       map
+                       (cond ((and abbrev syntax)
+                              (format ", `%s' and `%s'" abbrev syntax))
+                             ((or abbrev syntax)
+                              (format " and `%s'" (or abbrev syntax)))
+                             (t "")))
                      (if (or abbrev syntax) "" "s")
                      parent
                      (if (or abbrev syntax) "s" "")))))
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index c16d8e1..2dc3e0a 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -205,7 +205,7 @@ and reference them using the function `class-option'."
                    (eieio-oset this ',sname value))
                 accessors)
           (push `(cl-defmethod ,acces ((this ,name))
-                   ,(format
+                   ,(internal--format-docstring-line
                      "Retrieve the slot `%S' from an object of class `%S'."
                      sname name)
                    ;; FIXME: Why is this different from the :reader case?
@@ -285,7 +285,8 @@ This method is obsolete."
 
           ;; Non-abstract classes need a constructor.
           `(defun ,name (&rest slots)
-             ,(format "Create a new object of class type `%S'." name)
+             ,(internal--format-docstring-line
+               "Create a new object of class type `%S'." name)
              (declare (compiler-macro
                        (lambda (whole)
                          (if (not (stringp (car slots)))



reply via email to

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