projects
/
~bandali
/
configs
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
emacs: make b/insert-asterism more robust w.r.t. fill-column
[~bandali/configs]
/
.emacs.d
/
init.el
diff --git
a/.emacs.d/init.el
b/.emacs.d/init.el
index
5e3ce80
..
85aeba0
100644
(file)
--- a/
.emacs.d/init.el
+++ b/
.emacs.d/init.el
@@
-266,9
+266,21
@@
(previous-line)
(insert "\n
\f
\n;;; "))
(previous-line)
(insert "\n
\f
\n;;; "))
+(defvar b/fill-column 47
+ "My custom `fill-column'.")
+
+(defconst b/asterism "* * *")
+
(defun b/insert-asterism ()
(defun b/insert-asterism ()
+ "Insert a centred asterism."
(interactive)
(interactive)
- (insert "\n\n * * *\n\n"))
+ (insert
+ (concat
+ "\n\n"
+ (make-string (floor (/ (- b/fill-column (length b/asterism)) 2))
+ ?\s)
+ b/asterism
+ "\n\n")))
(defun b/no-mouse-autoselect-window ()
"Conveniently disable `focus-follows-mouse'.
(defun b/no-mouse-autoselect-window ()
"Conveniently disable `focus-follows-mouse'.
@@
-301,7
+313,9
@@
For disabling the behaviour for certain buffers and/or modes."
scroll-conservatively 10
scroll-preserve-screen-position 1
;; focus follows mouse
scroll-conservatively 10
scroll-preserve-screen-position 1
;; focus follows mouse
- mouse-autoselect-window t)
+ mouse-autoselect-window t
+ ;; custom fill-column
+ fill-column b/fill-column)
(setq-default
;; always use space for indentation
(setq-default
;; always use space for indentation
@@
-2552,8
+2566,8
@@
https://csclub.uwaterloo.ca/~abandali")
:hook (;; (message-setup . mml-secure-message-sign-pgpmime)
(message-mode . flyspell-mode)
(message-mode . (lambda ()
:hook (;; (message-setup . mml-secure-message-sign-pgpmime)
(message-mode . flyspell-mode)
(message-mode . (lambda ()
- ;; (setq fill-column 65
-
;; message-fill-column 65
)
+ (setq-local fill-column b/fill-column
+
message-fill-column b/fill-column
)
(make-local-variable 'company-idle-delay)
(setq company-idle-delay 0.2))))
;; :custom-face
(make-local-variable 'company-idle-delay)
(setq company-idle-delay 0.2))))
;; :custom-face