💥 Rename def-package! -> use-package!

Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
This commit is contained in:
Henrik Lissner 2019-07-23 12:44:03 +02:00
parent c795a988e6
commit 76cacb5bfe
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
110 changed files with 310 additions and 308 deletions

View file

@ -1,6 +1,6 @@
;;; tools/ansible/config.el -*- lexical-binding: t; -*-
(def-package! ansible
(use-package! ansible
:commands ansible-auto-decrypt-encrypt
:init
(put 'ansible-vault-password-file 'safe-local-variable #'stringp)
@ -16,7 +16,7 @@
(after! ansible-doc
(set-evil-initial-state! '(ansible-doc-module-mode) 'emacs))
(def-package! jinja2-mode
(use-package! jinja2-mode
:mode "\\.j2$")
(def-project-mode! +ansible-yaml-mode

View file

@ -20,7 +20,7 @@
;;
;;; Packages
(def-package! dap-mode
(use-package! dap-mode
:when (featurep! :tools lsp)
:hook (dap-mode . dap-ui-mode)
:after lsp-mode
@ -48,10 +48,10 @@
(require 'dap-edge)))))
(def-package! realgud
(use-package! realgud
:defer t
:init
(def-package! realgud-trepan-ni
(use-package! realgud-trepan-ni
:defer t
:init (add-to-list '+debugger--realgud-alist
'(realgud:trepan-ni :modes (javascript-mode js2-mode js3-mode)

View file

@ -7,7 +7,7 @@
"use" "rvm" "use_nix" "use_guix")
"TODO")
(def-package! direnv
(use-package! direnv
:after-call (after-find-file dired-initial-position-hook)
:config
(add-hook 'direnv-mode-hook

View file

@ -17,7 +17,7 @@
;; Handles whitespace (tabs/spaces) settings externally. This way projects can
;; specify their own formatting rules.
(def-package! editorconfig
(use-package! editorconfig
:after-call (doom-switch-buffer-hook after-find-file)
:config
(def-advice! +editorconfig-smart-detection-a (orig-fn)

View file

@ -8,7 +8,7 @@ errors.")
;;
;;; Packages
(def-package! flycheck
(use-package! flycheck
:commands flycheck-list-errors flycheck-buffer
:after-call doom-switch-buffer-hook after-find-file
:config
@ -34,7 +34,7 @@ Done to reduce the load flycheck imposes on the current buffer."
(global-flycheck-mode +1))
(def-package! flycheck-popup-tip
(use-package! flycheck-popup-tip
:commands flycheck-popup-tip-show-popup flycheck-popup-tip-delete-popup
:init (add-hook 'flycheck-mode-hook #'+flycheck-init-popups-h)
:config
@ -45,7 +45,7 @@ Done to reduce the load flycheck imposes on the current buffer."
(add-hook 'flycheck-posframe-inhibit-functions #'evil-insert-state-p)))
(def-package! flycheck-posframe
(use-package! flycheck-posframe
:when EMACS26+
:when (featurep! +childframe)
:defer t

View file

@ -71,7 +71,7 @@ e.g. proselint and langtool."
(add-hook 'flyspell-mode-hook #'+flyspell-init-predicate-h))
(def-package! flyspell-correct
(use-package! flyspell-correct
:commands flyspell-correct-word-generic flyspell-correct-previous-word-generic
:config
(cond ((and (featurep! :completion helm)

View file

@ -83,7 +83,7 @@ this list.")
;;
;;; dumb-jump
(def-package! dumb-jump
(use-package! dumb-jump
:commands dumb-jump-result-follow
:config
(setq dumb-jump-default-project doom-emacs-dir
@ -116,13 +116,13 @@ this list.")
;; Use `better-jumper' instead of xref's marker stack
(advice-add #'xref-push-marker-stack :around #'doom-set-jump-a)
(def-package! ivy-xref
(use-package! ivy-xref
:when (featurep! :completion ivy)
:config
(setq xref-show-xrefs-function #'ivy-xref-show-xrefs)
(set-popup-rule! "^\\*xref\\*$" :ignore t))
(def-package! helm-xref
(use-package! helm-xref
:when (featurep! :completion helm)
:config (setq xref-show-xrefs-function #'helm-xref-show-xrefs)))
@ -130,7 +130,7 @@ this list.")
;;
;;; Dash docset integration
(def-package! dash-docs
(use-package! dash-docs
:when (featurep! +docsets)
:init
(add-hook '+lookup-documentation-functions #'+lookup-dash-docsets-backend-fn)
@ -154,8 +154,8 @@ See https://github.com/magit/ghub/issues/81"
(let ((gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
(funcall orig-fn url)))
(def-package! helm-dash
(use-package! helm-dash
:when (featurep! :completion helm))
(def-package! counsel-dash
(use-package! counsel-dash
:when (featurep! :completion ivy)))

View file

@ -21,7 +21,7 @@
(add-hook! 'kill-emacs-hook (setq lsp-restart 'ignore)))
(def-package! lsp-ui
(use-package! lsp-ui
:hook (lsp-mode . lsp-ui-mode)
:init
(add-hook 'lsp-ui-mode-hook
@ -54,7 +54,7 @@
:references 'lsp-ui-peek-find-references))
(def-package! company-lsp
(use-package! company-lsp
:when (featurep! :completion company)
:defer t
:init

View file

@ -8,7 +8,7 @@ It is passed a user and repository name.")
;;
;; Packages
(def-package! magit
(use-package! magit
:commands magit-file-delete
:defer-incrementally (dash f s with-editor git-commit package eieio lv transient)
:init
@ -74,7 +74,7 @@ It is passed a user and repository name.")
(define-key transient-map [escape] #'transient-quit-one))
(def-package! forge
(use-package! forge
;; We defer loading even further because forge's dependencies will try to
;; compile emacsql, which is a slow and blocking operation.
:after-call magit-status
@ -103,7 +103,7 @@ ensure it is built when we actually use Forge."
(emacsql-sqlite-compile 2))))
(def-package! magit-todos
(use-package! magit-todos
:after magit
:config
(setq magit-todos-keyword-suffix "\\(?:([^)]+)\\)?:?") ; make colon optional
@ -114,11 +114,11 @@ ensure it is built when we actually use Forge."
(magit-todos-mode +1))
(def-package! magit-gitflow
(use-package! magit-gitflow
:hook (magit-mode . turn-on-magit-gitflow))
(def-package! evil-magit
(use-package! evil-magit
:when (featurep! :editor evil +everywhere)
:after magit
:init

View file

@ -1,6 +1,6 @@
;;; tools/pdf/config.el -*- lexical-binding: t; -*-
(def-package! pdf-tools
(use-package! pdf-tools
:mode ("\\.pdf\\'" . pdf-view-mode)
:config
(unless noninteractive

View file

@ -8,7 +8,7 @@
:desc "terraform plan" "p" (λ! (compile "terraform plan")))
(def-package! company-terraform
(use-package! company-terraform
:when (featurep! :completion company)
:after terraform-mode
:config

View file

@ -12,7 +12,7 @@
;; Note: `ssh-deploy-root-local' is optional, and will resort to
;; `doom-project-root' if unspecified.
(def-package! ssh-deploy
(use-package! ssh-deploy
:commands (ssh-deploy-upload-handler
ssh-deploy-upload-handler-forced
ssh-deploy-diff-handler