refactor: deprecate featurep! for modulep!

featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
This commit is contained in:
Henrik Lissner
2022-08-12 20:29:19 +02:00
parent 0407621aff
commit ad6a3d0f33
316 changed files with 1109 additions and 1103 deletions

View File

@ -1,5 +1,5 @@
;;; tools/lookup/autoload/docsets.el -*- lexical-binding: t; -*-
;;;###if (featurep! +docsets)
;;;###if (modulep! +docsets)
(defvar dash-docs-docsets nil)
@ -102,7 +102,7 @@ installed with `dash-docs-install-docset'."
(cl-remove-if-not #'dash-docs-docset-path (or docsets dash-docs-docsets))))
(query (doom-thing-at-point-or-region query)))
(doom-log "Searching docsets %s" dash-docs-docsets)
(cond ((featurep! :completion vertico)
(cond ((modulep! :completion vertico)
(dash-docs-initialize-debugging-buffer)
(dash-docs-create-buffer-connections)
(dash-docs-create-common-connections)
@ -118,9 +118,9 @@ installed with `dash-docs-install-docset'."
:initial query)
(user-error "Aborted"))))
(dash-docs-browse-url (cdr (assoc result (funcall sink nil))))))
((featurep! :completion ivy)
((modulep! :completion ivy)
(counsel-dash query))
((featurep! :completion helm)
((modulep! :completion helm)
(helm-dash query))
((user-error "No dash backend is installed, enable ivy or helm.")))))

View File

