about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--README.md210
-rw-r--r--config.org14
2 files changed, 134 insertions, 90 deletions
diff --git a/README.md b/README.md index 5d6c99e..1f56e6c 100644 --- a/README.md +++ b/README.md
@@ -468,25 +468,25 @@ helper function, though, to add things to the whitelist.
468 ;; fixed-pitch /is/ the default 468 ;; fixed-pitch /is/ the default
469 (set-face-from-alternatives face nil 469 (set-face-from-alternatives face nil
470 '(:family "Input Mono" 470 '(:family "Input Mono"
471 :slant normal 471 :slant normal
472 :weight normal 472 :weight normal
473 :height 110) 473 :height 110)
474 '(:family "Go Mono" 474 '(:family "Go Mono"
475 :slant normal 475 :slant normal
476 :weight normal 476 :weight normal
477 :height 100) 477 :height 100)
478 '(:family "Consolas" 478 '(:family "Consolas"
479 :slant normal 479 :slant normal
480 :weight normal 480 :weight normal
481 :height 100))) 481 :height 100)))
482 ;; variable-pitch is different 482 ;; variable-pitch is different
483 (set-face-from-alternatives 'variable-pitch nil 483 (set-face-from-alternatives 'variable-pitch nil
484 '(:family "Input Sans" 484 '(:family "Input Sans"
485 :slant normal 485 :slant normal
486 :weight normal) 486 :weight normal)
487 '(:family "Georgia" 487 '(:family "Georgia"
488 :slant normal 488 :slant normal
489 :weight normal))) 489 :weight normal)))
490 490
491 ;; remove myself from the hook 491 ;; remove myself from the hook
492 (remove-function after-focus-change-function #'acdw/setup-fonts)) 492 (remove-function after-focus-change-function #'acdw/setup-fonts))
@@ -1070,6 +1070,17 @@ I’ve pretty much cribbed this from [recentf-remove-sudo-tramp-prefix](https://
1070 (global-aggressive-indent-mode +1) 1070 (global-aggressive-indent-mode +1)
1071 1071
1072 1072
1073## Auto-fill comments only
1074
1075from [EmacsWiki](https://www.emacswiki.org/emacs/AutoFillMode).
1076
1077 (defun comment-auto-fill ()
1078 (setq-local comment-auto-fill-only-comments t)
1079 (auto-fill-mode 1))
1080
1081 (add-hook 'prog-mode-hook #'comment-auto-fill)
1082
1083
1073## Completion 1084## Completion
1074 1085
1075 (straight-use-package 'company) 1086 (straight-use-package 'company)
@@ -1428,81 +1439,81 @@ from [mpereira](https://github.com/mpereira/.emacs.d#align-all-tags-in-the-buffe
1428 (if default 1439 (if default
1429 (org-return) 1440 (org-return)
1430 (cond 1441 (cond
1431 ;; Act depending on context around point. 1442 ;; Act depending on context around point.
1432 1443
1433 ;; NOTE: I prefer RET to not follow links, but by uncommenting this block, links will be 1444 ;; NOTE: I prefer RET to not follow links, but by uncommenting this block, links will be
1434 ;; followed. 1445 ;; followed.
1435 1446
1436 ;; ((eq 'link (car (org-element-context))) 1447 ;; ((eq 'link (car (org-element-context)))
1437 ;; ;; Link: Open it. 1448 ;; ;; Link: Open it.
1438 ;; (org-open-at-point-global)) 1449 ;; (org-open-at-point-global))
1439 1450
1440 ((org-at-heading-p) 1451 ((org-at-heading-p)
1441 ;; Heading: Move to position after entry content. 1452 ;; Heading: Move to position after entry content.
1442 ;; NOTE: This is probably the most interesting feature of this function. 1453 ;; NOTE: This is probably the most interesting feature of this function.
1443 (let ((heading-start (org-entry-beginning-position))) 1454 (let ((heading-start (org-entry-beginning-position)))
1444 (goto-char (org-entry-end-position)) 1455 (goto-char (org-entry-end-position))
1445 (cond ((and (org-at-heading-p) 1456 (cond ((and (org-at-heading-p)
1446 (= heading-start (org-entry-beginning-position))) 1457 (= heading-start (org-entry-beginning-position)))
1447 ;; Entry ends on its heading; add newline after 1458 ;; Entry ends on its heading; add newline after
1448 (end-of-line) 1459 (end-of-line)
1449 (insert "\n\n")) 1460 (insert "\n\n"))
1450 (t 1461 (t
1451 ;; Entry ends after its heading; back up 1462 ;; Entry ends after its heading; back up
1452 (forward-line -1) 1463 (forward-line -1)
1453 (end-of-line) 1464 (end-of-line)
1454 (when (org-at-heading-p) 1465 (when (org-at-heading-p)
1455 ;; At the same heading 1466 ;; At the same heading
1456 (forward-line) 1467 (forward-line)
1457 (insert "\n") 1468 (insert "\n")
1458 (forward-line -1)) 1469 (forward-line -1))
1459 ;; FIXME: looking-back is supposed to be called with more arguments. 1470 ;; FIXME: looking-back is supposed to be called with more arguments.
1460 (while (not (looking-back (rx (repeat 3 (seq (optional blank) "\n"))) nil)) 1471 (while (not (looking-back (rx (repeat 3 (seq (optional blank) "\n"))) nil))
1461 (insert "\n")) 1472 (insert "\n"))
1462 (forward-line -1))))) 1473 (forward-line -1)))))
1463 1474
1464 ((org-at-item-checkbox-p) 1475 ((org-at-item-checkbox-p)
1465 ;; Checkbox: Insert new item with checkbox. 1476 ;; Checkbox: Insert new item with checkbox.
1466 (org-insert-todo-heading nil)) 1477 (org-insert-todo-heading nil))
1467 1478
1468 ((org-in-item-p) 1479 ((org-in-item-p)
1469 ;; Plain list. Yes, this gets a little complicated... 1480 ;; Plain list. Yes, this gets a little complicated...
1470 (let ((context (org-element-context))) 1481 (let ((context (org-element-context)))
1471 (if (or (eq 'plain-list (car context)) ; First item in list 1482 (if (or (eq 'plain-list (car context)) ; First item in list
1472 (and (eq 'item (car context)) 1483 (and (eq 'item (car context))
1473 (not (eq (org-element-property :contents-begin context) 1484 (not (eq (org-element-property :contents-begin context)
1474 (org-element-property :contents-end context)))) 1485 (org-element-property :contents-end context))))
1475 (unpackaged/org-element-descendant-of 'item context)) ; Element in list item, e.g. a link 1486 (unpackaged/org-element-descendant-of 'item context)) ; Element in list item, e.g. a link
1476 ;; Non-empty item: Add new item. 1487 ;; Non-empty item: Add new item.
1477 (org-insert-item) 1488 (org-insert-item)
1478 ;; Empty item: Close the list. 1489 ;; Empty item: Close the list.
1479 ;; TODO: Do this with org functions rather than operating on the text. Can't seem to find the right function. 1490 ;; TODO: Do this with org functions rather than operating on the text. Can't seem to find the right function.
1480 (delete-region (line-beginning-position) (line-end-position)) 1491 (delete-region (line-beginning-position) (line-end-position))
1481 (insert "\n")))) 1492 (insert "\n"))))
1482 1493
1483 ((when (fboundp 'org-inlinetask-in-task-p) 1494 ((when (fboundp 'org-inlinetask-in-task-p)
1484 (org-inlinetask-in-task-p)) 1495 (org-inlinetask-in-task-p))
1485 ;; Inline task: Don't insert a new heading. 1496 ;; Inline task: Don't insert a new heading.
1486 (org-return)) 1497 (org-return))
1487 1498
1488 ((org-at-table-p) 1499 ((org-at-table-p)
1489 (cond ((save-excursion 1500 (cond ((save-excursion
1490 (beginning-of-line) 1501 (beginning-of-line)
1491 ;; See `org-table-next-field'. 1502 ;; See `org-table-next-field'.
1492 (cl-loop with end = (line-end-position) 1503 (cl-loop with end = (line-end-position)
1493 for cell = (org-element-table-cell-parser) 1504 for cell = (org-element-table-cell-parser)
1494 always (equal (org-element-property :contents-begin cell) 1505 always (equal (org-element-property :contents-begin cell)
1495 (org-element-property :contents-end cell)) 1506 (org-element-property :contents-end cell))
1496 while (re-search-forward "|" end t))) 1507 while (re-search-forward "|" end t)))
1497 ;; Empty row: end the table. 1508 ;; Empty row: end the table.
1498 (delete-region (line-beginning-position) (line-end-position)) 1509 (delete-region (line-beginning-position) (line-end-position))
1499 (org-return)) 1510 (org-return))
1500 (t 1511 (t
1501 ;; Non-empty row: call `org-return'. 1512 ;; Non-empty row: call `org-return'.
1502 (org-return)))) 1513 (org-return))))
1503 (t 1514 (t
1504 ;; All other cases: call `org-return'. 1515 ;; All other cases: call `org-return'.
1505 (org-return))))) 1516 (org-return)))))
1506 1517
1507 (with-eval-after-load 'org 1518 (with-eval-after-load 'org
1508 (define-key org-mode-map (kbd "RET") #'unpackaged/org-return-dwim)) 1519 (define-key org-mode-map (kbd "RET") #'unpackaged/org-return-dwim))
@@ -1573,7 +1584,7 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
1573 (dolist (file '(;; add more files to this list 1584 (dolist (file '(;; add more files to this list
1574 "home.org" 1585 "home.org"
1575 "work.org") 1586 "work.org")
1576 list) 1587 list)
1577 (push (expand-file-name file org-directory) list)))) 1588 (push (expand-file-name file org-directory) list))))
1578 1589
1579 (define-key acdw/map (kbd "C-a") #'org-agenda) 1590 (define-key acdw/map (kbd "C-a") #'org-agenda)
@@ -2018,6 +2029,11 @@ I’m only enabling this at home for now, since it requires building stuff.
2018 (setq acdw/exec-path-from-shell-initialized (current-time))))) 2029 (setq acdw/exec-path-from-shell-initialized (current-time)))))
2019 2030
2020 2031
2032# Areas for further research
2033
2034- [Use a minor-mode for keybindings](https://github.com/larstvei/dot-emacs#key-bindings)
2035
2036
2021# Appendices 2037# Appendices
2022 2038
2023 2039
@@ -2140,6 +2156,22 @@ shortcut-creating software >:(.
2140 "%EMACS%" %* 2156 "%EMACS%" %*
2141 2157
2142 2158
2159### emacsclient.desktop
2160
2161from [taingram](https://www.taingram.org/blog/emacs-client.html).
2162
2163 [Desktop Entry]
2164 Name=Emacs Client
2165 GenericName=Text Editor
2166 Comment=Edit text
2167 MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
2168 Exec=emacsclient -c %f
2169 Icon=emacs
2170 Type=Application
2171 Terminal=false
2172 Categories=Utility;TextEditor;
2173
2174
2143## License 2175## License
2144 2176
2145Copyright © 2020 Case Duckworth <acdw@acdw.net> 2177Copyright © 2020 Case Duckworth <acdw@acdw.net>
diff --git a/config.org b/config.org index 8c45798..afeac72 100644 --- a/config.org +++ b/config.org
@@ -5,7 +5,7 @@
5#+EXPORT_FILE_NAME: README.md 5#+EXPORT_FILE_NAME: README.md
6#+OPTIONS: toc:nil 6#+OPTIONS: toc:nil
7#+BANKRUPTCY_COUNT: 3.2 7#+BANKRUPTCY_COUNT: 3.2
8#+Time-stamp: <2021-01-14 20:38:43 acdw> 8#+Time-stamp: <2021-01-18 23:29:22 acdw>
9 9
10* Basics 10* Basics
11 11
@@ -1252,6 +1252,18 @@
1252 (global-aggressive-indent-mode +1) 1252 (global-aggressive-indent-mode +1)
1253 #+end_src 1253 #+end_src
1254 1254
1255** Auto-fill comments only
1256
1257from [[https://www.emacswiki.org/emacs/AutoFillMode][EmacsWiki]].
1258
1259 #+begin_src emacs-lisp
1260 (defun comment-auto-fill ()
1261 (setq-local comment-auto-fill-only-comments t)
1262 (auto-fill-mode 1))
1263
1264 (add-hook 'prog-mode-hook #'comment-auto-fill)
1265 #+end_src
1266
1255** Completion 1267** Completion
1256 1268
1257 #+begin_src emacs-lisp 1269 #+begin_src emacs-lisp