about summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-12-30 12:27:39 -0600
committerCase Duckworth2021-12-30 12:27:39 -0600
commitd71d36267e830daf35e511f69e85736a5449dc31 (patch)
tree1de9dc9cd279f7e2268310e7f401cb06feec667f /lisp
parentChange `sentence-end-double-space` to nil mostly (diff)
downloademacs-d71d36267e830daf35e511f69e85736a5449dc31.tar.gz
emacs-d71d36267e830daf35e511f69e85736a5449dc31.zip
Move yank-indent advice to +emacs.el
Diffstat (limited to 'lisp')
-rw-r--r--lisp/+emacs.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/+emacs.el b/lisp/+emacs.el index 2d63e82..39b064c 100644 --- a/lisp/+emacs.el +++ b/lisp/+emacs.el
@@ -188,7 +188,7 @@ Do this only if the buffer is not visiting a file."
188(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) 188(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
189(add-hook 'minibuffer-setup-hook 'cursor-intangible-mode) 189(add-hook 'minibuffer-setup-hook 'cursor-intangible-mode)
190 190
191;;; Better-default functions 191;;; Better-default functions ...
192 192
193(defun +cycle-spacing (&optional n preserve-nl-back mode) 193(defun +cycle-spacing (&optional n preserve-nl-back mode)
194 "Negate N argument on `cycle-spacing'. 194 "Negate N argument on `cycle-spacing'.
@@ -214,6 +214,15 @@ kill without asking."
214 (save-buffers-kill-emacs)) 214 (save-buffers-kill-emacs))
215 (server-save-buffers-kill-terminal nil))) 215 (server-save-buffers-kill-terminal nil)))
216 216
217;; ... and advice
218
219;; Indent the region after a yank.
220(defun +yank@indent (&rest _)
221 "Indent the current region."
222 (indent-region (min (point) (mark)) (max (point) (mark))))
223(advice-add #'yank :after #'+yank@indent)
224(advice-add #'yank-pop :after #'+yank@indent)
225
217;;; Bindings 226;;; Bindings
218 227
219;; I need to place these bindings under `+key-mode-map' so that they aren't 228;; I need to place these bindings under `+key-mode-map' so that they aren't