@ -1,5 +1,5 @@
;;; tools/lookup/autoload/evil.el -*- lexical-binding: t; -*-
;;;###if (featurep! :editor evil)
;;;###if (modulep! :editor evil)
;;;###autoload (autoload '+lookup:online "tools/lookup/autoload/evil" nil t)
(evil-define-command +lookup:online (query &optional bang)

View File

@ -240,13 +240,13 @@ Will return nil if neither is available. These require ripgrep to be installed."
(unless identifier
(let ((query (rxt-quote-pcre identifier)))
(ignore-errors
(cond ((featurep! :completion ivy)
(cond ((modulep! :completion ivy)
(+ivy-file-search :query query)
t)
((featurep! :completion helm)
((modulep! :completion helm)
(+helm-file-search :query query)
t)
((featurep! :completion vertico)
((modulep! :completion vertico)
(+vertico-file-search :query query)
t))))))
@ -278,10 +278,10 @@ otherwise falling back to ffap.el (find-file-at-point)."
(or (file-exists-p guess)
(ffap-url-p guess)))
(find-file-at-point guess))
((and (featurep! :completion ivy)
((and (modulep! :completion ivy)
(doom-project-p))
(counsel-file-jump guess (doom-project-root)))
((and (featurep! :completion vertico)
((and (modulep! :completion vertico)
(doom-project-p))
(+vertico/find-file-in (doom-project-root) guess))
((find-file-at-point (ffap-prompter guess))))

View File

@ -28,7 +28,7 @@
("Wolfram alpha" "https://wolframalpha.com/input/?i=%s")
("Wikipedia" "https://wikipedia.org/search-redirect.php?language=en&go=Go&search=%s")
("MDN" "https://developer.mozilla.org/en-US/search?q=%s"))
(when (featurep! :lang rust)
(when (modulep! :lang rust)
'(("Rust Docs" "https://doc.rust-lang.org/std/?search=%s"))))
"An alist that maps online resources to either:
@ -110,7 +110,7 @@ If the argument is interactive (satisfies `commandp'), it is called with
argument: the identifier at point. See `set-lookup-handlers!' about adding to
this list.")
(defvar +lookup-dictionary-prefer-offline (featurep! +offline)
(defvar +lookup-dictionary-prefer-offline (modulep! +offline)
"If non-nil, look up dictionaries online.
Setting this to nil will force it to use offline backends, which may be less
@ -132,8 +132,8 @@ Dictionary.app behind the scenes to get definitions.")
dumb-jump-prefer-searcher 'rg
dumb-jump-aggressive nil
dumb-jump-selector
(cond ((featurep! :completion ivy) 'ivy)
((featurep! :completion helm) 'helm)
(cond ((modulep! :completion ivy) 'ivy)
((modulep! :completion helm) 'helm)
('popup)))
(add-hook 'dumb-jump-after-jump-hook #'better-jumper-set-jump))
@ -157,12 +157,12 @@ Dictionary.app behind the scenes to get definitions.")
(funcall fn)))
;; This integration is already built into evil
(unless (featurep! :editor evil)
(unless (modulep! :editor evil)
;; Use `better-jumper' instead of xref's marker stack
(advice-add #'xref-push-marker-stack :around #'doom-set-jump-a))
(use-package! ivy-xref
:when (featurep! :completion ivy)
:when (modulep! :completion ivy)
:config
(set-popup-rule! "^\\*xref\\*$" :ignore t)
(setq xref-show-definitions-function #'ivy-xref-show-defs
@ -178,10 +178,10 @@ Dictionary.app behind the scenes to get definitions.")
(funcall fn fetcher alist)))
(use-package! helm-xref
:when (featurep! :completion helm))
:when (modulep! :completion helm))
(use-package! consult-xref
:when (featurep! :completion vertico)
:when (modulep! :completion vertico)
:defer t
:init
(setq xref-show-xrefs-function #'consult-xref
@ -192,7 +192,7 @@ Dictionary.app behind the scenes to get definitions.")
;;; Dash docset integration
(use-package! dash-docs
:when (featurep! +docsets)
:when (modulep! +docsets)
:defer t
:init
(add-hook '+lookup-documentation-functions #'+lookup-dash-docsets-backend-fn)
@ -202,9 +202,9 @@ Dictionary.app behind the scenes to get definitions.")
dash-docs-min-length 2
dash-docs-browser-func #'eww)
(cond ((featurep! :completion helm)
(cond ((modulep! :completion helm)
(require 'helm-dash nil t))
((featurep! :completion ivy)
((modulep! :completion ivy)
(require 'counsel-dash nil t))))
@ -212,7 +212,7 @@ Dictionary.app behind the scenes to get definitions.")
;;; Dictionary integration
(use-package! define-word
:when (featurep! +dictionary)
:when (modulep! +dictionary)
:unless IS-MAC
:defer t
:config

View File

@ -1,5 +1,5 @@
;;; tools/lookup/doctor.el -*- lexical-binding: t; -*-
(when (featurep! +docsets)
(when (modulep! +docsets)
(unless (executable-find "sqlite3")
(warn! "Couldn't find the sqlite3 executable. dash-docs will not work.")))

View File

@ -4,31 +4,31 @@
;; HACK `dumb-jump' uses the `helm-build-sync-source' macro, but this requires
;; helm be loaded before `dumb-jump' is byte-compiled during installation.
;; To ensure this, we declare helm before dumb-jump.
(when (featurep! :completion helm)
(when (modulep! :completion helm)
(package! helm))
;;
(package! dumb-jump :pin "1dd583011f4025b1b8c75fd785691851b6c5dfa3")
(when (featurep! :completion ivy)
(when (modulep! :completion ivy)
(package! ivy-xref :pin "a82e8e117d2dd62c28b6a3e3d6e4cfb11c0bda38"))
(when (featurep! :completion helm)
(when (modulep! :completion helm)
(package! helm-xref :pin "ea0e4ed8a9baf236e4085cbc7178241f109a53fa"))
;; For dictionary and online lookup
(package! request :pin "38ed1d2e64138eb16a9d8ed2987cff2e01b4a93b")
(when (featurep! +docsets)
(when (modulep! +docsets)
(package! dash-docs :pin "29848b6b347ac520f7646c200ed2ec36cea3feda")
(when (featurep! :completion helm)
(when (modulep! :completion helm)
(package! helm-dash :pin "7f853bd34da666f0e9a883011c80f451b06f6c59"))
(when (featurep! :completion ivy)
(when (modulep! :completion ivy)
(package! counsel-dash :pin "370d5f6f14b5294d0eb717f7b2a6a8e93df1ed24")))
(when (featurep! +dictionary)
(when (modulep! +dictionary)
(if IS-MAC
(package! osx-dictionary :pin "1a4479d9f44ef1e6e5f7643c172c32f6fe6cce21")
(package! define-word :pin "31a8c67405afa99d0e25e7c86a4ee7ef84a808fe")
(package! powerthesaurus :pin "88bc5229cba1604c8f74db0a1456d99259d538cc")
(when (featurep! +offline)
(when (modulep! +offline)
(package! wordnut :pin "feac531404041855312c1a046bde7ea18c674915")
(package! synosaurus :pin "14d34fc92a77c3a916b4d58400424c44ae99cd81"))))