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.
This commit is contained in:
Stefan Kangas 2021-09-24 17:47:35 +02:00
parent f3a6fe2c7d
commit 8c3ec4e3cc
6 changed files with 32 additions and 24 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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" "")))))

View file

@ -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)))