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

@ -3,7 +3,6 @@
;; FIXME obsolete :env
;;;###autoload
(def-setting! :env (&rest vars)
"TODO"
:obsolete set-env!
(when (featurep 'exec-path-from-shell)
`(exec-path-from-shell-copy-envs ,@vars)))

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

View file

@ -20,9 +20,6 @@ MODES should be one major-mode symbol or a list of them."
;; FIXME obsolete :company-backend
;;;###autoload
(def-setting! :company-backend (modes &rest backends)
"Prepends BACKENDS to `company-backends' in major MODES.
MODES should be one major-mode symbol or a list of them."
:obsolete set-company-backend!
`(set-company-backend! ,modes ,@backends))

View file

@ -21,7 +21,5 @@ trigger electric indentation."
;; FIXME obsolete :electric
;;;###autoload
(def-setting! :electric (modes &rest plist)
"Declare :words (list of strings) or :chars (lists of chars) in MODES that
trigger electric indentation."
:obsolete set-electric!
`(set-electric! ,modes ,@plist))

View file

@ -17,8 +17,6 @@ function that creates and returns the REPL buffer."
;; FIXME obsolete :repl
;;;###autoload
(def-setting! :repl (mode command)
"Define a REPL for a mode. MODE is a major mode symbol and COMMAND is a
function that creates and returns the REPL buffer."
:obsolete set-repl-handler!
`(push (cons ,mode ,command) +eval-repls))
@ -61,16 +59,5 @@ function that creates and returns the REPL buffer."
;; FIXME obsolete :eval
;;;###autoload
(def-setting! :eval (mode command)
"Define a code evaluator for major mode MODE with `quickrun'.
1. If MODE is a string and COMMAND is the string, MODE is a file regexp and
COMMAND is a string key for an entry in `quickrun-file-alist'.
2. If MODE is not a string and COMMAND is a string, MODE is a major-mode symbol
and COMMAND is a key (for `quickrun--language-alist'), and will be registered
in `quickrun--major-mode-alist'.
3. If MODE is not a string and COMMAND is an alist, see `quickrun-add-command':
(quickrun-add-command MODE COMMAND :mode MODE).
4. If MODE is not a string and COMMANd is a symbol, add it to
`+eval-runners', which is used by `+eval/region'."
:obsolete set-eval-handler!
`(set-eval-handler! ,mode ,command))

View file

@ -13,7 +13,6 @@
;; FIXME obsolete :evil-state
;;;###autoload
(def-setting! :evil-state (modes state)
"Set the initialize STATE of MODE using `evil-set-initial-state'."
:obsolete set-evil-initial-state!
`(set-evil-initial-state! ,modes ,state))

View file

@ -69,39 +69,11 @@ individual rule.
;; FIXME obsolete :popup
;;;###autoload
(def-setting! :popup (condition &optional alist parameters)
"Define a popup rule.
CONDITION can be a regexp string or a function.
For ALIST, see `display-buffer' and `display-buffer-alist' for a list of
possible entries, which instruct the display system how to initialize the popup
window.
ALIST also supports the `size' parameter, which will be translated to
`window-width' or `window-height' depending on `side'.
PARAMETERS is an alist of window parameters. See `+popup-window-parameters' for
a list of custom parameters provided by the popup module. If certain
attributes/parameters are omitted, the ones from `+popup-default-alist' and
`+popup-default-parameters' will be used.
The buffers of new windows displayed by `pop-to-buffer' and `display-buffer'
will be tested against CONDITION, which is either a) a regexp string (which is
matched against the buffer's name) or b) a function that takes no arguments and
returns a boolean.
See `def-popups!' for defining multiple rules in bulk."
:obsolete set-popup-rule!
`(set-popup-rule! ,condition ,alist ,parameters))
;; FIXME obsolete :popups
;;;###autoload
(def-setting! :popups (&rest rulesets)
"Define multiple popup rules. See `def-popup!' for the specifications of each
individual rule.
(set-popup-rules!
'((\"^ \\*\" ((slot . 1) (vslot . -1) (size . +popup-shrink-to-fit)))
(\"^\\*\" ((slot . 1) (vslot . -1)) ((select . t)))))"
:obsolete set-popup-rules!
`(set-popup-rules! ,@rulesets))