summary refs log tree commit diff stats
path: root/README.md
diff options
context:
space:
mode:
authorCase Duckworth2020-12-10 00:41:57 -0600
committerCase Duckworth2020-12-10 00:41:57 -0600
commit83cae3563d24874218007197c73e9fd10eb94065 (patch)
tree6e5c362db1660aee27b12fbe33c80dafd8cfc066 /README.md
parentChange hooks for fonts (diff)
downloademacs-83cae3563d24874218007197c73e9fd10eb94065.tar.gz
emacs-83cae3563d24874218007197c73e9fd10eb94065.zip
Update README
Diffstat (limited to 'README.md')
-rw-r--r--README.md80
1 files changed, 63 insertions, 17 deletions
diff --git a/README.md b/README.md index dfcc845..39430ab 100644 --- a/README.md +++ b/README.md
@@ -103,6 +103,12 @@ Let’s configure Emacs using Org mode, they said. It’ll be fun, they said.
103 (make-directory (no-littering-expand-var-file-name dir) t)) 103 (make-directory (no-littering-expand-var-file-name dir) t))
104 104
105 105
106## About me
107
108 (setq user-full-name "Case Duckworth"
109 user-mail-address "acdw@acdw.net")
110
111
106# Look and Feel 112# Look and Feel
107 113
108 114
@@ -256,21 +262,6 @@ Let’s configure Emacs using Org mode, they said. It’ll be fun, they said.
256 (load-theme 'modus-operandi t)) 262 (load-theme 'modus-operandi t))
257 263
258 264
259### Modeline
260
261 (custom-set-faces
262 '(mode-line ((t (:height 0.8
263 :overline t
264 :box nil
265 :foreground "black"
266 :background "white"))))
267 '(mode-line-inactive ((t (:height 0.8
268 :overline t
269 :box nil
270 :foreground "#808080"
271 :background "white")))))
272
273
274### Fonts 265### Fonts
275 266
2761. Define fonts 2671. Define fonts
@@ -310,9 +301,9 @@ Let’s configure Emacs using Org mode, they said. It’ll be fun, they said.
310 "Linux Libertine O-12" 301 "Linux Libertine O-12"
311 "Georgia-11")) 302 "Georgia-11"))
312 303
313 (remove-hook 'window-setup-hook #'acdw/setup-fonts))) 304 (remove-hook 'after-init-hook #'acdw/setup-fonts)))
314 305
315 (add-hook 'window-setup-hook #'acdw/setup-fonts) 306 (add-hook 'after-init-hook #'acdw/setup-fonts)
316 307
3172. Variable-pitch in text modes 3082. Variable-pitch in text modes
318 309
@@ -620,6 +611,13 @@ I add it to the `find-file-hook` *and* `before-save-hook` because I don't want t
620 (add-hook 'prog-mode-hook #'acdw/enable-line-numbers) 611 (add-hook 'prog-mode-hook #'acdw/enable-line-numbers)
621 612
622 613
614## Indenting
615
616 (use-package aggressive-indent
617 :config
618 (global-aggressive-indent-mode +1))
619
620
623# Writing 621# Writing
624 622
625 623
@@ -764,6 +762,54 @@ I’ve put org mode under Applications, as opposed to Writing, because it’s m
764 'scimax/org-return) 762 'scimax/org-return)
765 763
766 764
765### Insert blank lines
766
767from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lines-between-headings-and-before-contents).
768
769 ;;;###autoload
770 (defun unpackaged/org-fix-blank-lines (&optional prefix)
771 "Ensure that blank lines exist between headings and between headings and their contents.
772 With prefix, operate on whole buffer. Ensures that blank lines
773 exist after each headings's drawers."
774 (interactive "P")
775 (org-map-entries (lambda ()
776 (org-with-wide-buffer
777 ;; `org-map-entries' narrows the buffer, which prevents us from seeing
778 ;; newlines before the current heading, so we do this part widened.
779 (while (not (looking-back "\n\n" nil))
780 ;; Insert blank lines before heading.
781 (insert "\n")))
782 (let ((end (org-entry-end-position)))
783 ;; Insert blank lines before entry content
784 (forward-line)
785 (while (and (org-at-planning-p)
786 (< (point) (point-max)))
787 ;; Skip planning lines
788 (forward-line))
789 (while (re-search-forward org-drawer-regexp end t)
790 ;; Skip drawers. You might think that `org-at-drawer-p' would suffice, but
791 ;; for some reason it doesn't work correctly when operating on hidden text.
792 ;; This works, taken from `org-agenda-get-some-entry-text'.
793 (re-search-forward "^[ \t]*:END:.*\n?" end t)
794 (goto-char (match-end 0)))
795 (unless (or (= (point) (point-max))
796 (org-at-heading-p)
797 (looking-at-p "\n"))
798 (insert "\n"))))
799 t (if prefix
800 nil
801 'tree)))
802
8031. Add a before-save-hook
804
805 (defun cribbed/org-mode-fix-blank-lines ()
806 (when (eq major-mode 'org-mode)
807 (let ((current-prefix-arg 4)) ; Emulate C-u
808 (call-interactively 'unpackaged/org-fix-blank-lines))))
809
810 (add-hook 'before-save-hook #'cribbed/org-mode-fix-blank-lines)
811
812
767# Appendices 813# Appendices
768 814
769 815