summary refs log tree commit diff stats
path: root/README.md
diff options
context:
space:
mode:
authorCase Duckworth2021-01-13 20:19:56 -0600
committerCase Duckworth2021-01-13 20:19:56 -0600
commit57841624b6c75ad87a146210b0952350fd8229fd (patch)
treefcd225f64e4523c4abb7c278ef7b08549c4c94e1 /README.md
parentFix bugs for compilation (diff)
downloademacs-57841624b6c75ad87a146210b0952350fd8229fd.tar.gz
emacs-57841624b6c75ad87a146210b0952350fd8229fd.zip
Delete re-definition of lisp-indent-function for something simpler
The compiler kept complaining about how the variable
‘calculate-lisp-indent-last-sexp’ was “free,” which is due to (according to [1]) the
fact that it’s dynamically bound, as opposed to lexical – so it’s actually defined
further up the function call-chain, meaning it works but the compiler complains
about it.  I didn’t like all the complaining, so I tried installing ‘el-patch’ per
this StackOverflow discussion[2], thinking that a package built allegedly
specifically for this purpose would fix the dynamic/lexical binding mess, but of
course it didn’t.  So I just went and applied the changes in abo-abo’s answer[3],
which set the indent-functions for elisp to be the same as cl.  C’est la vie.

[1]: https://emacs.stackexchange.com/questions/52782/
[2]: https://stackoverflow.com/questions/22166895/
[3]: https://stackoverflow.com/a/22167050
Diffstat (limited to 'README.md')
-rw-r--r--README.md233
1 files changed, 214 insertions, 19 deletions
diff --git a/README.md b/README.md index bde17e1..dc977c3 100644 --- a/README.md +++ b/README.md
@@ -90,7 +90,7 @@ doesn't work, I'll call git directly and clone the repo myself.
90 90
91### Emulate use-package’s `:custom` 91### Emulate use-package’s `:custom`
92 92
93 (defmacro cuss (var val &optional docstring) 93 (defmacro cuss (var val &optional _docstring)
94 "Basically, `:custom' from `use-package', but without `use-package'." 94 "Basically, `:custom' from `use-package', but without `use-package'."
95 (declare (doc-string 3) 95 (declare (doc-string 3)
96 (indent 2)) 96 (indent 2))
@@ -407,7 +407,7 @@ helper function, though, to add things to the whitelist.
407 (: (any ?a ?A ?p ?P) (any ?m ?M))) 407 (: (any ?a ?A ?p ?P) (any ?m ?M)))
408 (* nonl))) 408 (* nonl)))
409 (ss (sunrise-sunset)) 409 (ss (sunrise-sunset))
410 (m_ (string-match times-regex ss)) 410 (_m (string-match times-regex ss))
411 (sunrise-time (match-string 1 ss)) 411 (sunrise-time (match-string 1 ss))
412 (sunset-time (match-string 2 ss))) 412 (sunset-time (match-string 2 ss)))
413 (run-at-time sunrise-time (* 60 60 24) sunrise-command) 413 (run-at-time sunrise-time (* 60 60 24) sunrise-command)
@@ -640,6 +640,20 @@ from [u/TheFrenchPoulp](https://www.reddit.com/r/emacs/comments/km9by4/weekly_ti
640 (apply original arguments))) 640 (apply original arguments)))
641 641
642 642
643### Scroll much faster
644
645from [mpereira](https://github.com/mpereira/.emacs.d#make-cursor-movement-an-order-of-magnitude-faster), from somewhere else.
646
647 (cuss auto-window-vscroll nil
648 "Don't auto-adjust `window-vscroll' to view long lines.")
649
650 (cuss fast-but-imprecise-scrolling t
651 "Scroll fast, but possibly with inaccurate text rendering.")
652
653 (cuss jit-lock-defer-time 0
654 "Only defer font-locking when input is pending.")
655
656
643## Persistence 657## Persistence
644 658
645 659
@@ -743,9 +757,7 @@ from [Mastering Emacs](https://www.masteringemacs.org/article/working-coding-sys
743 (set-keyboard-coding-system 'utf-8) 757 (set-keyboard-coding-system 'utf-8)
744 ;; backwards compatibility: 758 ;; backwards compatibility:
745 ;; `default-buffer-file-coding-system' is deprecated in 23.2. 759 ;; `default-buffer-file-coding-system' is deprecated in 23.2.
746 (if (boundp 'buffer-file-coding-system) 760 (setq default-buffer-file-coding-system 'utf-8)
747 (setq-default buffer-file-coding-system 'utf-8)
748 (setq default-buffer-file-coding-system 'utf-8))
749 761
750 ;; Treat clipboard as UTF-8 string first; compound text next, etc. 762 ;; Treat clipboard as UTF-8 string first; compound text next, etc.
751 (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) 763 (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
@@ -830,7 +842,7 @@ Because I like *overkill*, or at least … over-*saving*.
830 (straight-use-package 'sudo-edit) 842 (straight-use-package 'sudo-edit)
831 843
832 (with-eval-after-load 'sudo-edit 844 (with-eval-after-load 'sudo-edit
833 (global-set-key acdw/map (kbd "C-r") #'sudo-edit)) 845 (define-key acdw/map (kbd "C-r") #'sudo-edit))
834 846
835 847
836#### Don’t add `/sudo:` files to `recentf`, though 848#### Don’t add `/sudo:` files to `recentf`, though
@@ -867,7 +879,14 @@ I’ve pretty much cribbed this from [recentf-remove-sudo-tramp-prefix](https://
867### View long lines like filled lines in the beginning 879### View long lines like filled lines in the beginning
868 880
869 (straight-use-package 'adaptive-wrap) 881 (straight-use-package 'adaptive-wrap)
870 (adaptive-wrap-prefix-mode +1) 882
883 (when (fboundp 'adaptive-wrap-prefix-mode)
884 (defun acdw/activate-adaptive-wrap-prefix-mode ()
885 "Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously."
886 (adaptive-wrap-prefix-mode (if visual-line-mode
887 +1
888 -1)))
889 (add-hook 'visual-line-mode-hook #'acdw/activate-adaptive-wrap-prefix-mode))
871 890
872 891
873### Stay snappy with long-lined files 892### Stay snappy with long-lined files
@@ -1042,6 +1061,28 @@ I’ve pretty much cribbed this from [recentf-remove-sudo-tramp-prefix](https://
1042 "Don't truncate printed expressions by level.") 1061 "Don't truncate printed expressions by level.")
1043 1062
1044 1063
1064#### Eros (Evaluation Result OverlayS)
1065
1066 (straight-use-package 'eros)
1067
1068 (cuss eros-eval-result-prefix ";; => "
1069 "Prefix displayed before eros overlays.")
1070
1071 (eros-mode +1)
1072
1073
1074#### Indent Elisp like Common Lisp
1075
1076 (setq lisp-indent-function 'common-lisp-indent-function)
1077 (put 'cl-flet 'common-lisp-indent-function
1078 (get 'flet 'common-lisp-indent-function))
1079 (put 'cl-labels 'common-lisp-indent-function
1080 (get 'labels 'common-lisp-indent-function))
1081 (put 'if 'common-lisp-indent-function 2)
1082 (put 'dotimes-protect 'common-lisp-indent-function
1083 (get 'when 'common-lisp-indent-function))
1084
1085
1045### Janet 1086### Janet
1046 1087
1047 (straight-use-package 'janet-mode) 1088 (straight-use-package 'janet-mode)
@@ -1151,19 +1192,44 @@ This has to be done *before* loading the package. It's included in `visual-fill
1151# Applications 1192# Applications
1152 1193
1153 1194
1195## Web browsing
1196
1197 (cuss browse-url-browser-function 'browse-url-firefox)
1198 (cuss browse-url-new-window-flag t
1199 "Always open a new browser window.")
1200
1201 ;;(cuss browse-url-generic-program "firefox")
1202 (cuss browse-url-firefox-new-window-is-tab t
1203 "Or a new tab, in Firefox.")
1204
1205 ;; we need to add Firefox to `exec-path' on Windows
1206 (at-work
1207 (add-to-list 'exec-path "c:/Program Files/Mozilla Firefox"))
1208
1209
1154## Dired 1210## Dired
1155 1211
1156 1212
1157### Basic customization 1213### Basic customization
1158 1214
1215 (defun acdw/setup-dired-mode ()
1216 (hl-line-mode)
1217 (dired-hide-details-mode))
1218
1159 ;; highlight the current line in dired. 1219 ;; highlight the current line in dired.
1160 (add-hook 'dired-mode-hook #'hl-line-mode) 1220 (add-hook 'dired-mode-hook #'acdw/setup-dired-mode)
1161 1221
1162 (cuss dired-recursive-copies 'always 1222 (cuss dired-recursive-copies 'always
1163 "Always recursively copy.") 1223 "Always recursively copy.")
1164 1224
1225 (cuss dired-recursive-deletes 'always
1226 "Always recursively delete.")
1227
1228 (cuss delete-by-moving-to-trash t)
1229
1165 (cuss dired-listing-switches "-alh" 1230 (cuss dired-listing-switches "-alh"
1166 "Show All items, Listed out, with Human-readable sizes.") 1231 "Show (A)lmost all items,
1232 (l)isted out, with (h)uman-readable sizes.")
1167 1233
1168 1234
1169### Expand subtrees 1235### Expand subtrees
@@ -1241,13 +1307,32 @@ I’ve put org mode under Applications, as opposed to Writing, because it’s m
1241 (variable-pitch)))))) 1307 (variable-pitch))))))
1242 1308
1243 1309
1310##### Align all tags in the buffer on changes
1311
1312from [mpereira](https://github.com/mpereira/.emacs.d#align-all-tags-in-the-buffer-on-tag-changes).
1313
1314 (defun acdw/org-align-all-tags ()
1315 "Align all org tags in the buffer."
1316 (interactive)
1317 (when (eq major-mode 'org-mode)
1318 (org-align-tags t)))
1319
1320 (add-hook 'org-after-tags-change-hook #'acdw/org-align-all-tags)
1321
1322
1323#### Source blocks
1324
1325 (set-face-attribute 'org-block-begin-line nil
1326 :height 0.85)
1327
1328
1244#### Prettify 1329#### Prettify
1245 1330
1246 (defun acdw/org-mode-prettify () 1331 (defun acdw/org-mode-prettify ()
1247 "Prettify `org-mode'." 1332 "Prettify `org-mode'."
1248 (dolist (cell '(("[ ]" . ?) ("[X]" . ?☑) ("[-]" . ?◐) 1333 (dolist (cell '(("[ ]" . ?) ("[X]" . ?☑) ("[-]" . ?◐)
1249 ("#+begin_src" . ?✎) ("#+begin_src" . ?✎) 1334 ("#+BEGIN_SRC" . ?✎) ("#+begin_src" . ?✎)
1250 ("#+end_src" . ?■) ("#+end_src" . ?■))) 1335 ("#+END_SRC" . ?■) ("#+end_src" . ?■)))
1251 (add-to-list 'prettify-symbols-alist cell :append)) 1336 (add-to-list 'prettify-symbols-alist cell :append))
1252 (prettify-symbols-mode +1)) 1337 (prettify-symbols-mode +1))
1253 1338
@@ -1413,8 +1498,9 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
1413 1498
1414### Org Templates (`org-tempo`) 1499### Org Templates (`org-tempo`)
1415 1500
1416 (add-to-list 'org-structure-template-alist 1501 (with-eval-after-load 'org
1417 '("el" . "src emacs-lisp")) 1502 (add-to-list 'org-structure-template-alist
1503 '("el" . "src emacs-lisp")))
1418 1504
1419 1505
1420### Org Agenda 1506### Org Agenda
@@ -1429,6 +1515,9 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
1429 1515
1430 (define-key acdw/map (kbd "C-a") #'org-agenda) 1516 (define-key acdw/map (kbd "C-a") #'org-agenda)
1431 1517
1518 (cuss org-agenda-span 5
1519 "Show today + N days.")
1520
1432 (cuss org-todo-keywords 1521 (cuss org-todo-keywords
1433 '((sequence "RECUR(r)" "TODO(t)" "|" "DONE(d)") 1522 '((sequence "RECUR(r)" "TODO(t)" "|" "DONE(d)")
1434 (sequence "APPT(a)") 1523 (sequence "APPT(a)")
@@ -1438,9 +1527,100 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
1438 (cuss org-agenda-skip-deadline-if-done t) 1527 (cuss org-agenda-skip-deadline-if-done t)
1439 (cuss org-deadline-warning-days 0 1528 (cuss org-deadline-warning-days 0
1440 "Don't warn of an impending deadline.") 1529 "Don't warn of an impending deadline.")
1441 1530
1442 1531 (cuss org-log-into-drawer "LOGBOOK"
1443### TODO Capture 1532 "Log state changes into the LOGBOOK drawer, instead of after
1533 the headline.")
1534 (cuss org-log-done t
1535 "Save CLOSED timestamp when done.")
1536
1537
1538### Capture
1539
1540
1541#### Templates
1542
1543 (cuss org-default-notes-file (expand-file-name "inbox.org"
1544 org-directory)
1545 "Put unfiled notes in ~/Org/inbox.org.")
1546
1547
1548 (cuss org-capture-templates
1549 '(("w" "Work Todo") ;;; Work stuff
1550 ("ws" "Small Business" entry
1551 (file+headline "work.org" "Small Business")
1552 "* TODO %?
1553 :PROPERTIES:
1554 :Via:
1555 :Note:
1556 :END:
1557 :LOGBOOK:
1558 - State \"TODO\" from \"\" %U
1559 :END:" :empty-lines 1)
1560 ("wc" "Career Center" entry
1561 (file+headline "work.org" "Career Center")
1562 "* TODO %?
1563 :PROPERTIES:
1564 :Via:
1565 :Note:
1566 :END:
1567 :LOGBOOK:
1568 - State \"TODO\" from \"\" %U
1569 :END:" :empty-lines 1)
1570 ("wg" "General" entry
1571 (file+headline "work.org" "General")
1572 "* TODO %?
1573 :PROPERTIES:
1574 :Via:
1575 :Note:
1576 :END:
1577 :LOGBOOK:
1578 - State \"TODO\" from \"\" %U
1579 :END:" :empty-lines 1)
1580
1581 ;;; Regular To-Dos
1582 ("t" "Todo")
1583 ("tt" "Todo" entry
1584 (file+headline "home.org" "TODOs")
1585 "* TODO %?
1586 :PROPERTIES:
1587 :Via:
1588 :Note:
1589 :END:
1590 :LOGBOOK:
1591 - State \"TODO\" from \"\" %U
1592 :END:" :empty-lines 1)
1593
1594 ("td" "Todo with deadline" entry
1595 (file+headline "home.org" "TODOs")
1596 "* TODO %?
1597 DEADLINE: %^t
1598 :PROPERTIES:
1599 :Via:
1600 :Note:
1601 :END:
1602 :LOGBOOK:
1603 - State \"TODO\" from \"\" %U
1604 :END:" :empty-lines 1)
1605
1606
1607 ("g" "Gift idea" entry
1608 (file+headline "home.org" "Gift ideas")
1609 "* %^{Who?}
1610 * %^{What?}" :empty-lines 1)
1611
1612 ("d" "Diary entry" entry
1613 (file+datetree "diary.org")
1614 "* %?
1615 Entered on %U
1616
1617 " :empty-lines 1)))
1618
1619
1620#### Keybindings
1621
1622 (with-eval-after-load 'org-capture
1623 (define-key acdw/map (kbd "C-c") #'org-capture))
1444 1624
1445 1625
1446### Include Org links in source code 1626### Include Org links in source code
@@ -1742,9 +1922,19 @@ I’m only enabling this at home for now, since it requires building stuff.
1742 (list "ttrss+https://acdw@rss.tildeverse.org" 1922 (list "ttrss+https://acdw@rss.tildeverse.org"
1743 :use-authinfo t))) 1923 :use-authinfo t)))
1744 1924
1745 (setq elfeed-log-level 'debug) 1925 ;; Uncomment this line if elfeed is giving problems.
1926 ;; (setq elfeed-log-level 'debug)
1746 1927
1747 (elfeed-protocol-enable) 1928 (elfeed-protocol-enable)
1929
1930 (defun acdw/update-elfeed-protocol-feeds ()
1931 "Wrap various (non-working) protocol updaters.
1932 I could probably do this in a much more ... better way."
1933 (interactive)
1934 (elfeed-protocol-ttrss-reinit "https://rss.tildeverse.org"))
1935
1936 (with-eval-after-load 'elfeed
1937 (define-key elfeed-search-mode-map "G" #'acdw/update-elfeed-protocol-feeds))
1748 1938
1749 1939
1750# System integration 1940# System integration
@@ -1816,7 +2006,7 @@ I’m only enabling this at home for now, since it requires building stuff.
1816 (interactive "P") 2006 (interactive "P")
1817 (let ((config (expand-file-name "config.org" user-emacs-directory))) 2007 (let ((config (expand-file-name "config.org" user-emacs-directory)))
1818 (save-mark-and-excursion 2008 (save-mark-and-excursion
1819 (with-current-buffer (find-file config) 2009 (with-current-buffer (find-file-noselect config)
1820 (let ((prog-mode-hook nil)) 2010 (let ((prog-mode-hook nil))
1821 ;; generate the readme 2011 ;; generate the readme
1822 (when (file-newer-than-file-p config (expand-file-name 2012 (when (file-newer-than-file-p config (expand-file-name
@@ -1918,3 +2108,8 @@ GPL, for what should be fairly obvious reasons. To that, I say:
1918 2108
1919**SUE ME, RMS!** 2109**SUE ME, RMS!**
1920 2110
2111
2112## TODO Local variables
2113
2114One day, I’m going to add a Local Variables block to the end of this file, which will add an `after-save-hook` to auto-tangle the file after saving. But first I need to research how best to do that asynchronously. So.
2115