diff options
author | Case Duckworth | 2021-12-30 12:27:39 -0600 |
---|---|---|
committer | Case Duckworth | 2021-12-30 12:27:39 -0600 |
commit | d71d36267e830daf35e511f69e85736a5449dc31 (patch) | |
tree | 1de9dc9cd279f7e2268310e7f401cb06feec667f /init.el | |
parent | Change `sentence-end-double-space` to nil mostly (diff) | |
download | emacs-d71d36267e830daf35e511f69e85736a5449dc31.tar.gz emacs-d71d36267e830daf35e511f69e85736a5449dc31.zip |
Move yank-indent advice to +emacs.el
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/init.el b/init.el index 6cfc405..6e45383 100644 --- a/init.el +++ b/init.el | |||
@@ -47,14 +47,11 @@ | |||
47 | ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults | 47 | ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults |
48 | (global-set-key (kbd "C-h") 'delete-backward-char) | 48 | (global-set-key (kbd "C-h") 'delete-backward-char) |
49 | (keyboard-translate ?\C-h ?\C-?) | 49 | (keyboard-translate ?\C-h ?\C-?) |
50 | ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hph14un/ | ||
50 | (define-advice keyboard-escape-quit (:around (fn &rest r)) | 51 | (define-advice keyboard-escape-quit (:around (fn &rest r)) |
51 | "Don't close splits on `keyboard-escape-quit'." | 52 | "Don't close splits on `keyboard-escape-quit'." |
52 | (let ((buffer-quit-function #'ignore)) | 53 | (let ((buffer-quit-function #'ignore)) |
53 | (apply fn r))) | 54 | (apply fn r)))) |
54 | (defun +yank@indent (&rest _) | ||
55 | (indent-region (min (point) (mark)) (max (point) (mark)))) | ||
56 | (advice-add 'yank :after '+yank@indent) | ||
57 | (advice-add 'yank-pop :after '+yank@indent)) | ||
58 | 55 | ||
59 | (setup (:require +init) | 56 | (setup (:require +init) |
60 | (:bind "C-c s" #'+init-sort-then-save) | 57 | (:bind "C-c s" #'+init-sort-then-save) |