about summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
authorCase Duckworth2021-04-02 13:07:24 -0500
committerCase Duckworth2021-04-02 13:28:22 -0500
commitb649a257550f37ff7b0f96d417d4b80613141977 (patch)
tree04f09f59ba9751f788323223c7e4faa9e381faee /init.el
parentTweak elisp-mode settings (diff)
downloademacs-b649a257550f37ff7b0f96d417d4b80613141977.tar.gz
emacs-b649a257550f37ff7b0f96d417d4b80613141977.zip
Add `defun-with-hooks'
Diffstat (limited to 'init.el')
-rw-r--r--init.el17
1 files changed, 15 insertions, 2 deletions
diff --git a/init.el b/init.el index 3756690..5d900ce 100644 --- a/init.el +++ b/init.el
@@ -101,10 +101,15 @@
101 word-wrap t 101 word-wrap t
102 truncate-lines nil) 102 truncate-lines nil)
103(add-hook 'text-mode-hook #'turn-on-auto-fill) 103(add-hook 'text-mode-hook #'turn-on-auto-fill)
104(add-hook 'prog-mode-hook #'turn-on-auto-fill)
105(global-display-fill-column-indicator-mode +1) 104(global-display-fill-column-indicator-mode +1)
106(global-so-long-mode +1) 105(global-so-long-mode +1)
107 106
107;; Only fill comments in prog-mode.
108(defun-with-hooks '(prog-mode)
109 (defun hook--auto-fill-prog-mode ()
110 (setq-local comment-auto-fill-only-comments t)
111 (turn-on-auto-fill)))
112
108;;;; Whitespace 113;;;; Whitespace
109(setc whitespace-style 114(setc whitespace-style
110 '(empty indentation space-before-tab space-after-tab) 115 '(empty indentation space-before-tab space-after-tab)
@@ -118,7 +123,6 @@
118 show-paren-style 'mixed 123 show-paren-style 'mixed
119 show-paren-when-point-inside-paren t 124 show-paren-when-point-inside-paren t
120 show-paren-when-point-in-periphery t) 125 show-paren-when-point-in-periphery t)
121(show-paren-mode +1)
122(add-hook 'prog-mode-hook #'electric-pair-local-mode) 126(add-hook 'prog-mode-hook #'electric-pair-local-mode)
123 127
124;;;; Killing and yanking 128;;;; Killing and yanking
@@ -371,6 +375,15 @@
371 w32-pass-apps-to-system nil 375 w32-pass-apps-to-system nil
372 w32-apps-modifier 'hyper)) 376 w32-apps-modifier 'hyper))
373 377
378;;;; Set up non-special modes
379;; Great idea from brause.cc
380(defun-with-hooks '(text-mode-hook prog-mode-hook diff-mode-hook)
381 (defun hook--setup-regular-modes ()
382 (setq indicate-empty-lines t
383 indicate-buffer-boundaries '((top . right) (bottom . right)))
384 (goto-address-mode +1)
385 (show-paren-mode +1)))
386
374;;;; Etc. good defaults 387;;;; Etc. good defaults
375(setc custom-file (acdw/in-dir "custom.el") 388(setc custom-file (acdw/in-dir "custom.el")
376 inhibit-startup-screen t 389 inhibit-startup-screen t