From f81a0e6f41191bb69a1fd8c61b8635cade098d4b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 15 Jun 2018 16:54:39 +0200 Subject: [PATCH] Remove redundant def-setting! docstrings def-setting! will now grab the autodef's docstring if it has an :obsolete property defined. --- core/autoload/os.el | 1 - core/core-modules.el | 8 ++++++- modules/completion/company/autoload.el | 3 --- modules/emacs/electric/autoload.el | 2 -- modules/feature/eval/autoload/settings.el | 13 ----------- modules/feature/evil/autoload/evil.el | 1 - modules/ui/popup/autoload/settings.el | 28 ----------------------- 7 files changed, 7 insertions(+), 49 deletions(-) diff --git a/core/autoload/os.el b/core/autoload/os.el index 871eea21d..c77c4eeb5 100644 --- a/core/autoload/os.el +++ b/core/autoload/os.el @@ -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))) diff --git a/core/core-modules.el b/core/core-modules.el index c6e7b0b55..18adaf511 100644 --- a/core/core-modules.el +++ b/core/core-modules.el @@ -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 diff --git a/modules/completion/company/autoload.el b/modules/completion/company/autoload.el index 9ab318d44..17809e849 100644 --- a/modules/completion/company/autoload.el +++ b/modules/completion/company/autoload.el @@ -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)) diff --git a/modules/emacs/electric/autoload.el b/modules/emacs/electric/autoload.el index 25b18b7b4..f10575145 100644 --- a/modules/emacs/electric/autoload.el +++ b/modules/emacs/electric/autoload.el @@ -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)) diff --git a/modules/feature/eval/autoload/settings.el b/modules/feature/eval/autoload/settings.el index 9f0cff8f7..2925c6ee6 100644 --- a/modules/feature/eval/autoload/settings.el +++ b/modules/feature/eval/autoload/settings.el @@ -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)) diff --git a/modules/feature/evil/autoload/evil.el b/modules/feature/evil/autoload/evil.el index 42fda391a..284e7b46b 100644 --- a/modules/feature/evil/autoload/evil.el +++ b/modules/feature/evil/autoload/evil.el @@ -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)) diff --git a/modules/ui/popup/autoload/settings.el b/modules/ui/popup/autoload/settings.el index 40ebdece0..9dbaf085f 100644 --- a/modules/ui/popup/autoload/settings.el +++ b/modules/ui/popup/autoload/settings.el @@ -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))