Revert macros to ...! name convention (elisp doesn't like @...)
This commit is contained in:
parent
b64d5554e3
commit
33c88d4f82
125 changed files with 877 additions and 880 deletions
|
@ -22,7 +22,7 @@
|
|||
(puthash args (apply ',func args) doom-memoized-table))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro @def-memoized (name arglist &rest body)
|
||||
(defmacro def-memoized! (name arglist &rest body)
|
||||
"Create a memoize'd function. NAME, ARGLIST, DOCSTRING and BODY
|
||||
have the same meaning as in `defun'."
|
||||
(declare (indent defun) (doc-string 3))
|
||||
|
|
|
@ -9,15 +9,15 @@
|
|||
;; regular plists.
|
||||
;;
|
||||
;; (let ((a '(abc :commands 1 :config 3 4 5)))
|
||||
;; (@mplist a &delete :commands :config))
|
||||
;; (mplist! a &delete :commands :config))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro @mplist (var action &rest args)
|
||||
(defmacro mplist! (var action &rest args)
|
||||
"A helper macro that makes dealing with doom-mplist-* functions a little more concise.
|
||||
|
||||
Examples:
|
||||
(@mplist plist &delete :x :y)
|
||||
(@mplist plist &get :x)"
|
||||
(mplist! plist &delete :x :y)
|
||||
(mplist! plist &get :x)"
|
||||
(declare (indent defun))
|
||||
(let ((fn-sym (intern (format "doom-mplist-%s" (substring (symbol-name action) 1)))))
|
||||
(when (fboundp fn-sym)
|
||||
|
|
|
@ -102,7 +102,7 @@ Used by `doom/packages-autoremove'."
|
|||
(defun doom-get-missing-packages ()
|
||||
"Return a list of requested packages that aren't installed or built-in. Each
|
||||
element is a list whose CAR is the package symbol, and whose CDR is a plist
|
||||
taken from that package's `@package' declaration.
|
||||
taken from that package's `package!' declaration.
|
||||
|
||||
Used by `doom/packages-install'."
|
||||
(cl-remove-if (lambda (pkgsym)
|
||||
|
|
|
@ -55,10 +55,10 @@
|
|||
recentf-max-menu-items 0
|
||||
recentf-max-saved-items 250
|
||||
recentf-filename-handlers '(abbreviate-file-name))
|
||||
(@quiet (recentf-mode 1))
|
||||
(quiet! (recentf-mode 1))
|
||||
|
||||
;; Ediff
|
||||
(@add-hook ediff-load
|
||||
(add-hook! ediff-load
|
||||
(setq ediff-diff-options "-w"
|
||||
ediff-split-window-function 'split-window-horizontally
|
||||
ediff-window-setup-function 'ediff-setup-windows-plain)) ; no extra frames
|
||||
|
@ -85,15 +85,15 @@
|
|||
|
||||
;; Handles whitespace (tabs/spaces) settings externally. This way projects can
|
||||
;; specify their own formatting rules.
|
||||
(@def-package editorconfig :demand t
|
||||
(def-package! editorconfig :demand t
|
||||
:mode ("\\.?editorconfig$" . editorconfig-conf-mode)
|
||||
:config (editorconfig-mode +1)
|
||||
;; Show whitespace in tabs indentation mode
|
||||
(@add-hook 'editorconfig-custom-hooks
|
||||
(add-hook! 'editorconfig-custom-hooks
|
||||
(if indent-tabs-mode (whitespace-mode +1))))
|
||||
|
||||
;; Auto-close delimiters and blocks as you type
|
||||
(@def-package smartparens :demand t
|
||||
(def-package! smartparens :demand t
|
||||
:init
|
||||
(setq sp-autowrap-region nil ; let evil-surround handle this
|
||||
sp-highlight-pair-overlay nil
|
||||
|
@ -129,49 +129,49 @@
|
|||
;; Autoloaded Plugins
|
||||
;;
|
||||
|
||||
(@def-package ace-link
|
||||
(def-package! ace-link
|
||||
:commands (ace-link-help ace-link-org))
|
||||
|
||||
(@def-package ace-window
|
||||
(def-package! ace-window
|
||||
:commands ace-window
|
||||
:config
|
||||
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
|
||||
aw-scope 'frame
|
||||
aw-background t))
|
||||
|
||||
(@def-package avy
|
||||
(def-package! avy
|
||||
:commands (avy-goto-char-2 avy-goto-line)
|
||||
:config
|
||||
(setq avy-all-windows nil
|
||||
avy-background t))
|
||||
|
||||
(@def-package command-log-mode
|
||||
(def-package! command-log-mode
|
||||
:commands (command-log-mode global-command-log-mode)
|
||||
:config
|
||||
(@set :popup "*command-log*" :size 40 :align 'right :noselect t)
|
||||
(set! :popup "*command-log*" :size 40 :align 'right :noselect t)
|
||||
(setq command-log-mode-auto-show t
|
||||
command-log-mode-open-log-turns-on-mode t))
|
||||
|
||||
(@def-package expand-region
|
||||
(def-package! expand-region
|
||||
:commands (er/expand-region er/contract-region er/mark-symbol er/mark-word))
|
||||
|
||||
(@def-package goto-last-change :commands goto-last-change)
|
||||
(def-package! goto-last-change :commands goto-last-change)
|
||||
|
||||
(@def-package help-fns+ ; Improved help commands
|
||||
(def-package! help-fns+ ; Improved help commands
|
||||
:commands (describe-buffer describe-command describe-file
|
||||
describe-keymap describe-option describe-option-of-type))
|
||||
|
||||
(@def-package imenu-anywhere
|
||||
(def-package! imenu-anywhere
|
||||
:commands (ido-imenu-anywhere ivy-imenu-anywhere helm-imenu-anywhere))
|
||||
|
||||
(@def-package imenu-list :commands imenu-list-minor-mode)
|
||||
(def-package! imenu-list :commands imenu-list-minor-mode)
|
||||
|
||||
(@def-package pcre2el :commands rxt-quote-pcre)
|
||||
(def-package! pcre2el :commands rxt-quote-pcre)
|
||||
|
||||
(@def-package smart-forward
|
||||
(def-package! smart-forward
|
||||
:commands (smart-up smart-down smart-backward smart-forward))
|
||||
|
||||
(@def-package wgrep
|
||||
(def-package! wgrep
|
||||
:commands (wgrep-setup wgrep-change-to-wgrep-mode)
|
||||
:config
|
||||
(setq wgrep-auto-save-buffer t)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
(defvar doom--which-key-defs '(nil))
|
||||
|
||||
|
||||
(@def-package which-key
|
||||
(def-package! which-key
|
||||
:defer 1
|
||||
:config
|
||||
(setq which-key-sort-order 'which-key-prefix-then-key-order
|
||||
|
@ -50,7 +50,7 @@
|
|||
state))
|
||||
(split-string (substring (symbol-name keyword) 1) "" t)))))
|
||||
|
||||
;; Register keywords for proper indentation (see `@map')
|
||||
;; Register keywords for proper indentation (see `map!')
|
||||
(put ':prefix 'lisp-indent-function 'defun)
|
||||
(put ':map 'lisp-indent-function 'defun)
|
||||
(put ':map* 'lisp-indent-function 'defun)
|
||||
|
@ -59,7 +59,7 @@
|
|||
(put ':unless 'lisp-indent-function 'defun)
|
||||
(put ':desc 'lisp-indent-function 'defun)
|
||||
|
||||
(defmacro @map (&rest rest)
|
||||
(defmacro map! (&rest rest)
|
||||
"A nightmare of a key-binding macro that will use `evil-define-key*',
|
||||
`define-key', `local-set-key' and `global-set-key' depending on context and
|
||||
plist key flags (and whether evil is loaded or not). It was designed to make
|
||||
|
@ -96,7 +96,7 @@ Conditional keybinds
|
|||
(:unless [CONDITION] [...])
|
||||
|
||||
Example
|
||||
(@map :map magit-mode-map
|
||||
(map! :map magit-mode-map
|
||||
:m \"C-r\" 'do-something ; assign C-r in motion state
|
||||
:nv \"q\" 'magit-mode-quit-window ; assign to 'q' in normal and visual states
|
||||
\"C-x C-r\" 'a-global-keybind
|
||||
|
@ -113,7 +113,7 @@ Example
|
|||
(cond
|
||||
;; it's a sub expr
|
||||
((listp key)
|
||||
(push (macroexpand `(@map ,@key)) forms))
|
||||
(push (macroexpand `(map! ,@key)) forms))
|
||||
|
||||
;; it's a flag
|
||||
((keywordp key)
|
||||
|
@ -126,9 +126,9 @@ Example
|
|||
(setq key :prefix
|
||||
desc "<localleader>")))
|
||||
(pcase key
|
||||
(:when (prog1 `((if ,(pop rest) ,(macroexpand `(@map ,@rest)))) (setq rest '())))
|
||||
(:unless (prog1 `((if (not ,(pop rest)) ,(macroexpand `(@map ,@rest)))) (setq rest '())))
|
||||
(:after (prog1 `((@after ,(pop rest) ,(macroexpand `(@map ,@rest)))) (setq rest '())))
|
||||
(:when (prog1 `((if ,(pop rest) ,(macroexpand `(map! ,@rest)))) (setq rest '())))
|
||||
(:unless (prog1 `((if (not ,(pop rest)) ,(macroexpand `(map! ,@rest)))) (setq rest '())))
|
||||
(:after (prog1 `((after! ,(pop rest) ,(macroexpand `(map! ,@rest)))) (setq rest '())))
|
||||
(:desc (setq desc (pop rest)))
|
||||
(:map* (setq defer t) (push :map rest))
|
||||
(:map
|
||||
|
@ -166,7 +166,7 @@ Example
|
|||
(when prefix
|
||||
(setq key (append prefix (list key))))
|
||||
(unless (> (length rest) 0)
|
||||
(user-error "@map has no definition for %s key" key))
|
||||
(user-error "map! has no definition for %s key" key))
|
||||
(setq def (pop rest))
|
||||
(when desc
|
||||
(push `(nconc doom--which-key-defs (list ,(key-description (eval key)) ,desc))
|
||||
|
|
|
@ -42,12 +42,12 @@
|
|||
;; Library
|
||||
;;
|
||||
|
||||
(defmacro @λ (&rest body)
|
||||
(defmacro λ! (&rest body)
|
||||
"A shortcut for inline interactive lambdas."
|
||||
(declare (doc-string 1))
|
||||
`(lambda () (interactive) ,@body))
|
||||
|
||||
(defmacro @after (feature &rest forms)
|
||||
(defmacro after! (feature &rest forms)
|
||||
"A smart wrapper around `with-eval-after-load'. Supresses warnings during
|
||||
compilation."
|
||||
(declare (indent defun) (debug t))
|
||||
|
@ -60,7 +60,7 @@ compilation."
|
|||
'with-no-warnings)
|
||||
(with-eval-after-load ',feature ,@forms)))
|
||||
|
||||
(defmacro @quiet (&rest forms)
|
||||
(defmacro quiet! (&rest forms)
|
||||
"Run FORMS without making any noise."
|
||||
`(if doom-debug-mode
|
||||
(progn ,@forms)
|
||||
|
@ -77,7 +77,7 @@ compilation."
|
|||
(save-silently t))
|
||||
,@forms)))
|
||||
|
||||
(defmacro @add-hook (hook &rest func-or-forms)
|
||||
(defmacro add-hook! (hook &rest func-or-forms)
|
||||
"A convenience macro for `add-hook'.
|
||||
|
||||
HOOK can be one hook or a list of hooks. If the hook(s) are not quoted, -hook is
|
||||
|
@ -88,14 +88,14 @@ will be wrapped in a lambda. A list of symbols will expand into a series of
|
|||
add-hook calls.
|
||||
|
||||
Examples:
|
||||
(@add-hook 'some-mode-hook 'enable-something)
|
||||
(@add-hook some-mode '(enable-something and-another))
|
||||
(@add-hook '(one-mode-hook second-mode-hook) 'enable-something)
|
||||
(@add-hook (one-mode second-mode) 'enable-something)
|
||||
(@add-hook (one-mode second-mode) (setq v 5) (setq a 2))"
|
||||
(add-hook! 'some-mode-hook 'enable-something)
|
||||
(add-hook! some-mode '(enable-something and-another))
|
||||
(add-hook! '(one-mode-hook second-mode-hook) 'enable-something)
|
||||
(add-hook! (one-mode second-mode) 'enable-something)
|
||||
(add-hook! (one-mode second-mode) (setq v 5) (setq a 2))"
|
||||
(declare (indent defun) (debug t))
|
||||
(unless func-or-forms
|
||||
(error "@add-hook: FUNC-OR-FORMS is empty"))
|
||||
(error "add-hook!: FUNC-OR-FORMS is empty"))
|
||||
(let* ((val (car func-or-forms))
|
||||
(quoted-p (eq (car-safe hook) 'quote))
|
||||
(hook (if quoted-p (cadr hook) hook))
|
||||
|
@ -113,7 +113,7 @@ Examples:
|
|||
forms)))
|
||||
`(progn ,@(reverse forms))))
|
||||
|
||||
(defmacro @associate (mode &rest plist)
|
||||
(defmacro associate! (mode &rest plist)
|
||||
"Associate a major or minor mode to certain patterns and project files."
|
||||
(declare (indent 1))
|
||||
(unless noninteractive
|
||||
|
@ -126,7 +126,7 @@ Examples:
|
|||
(when (and files
|
||||
(not (or (listp files)
|
||||
(stringp files))))
|
||||
(user-error "@associate :files expects a string or list of strings"))
|
||||
(user-error "associate! :files expects a string or list of strings"))
|
||||
(let ((hook-name (intern (format "doom--init-mode-%s" mode))))
|
||||
(macroexp-progn
|
||||
(list `(defun ,hook-name ()
|
||||
|
@ -146,21 +146,21 @@ Examples:
|
|||
(match
|
||||
`(add-to-list ',(if minor 'doom-auto-minor-mode-alist 'auto-mode-alist)
|
||||
(cons ,match ',mode)))
|
||||
(t (user-error "@associate invalid rules for mode [%s] (in %s) (match %s) (files %s)"
|
||||
(t (user-error "associate! invalid rules for mode [%s] (in %s) (match %s) (files %s)"
|
||||
mode in match files))))))
|
||||
|
||||
|
||||
;; Provides a centralized configuration system that a) won't evaluate its
|
||||
;; arguments if it doesn't need to (performance), b) won't complain if the
|
||||
;; setting doesn't exist and c) is more elegant than a bunch of `@after' blocks,
|
||||
;; setting doesn't exist and c) is more elegant than a bunch of `after!' blocks,
|
||||
;; which can cause intermittent stuttering in large quantities. I'm a fan of
|
||||
;; concise, do-what-I-mean front-facing configuration, believe it or not.
|
||||
;;
|
||||
;; Plus, it can benefit from byte-compilation.
|
||||
|
||||
(defmacro @def-setting (keyword arglist &optional docstring &rest forms)
|
||||
(defmacro def-setting! (keyword arglist &optional docstring &rest forms)
|
||||
"Define a setting macro. Like `defmacro', this should return a form to be
|
||||
executed when called with `@set'. FORMS are not evaluated until `@set' calls it."
|
||||
executed when called with `set!'. FORMS are not evaluated until `set!' calls it."
|
||||
(declare (indent defun) (doc-string 3))
|
||||
(unless (keywordp keyword)
|
||||
(error "Not a valid property name: %s" keyword))
|
||||
|
@ -168,11 +168,11 @@ executed when called with `@set'. FORMS are not evaluated until `@set' calls it.
|
|||
,docstring
|
||||
,@forms))
|
||||
|
||||
(defmacro @set (keyword &rest values)
|
||||
"Set an option defined by `@def-setting'. Skip if doesn't exist."
|
||||
(defmacro set! (keyword &rest values)
|
||||
"Set an option defined by `def-setting!'. Skip if doesn't exist."
|
||||
(declare (indent defun))
|
||||
(unless values
|
||||
(error "Empty @set for %s" keyword))
|
||||
(error "Empty set! for %s" keyword))
|
||||
(let ((fn (intern (format "doom-setting--setter%s" keyword))))
|
||||
(if (functionp fn)
|
||||
(apply fn (eval `(list ,@values)))
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
(when (require 'osx-clipboard nil t)
|
||||
(osx-clipboard-mode +1))))
|
||||
|
||||
(@after evil
|
||||
(after! evil
|
||||
;; On OSX, stop copying each visual state move to the clipboard:
|
||||
;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on
|
||||
;; Most of this code grokked from:
|
||||
|
|
|
@ -51,7 +51,7 @@ This will be nil if you have byte-compiled your configuration (as intended).")
|
|||
(defvar doom-packages nil
|
||||
"A list of enabled packages. Each element is a sublist, whose CAR is the
|
||||
package's name as a symbol, and whose CDR is the plist supplied to its
|
||||
`@package' declaration. Set by `doom-initialize-packages'.")
|
||||
`package!' declaration. Set by `doom-initialize-packages'.")
|
||||
|
||||
(defvar doom-protected-packages
|
||||
'(persistent-soft quelpa use-package)
|
||||
|
@ -65,7 +65,7 @@ missing) and shouldn't be deleted.")
|
|||
(append (list doom-core-dir doom-modules-dir)
|
||||
load-path)
|
||||
"A backup of `load-path' before it was altered by `doom-initialize'. Used as a
|
||||
base when running `doom/reload', or by `@doom', for calculating how many
|
||||
base when running `doom/reload', or by `doom!', for calculating how many
|
||||
packages exist.")
|
||||
|
||||
(setq load-prefer-newer nil
|
||||
|
@ -150,7 +150,7 @@ to speed up startup."
|
|||
"Ensures that `doom-autoload-file' exists and is loaded. Otherwise run
|
||||
`doom/reload-autoloads' to generate it."
|
||||
(unless (file-exists-p doom-autoload-file)
|
||||
(@quiet (doom/reload-autoloads))))
|
||||
(quiet! (doom/reload-autoloads))))
|
||||
|
||||
(defun doom-initialize-packages (&optional force-p load-p)
|
||||
"Crawls across your emacs.d in order to fill `doom-modules' (from init.el) and
|
||||
|
@ -189,7 +189,7 @@ files."
|
|||
(cond ((keywordp m)
|
||||
(setq mode m))
|
||||
((not mode)
|
||||
(error "No namespace specified on `@doom' for %s" m))
|
||||
(error "No namespace specified on `doom!' for %s" m))
|
||||
((eq m '*)
|
||||
(doom-initialize-modules
|
||||
(cons mode
|
||||
|
@ -243,7 +243,7 @@ the file exists."
|
|||
FORCE-P is non-nil). MODULE is a keyword, SUBMODULE is a symbol. e.g. :lang
|
||||
'emacs-lisp.
|
||||
|
||||
Used by `@require' and `@depends-on'."
|
||||
Used by `require!' and `depends-on!'."
|
||||
(unless (or force-p (doom-module-loaded-p module submodule))
|
||||
(puthash (cons module submodule) t doom-modules)))
|
||||
|
||||
|
@ -259,7 +259,7 @@ Used by `@require' and `@depends-on'."
|
|||
|
||||
(autoload 'use-package "use-package" nil nil 'macro)
|
||||
|
||||
(defmacro @doom (&rest modules)
|
||||
(defmacro doom! (&rest modules)
|
||||
"DOOM Emacs bootstrap macro. List the modules to load. Benefits from
|
||||
byte-compilation."
|
||||
(doom-initialize-modules modules)
|
||||
|
@ -267,7 +267,7 @@ byte-compilation."
|
|||
(setq doom-modules ',doom-modules)
|
||||
|
||||
(unless noninteractive
|
||||
,@(mapcar (lambda (module) `(@require ,(car module) ,(cdr module) t))
|
||||
,@(mapcar (lambda (module) `(require! ,(car module) ,(cdr module) t))
|
||||
(doom--module-pairs))
|
||||
|
||||
(when (display-graphic-p)
|
||||
|
@ -278,15 +278,15 @@ byte-compilation."
|
|||
;; Benchmark
|
||||
(add-hook 'after-init-hook 'doom--display-benchmark t))))
|
||||
|
||||
(defmacro @def-package (name &rest plist)
|
||||
(defmacro def-package! (name &rest plist)
|
||||
"Defines and configures a package using `use-package'. Packages are deferred
|
||||
by default. If the package isn't installed or loaded, `@def-package' is
|
||||
by default. If the package isn't installed or loaded, `def-package!' is
|
||||
ignored."
|
||||
(when (or (featurep name)
|
||||
(package-installed-p name))
|
||||
`(use-package ,name ,@plist)))
|
||||
|
||||
(defmacro @load (filesym &optional path noerror)
|
||||
(defmacro load! (filesym &optional path noerror)
|
||||
"Loads a file relative to the current module (or PATH). FILESYM is a file path
|
||||
as a symbol. PATH is a directory to prefix it with. If NOERROR is non-nil, don't
|
||||
throw an error if the file doesn't exist."
|
||||
|
@ -304,9 +304,9 @@ throw an error if the file doesn't exist."
|
|||
(if (file-exists-p file)
|
||||
`(load ,(file-name-sans-extension file) ,noerror (not doom-debug-mode))
|
||||
(unless noerror
|
||||
(error "Could not @load file %s" file))))))
|
||||
(error "Could not load! file %s" file))))))
|
||||
|
||||
(defmacro @require (module submodule &optional reload-p)
|
||||
(defmacro require! (module submodule &optional reload-p)
|
||||
"Like `require', but for doom modules. Will load a module's config.el file if
|
||||
it hasn't already, and if it exists."
|
||||
(when (or (not noninteractive)
|
||||
|
@ -315,9 +315,9 @@ it hasn't already, and if it exists."
|
|||
(when (or reload-p (not loaded-p))
|
||||
(unless loaded-p
|
||||
(doom--enable-module module submodule t))
|
||||
`(@load config ,(doom-module-path module submodule) t)))))
|
||||
`(load! config ,(doom-module-path module submodule) t)))))
|
||||
|
||||
(defmacro @featurep (module submodule)
|
||||
(defmacro featurep! (module submodule)
|
||||
"Convenience macro that wraps `doom-module-loaded-p'."
|
||||
`(doom-module-loaded-p ,module ',submodule))
|
||||
|
||||
|
@ -326,7 +326,7 @@ it hasn't already, and if it exists."
|
|||
;; Declarative macros
|
||||
;;
|
||||
|
||||
(defmacro @package (name &rest plist)
|
||||
(defmacro package! (name &rest plist)
|
||||
"Declares a package and how to install it (if applicable). This does not load
|
||||
nor install them.
|
||||
|
||||
|
@ -359,11 +359,11 @@ them."
|
|||
(assq-delete-all ',name doom-packages))
|
||||
(push ',(cons name plist) doom-packages))))
|
||||
|
||||
(defmacro @depends-on (module submodule)
|
||||
(defmacro depends-on! (module submodule)
|
||||
"Declares that this module depends on another. MODULE is a keyword, and
|
||||
SUBMODULE is a symbol."
|
||||
(doom--enable-module module submodule)
|
||||
`(@load packages ,(doom-module-path module submodule) t))
|
||||
`(load! packages ,(doom-module-path module submodule) t))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -402,7 +402,7 @@ the commandline."
|
|||
;; Make evil.el autoload files a special case; don't load them
|
||||
;; unless evil is enabled.
|
||||
(unless (and (equal (file-name-nondirectory file) "evil.el")
|
||||
(not (@featurep :feature evil)))
|
||||
(not (featurep! :feature evil)))
|
||||
(push file autoload-files)))
|
||||
(file-expand-wildcards (expand-file-name "*.el" auto-dir) t)))))
|
||||
(when (file-exists-p generated-autoload-file)
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
"A list of window parameters that are set (and cleared) when `doom-popup-mode
|
||||
is enabled/disabled.'")
|
||||
|
||||
(@def-setting :popup (&rest rules)
|
||||
(def-setting! :popup (&rest rules)
|
||||
"Prepend a new popup rule to `shackle-rules'."
|
||||
(if (cl-every 'listp rules)
|
||||
`(nconc shackle-rules ',rules)
|
||||
|
@ -49,7 +49,7 @@ is enabled/disabled.'")
|
|||
;; Bootstrap
|
||||
;;
|
||||
|
||||
(@def-package shackle :demand t
|
||||
(def-package! shackle :demand t
|
||||
:init
|
||||
(setq shackle-default-alignment 'below
|
||||
;;; Baseline popup-window rules
|
||||
|
@ -146,7 +146,7 @@ for :align t on every rule."
|
|||
(set-window-parameter window param nil))))))
|
||||
|
||||
;; Hide modeline in completion popups
|
||||
(@add-hook (completion-in-region-mode completion-list-mode) 'doom-hide-modeline-mode)
|
||||
(add-hook! (completion-in-region-mode completion-list-mode) 'doom-hide-modeline-mode)
|
||||
|
||||
;;
|
||||
(defun doom*popup-init (orig-fn &rest args)
|
||||
|
@ -203,7 +203,7 @@ properties."
|
|||
;; Hacks
|
||||
;;
|
||||
|
||||
(@after evil
|
||||
(after! evil
|
||||
(let ((map doom-popup-mode-map))
|
||||
(define-key map [remap evil-window-delete] 'doom/popup-close)
|
||||
(define-key map [remap evil-window-move-very-bottom] 'ignore)
|
||||
|
@ -269,7 +269,7 @@ the command buffer."
|
|||
(advice-add 'windmove-find-other-window :override 'doom*ignore-window-parameters-in-popups))
|
||||
|
||||
|
||||
(@after help-mode
|
||||
(after! help-mode
|
||||
;; Help buffers use `other-window' to decide where to open followed links,
|
||||
;; which can be unpredictable. It should *only* replace the original buffer we
|
||||
;; opened the popup from. To fix this these three button
|
||||
|
@ -318,12 +318,12 @@ the command buffer."
|
|||
(message "Unable to find location in file"))))))
|
||||
|
||||
|
||||
;; (@after magit
|
||||
;; (after! magit
|
||||
;; ;; Don't open files (from magit) within the magit popup
|
||||
;; (advice-add 'magit-display-file-buffer-traditional :around 'doom*popups-save))
|
||||
|
||||
|
||||
(@after neotree
|
||||
(after! neotree
|
||||
(defun doom*popups-save-neotree (orig-fn &rest args)
|
||||
"Prevents messing up the neotree buffer on window changes."
|
||||
(let ((neo-p (and (featurep 'neotree)
|
||||
|
@ -350,7 +350,7 @@ the command buffer."
|
|||
(advice-add 'evil-window-move-far-right :around 'doom*popups-save-neotree))
|
||||
|
||||
|
||||
(@add-hook org-load
|
||||
(add-hook! org-load
|
||||
;; Ensures org-src-edit yields control of its buffer to shackle.
|
||||
(defun doom*org-src-switch-to-buffer (buffer context) (pop-to-buffer buffer))
|
||||
(advice-add 'org-src-switch-to-buffer :override 'doom*org-src-switch-to-buffer)
|
||||
|
@ -382,8 +382,8 @@ the command buffer."
|
|||
(setq org-agenda-archives-mode nil
|
||||
org-agenda-buffer nil))))
|
||||
|
||||
(@after org-agenda
|
||||
(@after evil
|
||||
(after! org-agenda
|
||||
(after! evil
|
||||
(evil-define-key* 'motion org-agenda-mode-map
|
||||
[escape] 'doom/popup-org-agenda-quit
|
||||
(kbd "ESC") 'doom/popup-org-agenda-quit))
|
||||
|
@ -393,8 +393,8 @@ the command buffer."
|
|||
(define-key map "Q" 'doom/popup-org-agenda-quit))))
|
||||
|
||||
|
||||
(@after repl-toggle
|
||||
(@add-hook doom-popup-close
|
||||
(after! repl-toggle
|
||||
(add-hook! doom-popup-close
|
||||
(setq rtog/--last-buffer nil)))
|
||||
|
||||
(provide 'core-popups)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
;; digging through project files and exposing an API I can use to make other
|
||||
;; plugins/features project-aware.
|
||||
|
||||
(@def-package projectile :demand t
|
||||
(def-package! projectile :demand t
|
||||
:init
|
||||
(setq projectile-cache-file (concat doom-cache-dir "projectile.cache")
|
||||
projectile-enable-caching (not noninteractive)
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
;; show typed keystrokes in minibuffer
|
||||
(setq echo-keystrokes 0.02)
|
||||
;; ...but hide them while isearch is active
|
||||
(@add-hook isearch-mode (setq echo-keystrokes 0))
|
||||
(@add-hook isearch-mode-end (setq echo-keystrokes 0.02))
|
||||
(add-hook! isearch-mode (setq echo-keystrokes 0))
|
||||
(add-hook! isearch-mode-end (setq echo-keystrokes 0.02))
|
||||
|
||||
;; A minor mode for toggling the mode-line
|
||||
(defvar doom--hidden-modeline-format nil
|
||||
|
@ -90,7 +90,7 @@ disabled.")
|
|||
(push (cons 'left-fringe doom-ui-fringe-size) default-frame-alist)
|
||||
(push (cons 'right-fringe doom-ui-fringe-size) default-frame-alist)
|
||||
;; no fringe in the minibuffer
|
||||
(@add-hook (emacs-startup minibuffer-setup)
|
||||
(add-hook! (emacs-startup minibuffer-setup)
|
||||
(set-window-fringes (minibuffer-window) 0 0 nil)))
|
||||
|
||||
|
||||
|
@ -101,7 +101,7 @@ disabled.")
|
|||
;; I modified the built-in `hideshow' package to enable itself when needed. A
|
||||
;; better, more vim-like code-folding plugin would be the `origami' plugin, but
|
||||
;; until certain breaking bugs are fixed in it, I won't switch over.
|
||||
(@def-package hideshow ; built-in
|
||||
(def-package! hideshow ; built-in
|
||||
:commands (hs-minor-mode hs-toggle-hiding hs-already-hidden-p)
|
||||
:init
|
||||
(defun doom*autoload-hideshow ()
|
||||
|
@ -112,7 +112,7 @@ disabled.")
|
|||
(setq hs-hide-comments-when-hiding-all nil))
|
||||
|
||||
;; Show uninterrupted indentation markers with some whitespace voodoo.
|
||||
(@def-package highlight-indent-guides
|
||||
(def-package! highlight-indent-guides
|
||||
:commands highlight-indent-guides-mode
|
||||
:config
|
||||
(setq highlight-indent-guides-method 'character)
|
||||
|
@ -154,7 +154,7 @@ file."
|
|||
(set-buffer-modified-p nil))
|
||||
nil)
|
||||
|
||||
(@add-hook highlight-indent-guides-mode
|
||||
(add-hook! highlight-indent-guides-mode
|
||||
(if highlight-indent-guides-mode
|
||||
(progn
|
||||
(doom|inject-trailing-whitespace)
|
||||
|
@ -163,10 +163,10 @@ file."
|
|||
(delete-trailing-whitespace))))
|
||||
|
||||
;; For modes that don't adequately highlight numbers
|
||||
(@def-package highlight-numbers :commands highlight-numbers-mode)
|
||||
(def-package! highlight-numbers :commands highlight-numbers-mode)
|
||||
|
||||
;; Line highlighting
|
||||
(@def-package hl-line ; built-in
|
||||
(def-package! hl-line ; built-in
|
||||
:config
|
||||
;; stickiness doesn't play nice with emacs 25+
|
||||
(setq hl-line-sticky-flag nil
|
||||
|
@ -174,35 +174,35 @@ file."
|
|||
|
||||
;; Line number column. A faster (or equivalent, in the worst case) line number
|
||||
;; plugin than the built-in `linum'.
|
||||
(@def-package nlinum
|
||||
(def-package! nlinum
|
||||
:commands nlinum-mode
|
||||
:preface
|
||||
(defvar linum-format "%3d ")
|
||||
(defvar nlinum-format "%4d ")
|
||||
:init
|
||||
(@add-hook
|
||||
(add-hook!
|
||||
(markdown-mode prog-mode scss-mode web-mode conf-mode groovy-mode
|
||||
nxml-mode snippet-mode php-mode)
|
||||
'nlinum-mode)
|
||||
|
||||
:config
|
||||
;; Optimization: calculate line number column width beforehand
|
||||
(@add-hook nlinum-mode
|
||||
(add-hook! nlinum-mode
|
||||
(setq nlinum--width (length (save-excursion (goto-char (point-max))
|
||||
(format-mode-line "%l")))))
|
||||
|
||||
;; Disable nlinum explicitly before making a frame, otherwise nlinum throws
|
||||
;; linum face errors that prevent the frame from spawning.
|
||||
(@add-hook '(before-make-frame-hook after-make-frame-functions)
|
||||
(add-hook! '(before-make-frame-hook after-make-frame-functions)
|
||||
(nlinum-mode -1)))
|
||||
|
||||
;; Helps us distinguish stacked delimiter pairs. Especially in parentheses-drunk
|
||||
;; languages like Lisp.
|
||||
(@def-package rainbow-delimiters
|
||||
(def-package! rainbow-delimiters
|
||||
:commands rainbow-delimiters-mode
|
||||
:config (setq rainbow-delimiters-max-face-count 3)
|
||||
:init
|
||||
(@add-hook (emacs-lisp-mode lisp-mode js-mode css-mode c-mode-common)
|
||||
(add-hook! (emacs-lisp-mode lisp-mode js-mode css-mode c-mode-common)
|
||||
'rainbow-delimiters-mode))
|
||||
|
||||
|
||||
|
@ -211,7 +211,7 @@ file."
|
|||
;;
|
||||
|
||||
;; TODO Improve docstrings
|
||||
(defmacro @def-modeline-segment (name &rest forms)
|
||||
(defmacro def-modeline-segment! (name &rest forms)
|
||||
"Defines a modeline segment function and byte compiles it."
|
||||
(declare (indent defun) (doc-string 2))
|
||||
`(defun ,(intern (format "doom-modeline-segment--%s" name)) ()
|
||||
|
@ -226,11 +226,11 @@ file."
|
|||
(list (intern (format "doom-modeline-segment--%s" (symbol-name seg))))))
|
||||
segments)))
|
||||
|
||||
(defmacro @def-modeline (name lhs &optional rhs)
|
||||
(defmacro def-modeline! (name lhs &optional rhs)
|
||||
"Defines a modeline format and byte-compiles it.
|
||||
|
||||
Example:
|
||||
(@def-modeline minimal
|
||||
(def-modeline! minimal
|
||||
(bar matches \" \" buffer-info)
|
||||
(media-info major-mode))
|
||||
(setq-default mode-line-format (doom-modeline 'minimal))"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
;; doom|... hook function
|
||||
;; doom*... advising functions
|
||||
;; doom!... interaction commands exclusively for installing external dependencies
|
||||
;; @... a macro or function that configures DOOM
|
||||
;; ...! a macro or function that configures DOOM
|
||||
;; %... functions used for in-snippet logic
|
||||
;; +... Any of the above, but part of a module, e.g. +emacs-lisp|init-hook
|
||||
;;
|
||||
|
@ -148,7 +148,7 @@ enable multiple minor modes for the same regexp.")
|
|||
(require 'core-projects) ; making Emacs project-aware
|
||||
(require 'core-keybinds))) ; centralized keybind system + which-key
|
||||
|
||||
(@add-hook 'window-setup-hook
|
||||
(add-hook! 'window-setup-hook
|
||||
(setq gc-cons-threshold 134217728
|
||||
gc-cons-percentage 0.3))
|
||||
|
||||
|
|
|
@ -2,42 +2,42 @@
|
|||
;;; core/packages.el
|
||||
|
||||
;; core packages
|
||||
(@package async)
|
||||
(@package s)
|
||||
(@package f)
|
||||
(package! async)
|
||||
(package! s)
|
||||
(package! f)
|
||||
|
||||
;; core-os.el
|
||||
(when IS-MAC
|
||||
(@package exec-path-from-shell)
|
||||
(@package osx-clipboard))
|
||||
(package! exec-path-from-shell)
|
||||
(package! osx-clipboard))
|
||||
|
||||
;; core-ui.el
|
||||
(@package highlight-indent-guides)
|
||||
(@package highlight-numbers)
|
||||
(@package nlinum)
|
||||
(@package rainbow-delimiters)
|
||||
(package! highlight-indent-guides)
|
||||
(package! highlight-numbers)
|
||||
(package! nlinum)
|
||||
(package! rainbow-delimiters)
|
||||
|
||||
;; core-popups.el
|
||||
(@package shackle)
|
||||
(package! shackle)
|
||||
|
||||
;; core-editor.el
|
||||
(@package editorconfig)
|
||||
(@package smartparens)
|
||||
(@package ace-link)
|
||||
(@package ace-window)
|
||||
(@package avy)
|
||||
(@package command-log-mode)
|
||||
(@package expand-region)
|
||||
(@package goto-last-change)
|
||||
(@package help-fns+)
|
||||
(@package imenu-anywhere)
|
||||
(@package imenu-list)
|
||||
(@package pcre2el)
|
||||
(@package smart-forward)
|
||||
(@package wgrep)
|
||||
(package! editorconfig)
|
||||
(package! smartparens)
|
||||
(package! ace-link)
|
||||
(package! ace-window)
|
||||
(package! avy)
|
||||
(package! command-log-mode)
|
||||
(package! expand-region)
|
||||
(package! goto-last-change)
|
||||
(package! help-fns+)
|
||||
(package! imenu-anywhere)
|
||||
(package! imenu-list)
|
||||
(package! pcre2el)
|
||||
(package! smart-forward)
|
||||
(package! wgrep)
|
||||
|
||||
;; core-projects.el
|
||||
(@package projectile)
|
||||
(package! projectile)
|
||||
|
||||
;; core-keybinds.el
|
||||
(@package which-key)
|
||||
(package! which-key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue