Merge branch 'develop' of https://github.com/hlissner/doom-emacs into develop
This commit is contained in:
commit
ee611ca8af
11 changed files with 86 additions and 67 deletions
|
@ -162,18 +162,17 @@ compilation."
|
||||||
"Run FORMS without making any noise."
|
"Run FORMS without making any noise."
|
||||||
`(if doom-debug-mode
|
`(if doom-debug-mode
|
||||||
(progn ,@forms)
|
(progn ,@forms)
|
||||||
(fset 'doom--old-write-region-fn (symbol-function 'write-region))
|
(let ((old-fn (symbol-function 'write-region)))
|
||||||
(cl-letf ((standard-output (lambda (&rest _)))
|
(cl-letf* ((standard-output (lambda (&rest _)))
|
||||||
((symbol-function 'load-file) (lambda (file) (load file nil t)))
|
((symbol-function 'load-file) (lambda (file) (load file nil t)))
|
||||||
((symbol-function 'message) (lambda (&rest _)))
|
((symbol-function 'message) (lambda (&rest _)))
|
||||||
((symbol-function 'write-region)
|
((symbol-function 'write-region)
|
||||||
(lambda (start end filename &optional append visit lockname mustbenew)
|
(lambda (start end filename &optional append visit lockname mustbenew)
|
||||||
(unless visit (setq visit 'no-message))
|
(unless visit (setq visit 'no-message))
|
||||||
(doom--old-write-region-fn
|
(funcall old-fn start end filename append visit lockname mustbenew)))
|
||||||
start end filename append visit lockname mustbenew)))
|
(inhibit-message t)
|
||||||
(inhibit-message t)
|
(save-silently t))
|
||||||
(save-silently t))
|
,@forms))))
|
||||||
,@forms)))
|
|
||||||
|
|
||||||
(defvar doom--transient-counter 0)
|
(defvar doom--transient-counter 0)
|
||||||
(defmacro add-transient-hook! (hook &rest forms)
|
(defmacro add-transient-hook! (hook &rest forms)
|
||||||
|
|
|
@ -68,7 +68,7 @@ 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-core-packages
|
(defvar doom-core-packages
|
||||||
'(persistent-soft quelpa use-package async)
|
'(persistent-soft use-package quelpa)
|
||||||
"A list of packages that must be installed (and will be auto-installed if
|
"A list of packages that must be installed (and will be auto-installed if
|
||||||
missing) and shouldn't be deleted.")
|
missing) and shouldn't be deleted.")
|
||||||
|
|
||||||
|
@ -92,16 +92,22 @@ base by `doom!' and for calculating how many packages exist.")
|
||||||
|
|
||||||
(defvar doom--refreshed-p nil)
|
(defvar doom--refreshed-p nil)
|
||||||
|
|
||||||
(setq load-prefer-newer (or noninteractive doom-debug-mode)
|
(setq package--init-file-ensured t
|
||||||
package--init-file-ensured t
|
|
||||||
package-user-dir (expand-file-name "elpa" doom-packages-dir)
|
package-user-dir (expand-file-name "elpa" doom-packages-dir)
|
||||||
package-enable-at-startup nil
|
package-enable-at-startup nil
|
||||||
package-archives
|
package-archives
|
||||||
'(("gnu" . "https://elpa.gnu.org/packages/")
|
'(("gnu" . "https://elpa.gnu.org/packages/")
|
||||||
("melpa" . "https://melpa.org/packages/"))
|
("melpa" . "https://melpa.org/packages/")
|
||||||
|
("melpa-stable" . "https://stable.melpa.org/packages/"))
|
||||||
;; I omit Marmalade because its packages are manually submitted rather
|
;; I omit Marmalade because its packages are manually submitted rather
|
||||||
;; than pulled, so packages are often out of date with upstream.
|
;; than pulled, so packages are often out of date with upstream.
|
||||||
|
|
||||||
|
;; Don't gamble with these packages. Only retrieve stable versions. Quelpa
|
||||||
|
;; is omitted because it isn't on melpa-stable.
|
||||||
|
package-pinned-packages
|
||||||
|
'((use-package . "melpa-stable")
|
||||||
|
(persistent-soft . "melpa-stable"))
|
||||||
|
|
||||||
;; security settings
|
;; security settings
|
||||||
gnutls-verify-error (not (getenv "INSECURE")) ; you shouldn't use this
|
gnutls-verify-error (not (getenv "INSECURE")) ; you shouldn't use this
|
||||||
tls-checktrust gnutls-verify-error
|
tls-checktrust gnutls-verify-error
|
||||||
|
@ -152,9 +158,9 @@ startup."
|
||||||
(package-refresh-contents)
|
(package-refresh-contents)
|
||||||
(setq doom--refreshed-p t)
|
(setq doom--refreshed-p t)
|
||||||
(package-initialize t)))
|
(package-initialize t)))
|
||||||
;; We could let `package-initialize' fill `load-path', but it costs precious
|
;; We could let `package-initialize' fill `load-path', but it does more than
|
||||||
;; milliseconds and does other stuff I don't need (like load autoload
|
;; that alone (like load autoload files). If you want something prematurely
|
||||||
;; files). My premature optimization quota isn't filled yet.
|
;; optimizated right, ya gotta do it yourself.
|
||||||
;;
|
;;
|
||||||
;; Also, in some edge cases involving package initialization during a
|
;; Also, in some edge cases involving package initialization during a
|
||||||
;; non-interactive session, `package-initialize' fails to fill `load-path'.
|
;; non-interactive session, `package-initialize' fails to fill `load-path'.
|
||||||
|
@ -408,13 +414,17 @@ The module is only loaded once. If RELOAD-P is non-nil, load it again."
|
||||||
(when (or reload-p (not loaded-p))
|
(when (or reload-p (not loaded-p))
|
||||||
(unless loaded-p
|
(unless loaded-p
|
||||||
(doom-module-enable module submodule flags))
|
(doom-module-enable module submodule flags))
|
||||||
`(condition-case-unless-debug ex
|
(let ((module-path (doom-module-path module submodule)))
|
||||||
(load! config ,(doom-module-path module submodule) t)
|
(if (file-directory-p module-path)
|
||||||
('error
|
`(condition-case-unless-debug ex
|
||||||
(lwarn 'doom-modules :error
|
(load! config ,module-path t)
|
||||||
"%s in '%s %s' -> %s"
|
('error
|
||||||
(car ex) ,module ',submodule
|
(lwarn 'doom-modules :error
|
||||||
(error-message-string ex)))))))
|
"%s in '%s %s' -> %s"
|
||||||
|
(car ex) ,module ',submodule
|
||||||
|
(error-message-string ex))))
|
||||||
|
(lwarn 'doom-modules :warning "Couldn't find module '%s %s'"
|
||||||
|
module submodule))))))
|
||||||
|
|
||||||
(defmacro featurep! (module &optional submodule flag)
|
(defmacro featurep! (module &optional submodule flag)
|
||||||
"A convenience macro wrapper for `doom-module-loaded-p'. It is evaluated at
|
"A convenience macro wrapper for `doom-module-loaded-p'. It is evaluated at
|
||||||
|
@ -495,8 +505,10 @@ loads MODULE SUBMODULE's packages.el file."
|
||||||
"Returns the value of the ;;;###if predicate form in FILE."
|
"Returns the value of the ;;;###if predicate form in FILE."
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents-literally file nil 0 256)
|
(insert-file-contents-literally file nil 0 256)
|
||||||
(if (re-search-forward "^;;;###if " nil t)
|
(if (and (re-search-forward "^;;;###if " nil t)
|
||||||
(eval (sexp-at-point))
|
(<= (line-number-at-pos) 3))
|
||||||
|
(let ((load-file-name file))
|
||||||
|
(eval (sexp-at-point)))
|
||||||
t)))
|
t)))
|
||||||
|
|
||||||
(defun doom-packages--async-run (fn)
|
(defun doom-packages--async-run (fn)
|
||||||
|
@ -544,9 +556,8 @@ This should be run whenever init.el or an autoload file is modified. Running
|
||||||
;; This function must not use autoloaded functions or external dependencies.
|
;; This function must not use autoloaded functions or external dependencies.
|
||||||
;; It must assume nothing is set up!
|
;; It must assume nothing is set up!
|
||||||
(if (not noninteractive)
|
(if (not noninteractive)
|
||||||
;; This is done "asynchroniously" to protect the current session's state.
|
;; This is done in another instance to protect the current session's
|
||||||
;; This is because `doom-initialize-packages' rereads your emacs config,
|
;; state. `doom-initialize-packages' will have side effects otherwise.
|
||||||
;; which has side effects.
|
|
||||||
(and (doom-packages--async-run 'doom//reload-autoloads)
|
(and (doom-packages--async-run 'doom//reload-autoloads)
|
||||||
(load doom-autoload-file))
|
(load doom-autoload-file))
|
||||||
(doom-initialize-packages)
|
(doom-initialize-packages)
|
||||||
|
@ -556,22 +567,21 @@ This should be run whenever init.el or an autoload file is modified. Running
|
||||||
(dolist (path (doom-module-paths))
|
(dolist (path (doom-module-paths))
|
||||||
(let ((auto-dir (expand-file-name "autoload" path))
|
(let ((auto-dir (expand-file-name "autoload" path))
|
||||||
(auto-file (expand-file-name "autoload.el" path)))
|
(auto-file (expand-file-name "autoload.el" path)))
|
||||||
(when (and (file-exists-p auto-file)
|
(when (file-exists-p auto-file)
|
||||||
(doom-packages--read-if-cookies auto-file))
|
|
||||||
(push auto-file targets))
|
(push auto-file targets))
|
||||||
(when (file-directory-p auto-dir)
|
(when (file-directory-p auto-dir)
|
||||||
(dolist (file (file-expand-wildcards (expand-file-name "*.el" auto-dir) t))
|
(dolist (file (directory-files-recursively auto-dir "\\.el$"))
|
||||||
;; Make evil*.el autoload files a special case; don't load
|
(push file targets)))))
|
||||||
;; them unless evil is enabled.
|
|
||||||
(when (doom-packages--read-if-cookies file)
|
|
||||||
(push file targets))))))
|
|
||||||
(when (file-exists-p doom-autoload-file)
|
(when (file-exists-p doom-autoload-file)
|
||||||
(delete-file doom-autoload-file)
|
(delete-file doom-autoload-file)
|
||||||
(message "Deleted old autoloads.el"))
|
(message "Deleted old autoloads.el"))
|
||||||
(dolist (file (reverse targets))
|
(dolist (file (reverse targets))
|
||||||
(message (if (update-file-autoloads file nil doom-autoload-file)
|
(message (cond ((not (doom-packages--read-if-cookies file))
|
||||||
"Nothing in %s"
|
"Ignoring %s")
|
||||||
"Scanned %s")
|
((update-file-autoloads file nil doom-autoload-file)
|
||||||
|
"Nothing in %s")
|
||||||
|
(t
|
||||||
|
"Scanned %s"))
|
||||||
(file-relative-name file doom-emacs-dir)))
|
(file-relative-name file doom-emacs-dir)))
|
||||||
(let ((buf (get-file-buffer doom-autoload-file))
|
(let ((buf (get-file-buffer doom-autoload-file))
|
||||||
current-sexp)
|
current-sexp)
|
||||||
|
@ -616,9 +626,8 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
||||||
(recompile-p (or recompile-p
|
(recompile-p (or recompile-p
|
||||||
(and (member "-r" (cdr argv)) t))))
|
(and (member "-r" (cdr argv)) t))))
|
||||||
(if (not noninteractive)
|
(if (not noninteractive)
|
||||||
;; This is done "asynchroniously" to protect the current session's
|
;; This is done in another instance to protect the current session's
|
||||||
;; state. This is because `doom-initialize-packages' rereads your emacs
|
;; state. `doom-initialize-packages' will have side effects otherwise.
|
||||||
;; config, which has side effects.
|
|
||||||
(doom-packages--async-run 'doom//byte-compile)
|
(doom-packages--async-run 'doom//byte-compile)
|
||||||
(let ((total-ok 0)
|
(let ((total-ok 0)
|
||||||
(total-fail 0)
|
(total-fail 0)
|
||||||
|
|
|
@ -46,6 +46,9 @@ that was/were open in `doom-popup-history'.")
|
||||||
when their associated popup windows are closed, despite their :autokill
|
when their associated popup windows are closed, despite their :autokill
|
||||||
property.")
|
property.")
|
||||||
|
|
||||||
|
(defvar doom-popup-mode-map (make-sparse-keymap)
|
||||||
|
"Active keymap in popup windows.")
|
||||||
|
|
||||||
|
|
||||||
(def-setting! :popup (&rest rules)
|
(def-setting! :popup (&rest rules)
|
||||||
"Prepend a new popup rule to `shackle-rules' (see for format details).
|
"Prepend a new popup rule to `shackle-rules' (see for format details).
|
||||||
|
@ -133,20 +136,17 @@ recognized by DOOM's popup system. They are:
|
||||||
(dolist (param `(popup ,@doom-popup-window-parameters))
|
(dolist (param `(popup ,@doom-popup-window-parameters))
|
||||||
(push (cons param 'writable) window-persistent-parameters))
|
(push (cons param 'writable) window-persistent-parameters))
|
||||||
|
|
||||||
(defvar doom-popup-mode-map
|
(let ((map doom-popup-mode-map))
|
||||||
(let ((map (make-sparse-keymap)))
|
(define-key map [escape] #'doom/popup-close-maybe)
|
||||||
(define-key map [escape] #'doom/popup-close-maybe)
|
(define-key map (kbd "ESC") #'doom/popup-close-maybe)
|
||||||
(define-key map (kbd "ESC") #'doom/popup-close-maybe)
|
(define-key map [remap quit-window] #'doom/popup-close-maybe)
|
||||||
(define-key map [remap quit-window] #'doom/popup-close-maybe)
|
(define-key map [remap doom/kill-this-buffer] #'delete-window)
|
||||||
(define-key map [remap doom/kill-this-buffer] #'delete-window)
|
(define-key map [remap split-window-right] #'ignore)
|
||||||
(define-key map [remap split-window-right] #'ignore)
|
(define-key map [remap split-window-below] #'ignore)
|
||||||
(define-key map [remap split-window-below] #'ignore)
|
(define-key map [remap split-window-horizontally] #'ignore)
|
||||||
(define-key map [remap split-window-horizontally] #'ignore)
|
(define-key map [remap split-window-vertically] #'ignore)
|
||||||
(define-key map [remap split-window-vertically] #'ignore)
|
(define-key map [remap mouse-split-window-horizontally] #'ignore)
|
||||||
(define-key map [remap mouse-split-window-horizontally] #'ignore)
|
(define-key map [remap mouse-split-window-vertically] #'ignore)))
|
||||||
(define-key map [remap mouse-split-window-vertically] #'ignore)
|
|
||||||
map)
|
|
||||||
"Active keymap in popup windows."))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -304,12 +304,19 @@ local value, whether or not it's permanent-local. Therefore, we cycle
|
||||||
global-hl-line-sticky-flag nil)
|
global-hl-line-sticky-flag nil)
|
||||||
|
|
||||||
(after! evil
|
(after! evil
|
||||||
|
(defvar-local doom-buffer-hl-line-mode nil)
|
||||||
|
|
||||||
;; Disable `hl-line' in evil-visual mode (temporarily). `hl-line' can make
|
;; Disable `hl-line' in evil-visual mode (temporarily). `hl-line' can make
|
||||||
;; the selection region harder to see while in evil visual mode.
|
;; the selection region harder to see while in evil visual mode.
|
||||||
(defun doom|disable-hl-line () (hl-line-mode -1))
|
(defun doom|disable-hl-line ()
|
||||||
|
(when hl-line-mode
|
||||||
|
(setq doom-buffer-hl-line-mode t)
|
||||||
|
(hl-line-mode -1)))
|
||||||
|
(defun doom|enable-hl-line-maybe ()
|
||||||
|
(if doom-buffer-hl-line-mode (hl-line-mode +1)))
|
||||||
|
|
||||||
(add-hook 'evil-visual-state-entry-hook #'doom|disable-hl-line)
|
(add-hook 'evil-visual-state-entry-hook #'doom|disable-hl-line)
|
||||||
(add-hook 'evil-visual-state-exit-hook #'hl-line-mode)))
|
(add-hook 'evil-visual-state-exit-hook #'doom|enable-hl-line-maybe)))
|
||||||
|
|
||||||
;; Helps us distinguish stacked delimiter pairs. Especially in parentheses-drunk
|
;; Helps us distinguish stacked delimiter pairs. Especially in parentheses-drunk
|
||||||
;; languages like Lisp.
|
;; languages like Lisp.
|
||||||
|
|
|
@ -94,6 +94,7 @@ melodramatic ex-vimmer disappointed with the text-editor status quo."
|
||||||
enable-recursive-minibuffers nil
|
enable-recursive-minibuffers nil
|
||||||
debug-on-error (and (not noninteractive) doom-debug-mode)
|
debug-on-error (and (not noninteractive) doom-debug-mode)
|
||||||
idle-update-delay 2 ; update ui less often
|
idle-update-delay 2 ; update ui less often
|
||||||
|
load-prefer-newer (or noninteractive doom-debug-mode)
|
||||||
;; keep the point out of the minibuffer
|
;; keep the point out of the minibuffer
|
||||||
minibuffer-prompt-properties '(read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt)
|
minibuffer-prompt-properties '(read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt)
|
||||||
;; History & backup settings (save nothing, that's what git is for)
|
;; History & backup settings (save nothing, that's what git is for)
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
;; core packages
|
;; core packages
|
||||||
(package! s)
|
(package! s)
|
||||||
(package! f)
|
(package! f)
|
||||||
|
(package! async)
|
||||||
|
|
||||||
;; core-os.el
|
;; core-os.el
|
||||||
;; In case this config is shared across multiple computers (like mine is), let's
|
;; In case this config is shared across multiple computers (like mine is), let's
|
||||||
|
|
4
modules/lang/nix/config.el
Normal file
4
modules/lang/nix/config.el
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
;;; lang/nix/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(def-package! nix-mode
|
||||||
|
:mode "\\.nix$")
|
|
@ -170,7 +170,7 @@
|
||||||
:v "r" #'+eval:repl)
|
:v "r" #'+eval:repl)
|
||||||
|
|
||||||
(:desc "file" :prefix "f"
|
(:desc "file" :prefix "f"
|
||||||
:desc "File file" :n "." #'find-file
|
:desc "Find file" :n "." #'find-file
|
||||||
:desc "Sudo find file" :n ">" #'doom/sudo-find-file
|
:desc "Sudo find file" :n ">" #'doom/sudo-find-file
|
||||||
:desc "Find file in project" :n "/" #'projectile-find-file
|
:desc "Find file in project" :n "/" #'projectile-find-file
|
||||||
:desc "Find file from here" :n "?" #'counsel-file-jump
|
:desc "Find file from here" :n "?" #'counsel-file-jump
|
||||||
|
|
|
@ -67,10 +67,6 @@ redefines its keys every time `eshell-mode' is enabled."
|
||||||
[remap +workspace/close-window-or-workspace] #'eshell-life-is-too-much))
|
[remap +workspace/close-window-or-workspace] #'eshell-life-is-too-much))
|
||||||
(add-hook 'eshell-mode-hook #'+eshell|init-keymap)
|
(add-hook 'eshell-mode-hook #'+eshell|init-keymap)
|
||||||
|
|
||||||
(add-hook! eshell-mode
|
|
||||||
(add-hook 'evil-insert-state-exit-hook #'hl-line-mode nil t)
|
|
||||||
(add-hook 'evil-insert-state-entry-hook (lambda () (hl-line-mode -1)) nil t))
|
|
||||||
|
|
||||||
;; Aliases
|
;; Aliases
|
||||||
(setq eshell-command-aliases-list
|
(setq eshell-command-aliases-list
|
||||||
'(("q" "exit")
|
'(("q" "exit")
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
(advice-add #'recenter :around #'+doom*blink-cursor-maybe)
|
(advice-add #'recenter :around #'+doom*blink-cursor-maybe)
|
||||||
|
|
||||||
(after! evil
|
(after! evil
|
||||||
|
(advice-add #'evil--jumps-jump :after #'+doom/blink-cursor)
|
||||||
|
|
||||||
(advice-add #'evil-window-top :after #'+doom/blink-cursor)
|
(advice-add #'evil-window-top :after #'+doom/blink-cursor)
|
||||||
(advice-add #'evil-window-middle :after #'+doom/blink-cursor)
|
(advice-add #'evil-window-middle :after #'+doom/blink-cursor)
|
||||||
(advice-add #'evil-window-bottom :after #'+doom/blink-cursor)))
|
(advice-add #'evil-window-bottom :after #'+doom/blink-cursor)))
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
(defun +unicode|init-fonts (&optional frame)
|
(defun +unicode|init-fonts (&optional frame)
|
||||||
"Initialize `unicode-fonts', if in a GUI session."
|
"Initialize `unicode-fonts', if in a GUI session."
|
||||||
(when (display-graphic-p frame)
|
(when (and frame (display-graphic-p frame))
|
||||||
(with-selected-frame frame
|
(with-selected-frame frame
|
||||||
(require 'unicode-fonts)
|
(require 'unicode-fonts)
|
||||||
;; NOTE will impact startup time on first run
|
;; NOTE will impact startup time on first run
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue