Skip to content

Commit

Permalink
Drop `dash--docstring-add-signature'
Browse files Browse the repository at this point in the history
`help-add-fundoc-usage', from the pre-loaded `help' library, is more robust (it
properly handles quotes), so use that.
  • Loading branch information
nbfalcon committed Mar 11, 2021
1 parent e1e8f02 commit 5018e63
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions dash.el
Expand Up @@ -2397,15 +2397,6 @@ Return a list (DOCSTRING? DECLS REALBODY)."
(docstring? (and (stringp (car decls)) (pop decls))))
(list docstring? decls body)))

(defun dash--docstring-add-signature (docstring arglist)
"Add an ARGLIST signature to DOCSTRING.
If DOCSTRING already has a signature line, do nothing and return
it. If DOCSTRING is nil, make a docstring that only provides a
signature line."
(if (and docstring (string-match-p "\n\n(fn .*)\\'" docstring))
docstring
(format "%s\n\n%S" (or docstring "") (cons 'fn arglist))))

(defun dash--destructure-body (parsed-arglist body-forms &optional arglist)
"Destructure function ARGLIST using `-let'.
The result is a list of body forms (including optional docstring
Expand All @@ -2429,7 +2420,7 @@ PARSED-ARGLIST shall be the result of a call to
;; If there is a docstring, add signature hints in any case; otherwise,
;; only generate an empty signature docstring if DOC allows it.
(when (or docstring? arglist)
(list (dash--docstring-add-signature docstring? arglist)))
(list (help-add-fundoc-usage docstring? arglist)))
;; If the arglist doesn't make use of dash's features, just reuse the
;; docstring directly, because signature hints aren't necessary.
(and docstring? (list docstring?)))
Expand Down

0 comments on commit 5018e63

Please sign in to comment.