summary refs log tree commit diff stats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md160
1 files changed, 129 insertions, 31 deletions
diff --git a/README.md b/README.md index adf04f8..5bd0a6b 100644 --- a/README.md +++ b/README.md
@@ -332,6 +332,7 @@ from [EmacsWiki](https://www.emacswiki.org/emacs/AlarmBell#h5o-3).
332 332
333 (cuss sml/no-confirm-load-theme t 333 (cuss sml/no-confirm-load-theme t
334 "Pass the NO-CONFIRM flag to `load-theme'.") 334 "Pass the NO-CONFIRM flag to `load-theme'.")
335 (cuss sml/theme 'respectful)
335 336
336 (sml/setup) 337 (sml/setup)
337 338
@@ -411,15 +412,14 @@ helper function, though, to add things to the whitelist.
411 412
412#### Define fonts 413#### Define fonts
413 414
414 (defun set-face-from-alternatives (face fonts) 415 (defun set-face-from-alternatives (face frame &rest fontspecs)
416 "Set FACE on FRAME from first available spec from FONTSPECS.
417 FACE and FRAME work the same as with `set-face-attribute.'"
415 (catch :return 418 (catch :return
416 (dolist (font fonts) 419 (dolist (spec fontspecs)
417 (when (find-font (font-spec :family (car font))) 420 (when-let ((found (find-font (apply #'font-spec spec))))
418 (apply #'set-face-attribute `(,face 421 (set-face-attribute face frame :font found)
419 nil 422 (throw :return found)))))
420 :family (car font)
421 ,@(cdr font)))
422 (throw :return font)))))
423 423
424 (defun acdw/setup-fonts () 424 (defun acdw/setup-fonts ()
425 "Setup fonts. This has to happen after the frame is setup for 425 "Setup fonts. This has to happen after the frame is setup for
@@ -427,24 +427,27 @@ helper function, though, to add things to the whitelist.
427 removes itself from that hook." 427 removes itself from that hook."
428 (interactive) 428 (interactive)
429 (when (display-graphic-p) 429 (when (display-graphic-p)
430 (set-face-from-alternatives 'default 430 (dolist (face '(default fixed-pitch))
431 '(("Input Mono" 431 ;; fixed-pitch /is/ the default
432 :height 105) 432 (set-face-from-alternatives face nil
433 ("Go Mono" 433 '(:family "Input Mono"
434 :height 100) 434 :weight normal
435 ("Consolas" 435 :height 110)
436 :height 100))) 436 '(:family "Go Mono"
437 437 :weight normal
438 (set-face-from-alternatives 'fixed-pitch 438 :height 100)
439 '(("Input Mono") 439 '(:family "Consolas"
440 ("Go Mono") 440 :weight normal
441 ("Consolas"))) 441 :height 100)))
442 442 ;; variable-pitch is different
443 (set-face-from-alternatives 'variable-pitch 443 (set-face-from-alternatives 'variable-pitch nil
444 '(("Input Serif") 444 '(:family "Input Sans"
445 ("Georgia"))) 445 :weight normal)
446 446 '(:family "Georgia"
447 (remove-function after-focus-change-function #'acdw/setup-fonts))) 447 :weight normal)))
448
449 ;; remove myself from the hook
450 (remove-function after-focus-change-function #'acdw/setup-fonts))
448 451
449 (add-function :before after-focus-change-function #'acdw/setup-fonts) 452 (add-function :before after-focus-change-function #'acdw/setup-fonts)
450 453
@@ -843,6 +846,12 @@ I’ve pretty much cribbed this from [recentf-remove-sudo-tramp-prefix](https://
843 (global-visual-line-mode +1) 846 (global-visual-line-mode +1)
844 847
845 848
849### View long lines like filled lines in the beginning
850
851 (straight-use-package 'adaptive-wrap)
852 (adaptive-wrap-prefix-mode +1)
853
854
846### Stay snappy with long-lined files 855### Stay snappy with long-lined files
847 856
848 (when (fboundp 'global-so-long-mode) 857 (when (fboundp 'global-so-long-mode)
@@ -1008,6 +1017,12 @@ I’ve pretty much cribbed this from [recentf-remove-sudo-tramp-prefix](https://
1008 "Don't truncate printed expressions by level.") 1017 "Don't truncate printed expressions by level.")
1009 1018
1010 1019
1020### Janet
1021
1022 (straight-use-package 'janet-mode)
1023 (require 'janet-mode)
1024
1025
1011### INI 1026### INI
1012 1027
1013 (straight-use-package 'ini-mode) 1028 (straight-use-package 'ini-mode)
@@ -1105,6 +1120,12 @@ This has to be done *before* loading the package. It's included in `visual-fill
1105 1120
1106 ;; highlight the current line in dired. 1121 ;; highlight the current line in dired.
1107 (add-hook 'dired-mode-hook #'hl-line-mode) 1122 (add-hook 'dired-mode-hook #'hl-line-mode)
1123
1124 (cuss dired-recursive-copies 'always
1125 "Always recursively copy.")
1126
1127 (cuss dired-listing-switches "-alh"
1128 "Show All items, Listed out, with Human-readable sizes.")
1108 1129
1109 1130
1110### Expand subtrees 1131### Expand subtrees
@@ -1122,6 +1143,19 @@ This has to be done *before* loading the package. It's included in `visual-fill
1122 (add-hook 'dired-mode-hook #'dired-collapse-mode) 1143 (add-hook 'dired-mode-hook #'dired-collapse-mode)
1123 1144
1124 1145
1146### Kill dired buffers
1147
1148from [munen](https://github.com/munen/emacs.d/).
1149
1150 (defun kill-dired-buffers ()
1151 "Kill all open dired buffers."
1152 (interactive)
1153 (mapc (lambda (buffer)
1154 (when (eq 'dired-mode (buffer-local-value 'major-mode buffer))
1155 (kill-buffer buffer)))
1156 (buffer-list)))
1157
1158
1125## Org mode 1159## Org mode
1126 1160
1127I’ve put org mode under Applications, as opposed to Writing, because it’s more generally-applicable than that. 1161I’ve put org mode under Applications, as opposed to Writing, because it’s more generally-applicable than that.
@@ -1358,6 +1392,8 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
1358 1392
1359 (cuss org-agenda-skip-scheduled-if-done t) 1393 (cuss org-agenda-skip-scheduled-if-done t)
1360 (cuss org-agenda-skip-deadline-if-done t) 1394 (cuss org-agenda-skip-deadline-if-done t)
1395 (cuss org-deadline-warning-days 4
1396 "Warn of a deadline beginning four days before.")
1361 1397
1362 1398
1363### TODO Capture 1399### TODO Capture
@@ -1496,10 +1532,12 @@ I’m only enabling this at home for now, since it requires building stuff.
1496 "flag:unread AND NOT flag:trashed AND NOT maildir:/Spam" 1532 "flag:unread AND NOT flag:trashed AND NOT maildir:/Spam"
1497 :key ?u) 1533 :key ?u)
1498 (:name "Today" 1534 (:name "Today"
1499 :query "date:today..now and not and not flag:trashed maildir:/Spam" 1535 :query
1536 "date:today..now and not flag:trashed and not maildir:/Spam"
1500 :key ?t) 1537 :key ?t)
1501 (:name "This week" 1538 (:name "This week"
1502 :query "date:7d..now and not maildir:/Spam and not flag:trashed" 1539 :query
1540 "date:7d..now and not maildir:/Spam and not flag:trashed"
1503 :hide-unread t 1541 :hide-unread t
1504 :key ?w))) 1542 :key ?w)))
1505 1543
@@ -1523,9 +1561,11 @@ I’m only enabling this at home for now, since it requires building stuff.
1523 (add-hook 'mu4e-headers-mode #'acdw/setup-mu4e-headers-mode) 1561 (add-hook 'mu4e-headers-mode #'acdw/setup-mu4e-headers-mode)
1524 1562
1525 (defun acdw/setup-mu4e-view-mode () 1563 (defun acdw/setup-mu4e-view-mode ()
1564 (setq visual-fill-column-center-text t)
1526 (visual-fill-column-mode +1)) 1565 (visual-fill-column-mode +1))
1527 1566
1528 (add-hook 'mu4e-view-mode-hook #'acdw/setup-mu4e-view-mode) 1567 (add-hook 'mu4e-view-mode-hook #'acdw/setup-mu4e-view-mode)
1568 (add-hook 'mu4e-compose-mode-hook #'acdw/setup-mu4e-view-mode)
1529 1569
1530 (cuss mu4e-get-mail-command (cond ((executable-find "mbsync") 1570 (cuss mu4e-get-mail-command (cond ((executable-find "mbsync")
1531 "mbsync -a")) 1571 "mbsync -a"))
@@ -1626,6 +1666,60 @@ I’m only enabling this at home for now, since it requires building stuff.
1626 ;; TODO : add tokens ... somehow 1666 ;; TODO : add tokens ... somehow
1627 1667
1628 1668
1669## RSS
1670
1671
1672### elfeed
1673
1674 (straight-use-package 'elfeed)
1675 (require 'elfeed)
1676 (define-key acdw/map "w" 'elfeed)
1677
1678 (cuss elfeed-use-curl (executable-find "curl"))
1679 (cuss elfeed-curl-extra-arguments '("--insecure")
1680 "Extra arguments for curl.")
1681 (elfeed-set-timeout (* 60 3))
1682
1683 (defun acdw/setup-elfeed-show ()
1684 (setq visual-fill-column-center-text t)
1685 (visual-fill-column-mode +1))
1686
1687 (add-hook 'elfeed-show-mode-hook #'acdw/setup-elfeed-show)
1688
1689
1690### elfeed-protocol
1691
1692 (straight-use-package 'elfeed-protocol)
1693 (require 'elfeed-protocol)
1694
1695 (cuss elfeed-protocol-ttrss-maxsize 200)
1696
1697 (cuss elfeed-feeds (list
1698 (list "ttrss+https://acdw@rss.tildeverse.org"
1699 :use-authinfo t)))
1700
1701 (setq elfeed-log-level 'debug)
1702
1703 (elfeed-protocol-enable)
1704
1705
1706# System integration
1707
1708
1709## Linux
1710
1711
1712### Exec path from shell
1713
1714 (at-home
1715 (straight-use-package 'exec-path-from-shell)
1716 (defvar acdw/exec-path-from-shell-initialized nil
1717 "Stores whether we've initialized or not.")
1718 (unless acdw/exec-path-from-shell-initialized
1719 (exec-path-from-shell-initialize)
1720 (setq acdw/exec-path-from-shell-initialized (current-time))))
1721
1722
1629# Appendices 1723# Appendices
1630 1724
1631 1725
@@ -1648,9 +1742,11 @@ I’m only enabling this at home for now, since it requires building stuff.
1648 (conf-org (concat conf ".org"))) 1742 (conf-org (concat conf ".org")))
1649 (unless (and (file-newer-than-file-p conf-el conf-org) 1743 (unless (and (file-newer-than-file-p conf-el conf-org)
1650 (load conf 'no-error)) 1744 (load conf 'no-error))
1651 ;; A plain require here just loads the older `org' in Emacs' install dir. We 1745 ;; A plain require here just loads the older `org'
1652 ;; need to add the newer one to the `load-path', hopefully that's all. 1746 ;; in Emacs' install dir. We need to add the newer
1653 (add-to-list 'load-path (expand-file-name "straight/build/org/")) 1747 ;; one to the `load-path', hopefully that's all.
1748 (add-to-list 'load-path (expand-file-name "straight/build/org"
1749 user-emacs-directory))
1654 (require 'org) 1750 (require 'org)
1655 (org-babel-load-file conf-org))) 1751 (org-babel-load-file conf-org)))
1656 1752
@@ -1691,6 +1787,8 @@ I’m only enabling this at home for now, since it requires building stuff.
1691 "config.el" 1787 "config.el"
1692 user-emacs-directory)) 1788 user-emacs-directory))
1693 (message "%s" "Tangling config.org...") 1789 (message "%s" "Tangling config.org...")
1790 (add-to-list 'load-path (expand-file-name "straight/build/org/"
1791 user-emacs-directory))
1694 (require 'org) 1792 (require 'org)
1695 (let ((inits (org-babel-tangle))) 1793 (let ((inits (org-babel-tangle)))
1696 ;; byte-compile resulting files 1794 ;; byte-compile resulting files