;; Create an override method to specify if a given tag belongs
;; to this type of decoration
(define-overloadable-function ,predicate (tag)
- ,(internal--format-docstring-line
- "Return non-nil to decorate TAG with `%s' style.\n%s"
- name doc))
+ ,(concat
+ (internal--format-docstring-line
+ "Return non-nil to decorate TAG with `%s' style."
+ name)
+ "\n" doc))
;; Create an override method that will perform the highlight
;; operation if the -p method returns non-nil.
(define-overloadable-function ,highlighter (tag)
(define-minor-mode ,global-mode
,(concat (format "Toggle %s in all buffers.\n" pretty-name)
(internal--format-docstring-line
- "With prefix ARG, enable %s if ARG is positive; otherwise, \
-disable it.\n\n"
+ (concat "With prefix ARG, enable %s if ARG is positive; "
+ "otherwise, disable it.")
pretty-global-name)
+ "\n\n"
"If called from Lisp, toggle the mode if ARG is `toggle'.
Enable the mode if ARG is nil, omitted, or is a positive number.
Disable the mode if ARG is a negative number.\n\n"
(internal--format-docstring-line
- "%s is enabled in all buffers where `%s' would do it.\n\n"
+ "%s is enabled in all buffers where `%s' would do it."
pretty-name turn-on)
+ "\n\n"
(internal--format-docstring-line
"See `%s' for more information on %s."
mode pretty-name)
(concat fst (internal--fill-string-single-line lst)))))
(defun internal--format-docstring-line (string &rest objects)
- "Format a documentation string out of STRING and OBJECTS.
+ "Format a single line from a documentation string out of STRING and OBJECTS.
+Signal an error if STRING contains a newline.
This is intended for internal use only."
+ (when (string-match "\n" string)
+ (error "Unable to fill string containing newline: %S" string))
(internal--fill-string-single-line (apply #'format string objects)))
(defun json-available-p ()