Remove redundant def-setting! docstrings

def-setting! will now grab the autodef's docstring if it has an
:obsolete property defined.
This commit is contained in:
Henrik Lissner 2018-06-15 16:54:39 +02:00
parent 51aa60d67d
commit f81a0e6f41
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
7 changed files with 7 additions and 49 deletions

View file

@ -392,11 +392,17 @@ Do not use this for configuring Doom core."
(declare (indent defun) (doc-string 3))
(or (keywordp keyword)
(signal 'wrong-type-argument (list 'keywordp keyword)))
(unless (stringp docstring)
(push docstring forms)
(setq docstring nil))
(let ((alias (plist-get forms :obsolete)))
(when alias
(setq forms (plist-put forms :obsolete 'nil)))
`(fset ',(intern (format "doom--set%s" keyword))
(lambda ,arglist ,docstring
(lambda ,arglist
,(if (and (not docstring) (fboundp alias))
(documentation alias t)
docstring)
(prog1 (progn ,@forms)
,(when alias
`(unless noninteractive