summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el182
-rw-r--r--lisp/+ace-window.el17
-rw-r--r--lisp/+modeline.el142
-rw-r--r--lisp/+org.el1
-rw-r--r--lisp/+setup.el2
-rw-r--r--lisp/+tab-bar.el19
6 files changed, 253 insertions, 110 deletions
diff --git a/init.el b/init.el index f6ed814..0653796 100644 --- a/init.el +++ b/init.el
@@ -45,9 +45,15 @@
45 ;; "C-x t" #'beginning-of-buffer 45 ;; "C-x t" #'beginning-of-buffer
46 ;; "C-x e" #'end-of-buffer 46 ;; "C-x e" #'end-of-buffer
47 ) 47 )
48 ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults 48 ;; ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults
49 (global-set-key (kbd "C-h") 'delete-backward-char) 49 (global-set-key (kbd "C-h") 'delete-backward-char)
50 (keyboard-translate ?\C-h ?\C-?) 50 (keyboard-translate ?\C-h ?\C-?)
51 ;; Faces
52 (dolist (face '(line-number
53 line-number-major-tick
54 line-number-minor-tick
55 line-number-current-line))
56 (:face face '((t (:inherit fixed-pitch)))))
51 ;; Hooks 57 ;; Hooks
52 (add-hook 'prog-mode-hook #'turn-on-auto-fill) 58 (add-hook 'prog-mode-hook #'turn-on-auto-fill)
53 (add-hook 'prog-mode-hook #'font-lock-todo-insinuate) 59 (add-hook 'prog-mode-hook #'font-lock-todo-insinuate)
@@ -72,6 +78,9 @@
72 (:local-set truncate-lines t))) 78 (:local-set truncate-lines t)))
73 79
74(setup (:require autoinsert) 80(setup (:require autoinsert)
81 (auto-insert-mode +1))
82
83(setup (:require autoinsert)
75 (setf (alist-get "\\.scm" auto-insert-alist nil nil #'equal) 84 (setf (alist-get "\\.scm" auto-insert-alist nil nil #'equal)
76 '(insert "#!/bin/sh\n#| -*- scheme -*-\nexec csi -s $0 \"$@\"\n|#\n")) 85 '(insert "#!/bin/sh\n#| -*- scheme -*-\nexec csi -s $0 \"$@\"\n|#\n"))
77;; (auto-insert-mode +1) 86;; (auto-insert-mode +1)
@@ -91,7 +100,8 @@
91 (dolist (var '(safe-local-variable-values 100 (dolist (var '(safe-local-variable-values
92 warning-suppress-types)) 101 warning-suppress-types))
93 (add-to-list '+custom-variable-allowlist var)) 102 (add-to-list '+custom-variable-allowlist var))
94 (+custom-load-ignoring-most-customizations) 103 (+ensure-after-init
104 (+custom-load-ignoring-most-customizations))
95 (advice-add #'custom-buffer-create-internal :after #'+cus-edit-expand-widgets) 105 (advice-add #'custom-buffer-create-internal :after #'+cus-edit-expand-widgets)
96 (:with-mode Custom-mode 106 (:with-mode Custom-mode
97 (:local-set imenu-generic-expression +cus-edit-imenu-generic-expression))) 107 (:local-set imenu-generic-expression +cus-edit-imenu-generic-expression)))
@@ -107,7 +117,7 @@
107 pulse-delay 0.5 117 pulse-delay 0.5
108 pulse-iterations 1) 118 pulse-iterations 1)
109 (dolist (command '(+ace-window-or-switch-buffer 119 (dolist (command '(+ace-window-or-switch-buffer
110 pop-mark pop-globl-mark)) 120 pop-mark pop-global-mark))
111 (add-to-list '+pulse-location-commands command)) 121 (add-to-list '+pulse-location-commands command))
112 (+ensure-after-init #'+pulse-location-mode)) 122 (+ensure-after-init #'+pulse-location-mode))
113 123
@@ -125,9 +135,9 @@
125(setup +key 135(setup +key
126 (+ensure-after-init #'+key-global-mode)) 136 (+ensure-after-init #'+key-global-mode))
127 137
128;;(setup _work 138(setup _work
129;; (+with-ensure-after-init 139 (+with-ensure-after-init
130;; (require '_work))) 140 (require '_work)))
131 141
132(setup abbrev 142(setup abbrev
133 (:option abbrev-file-name (sync/ "abbrev.el") 143 (:option abbrev-file-name (sync/ "abbrev.el")
@@ -485,7 +495,7 @@
485 495
486(setup notmuch 496(setup notmuch
487 (:load-from "~/usr/share/emacs/site-lisp/") 497 (:load-from "~/usr/share/emacs/site-lisp/")
488 (:load-after org-contacts) 498 (:load-after bbdb)
489 (:also-load +notmuch +message) 499 (:also-load +notmuch +message)
490 (+define-dir notmuch/ (sync/ "emacs/notmuch") 500 (+define-dir notmuch/ (sync/ "emacs/notmuch")
491 "Notmuch configuration and data.") 501 "Notmuch configuration and data.")
@@ -529,7 +539,9 @@
529 (list :name "drafts" :query "tag:draft" :key "d") 539 (list :name "drafts" :query "tag:draft" :key "d")
530 (list :name "all mail" :query "*" :key "a")))) 540 (list :name "all mail" :query "*" :key "a"))))
531 (:+leader "m" #'+notmuch-goto "C-m" #'+notmuch-goto 541 (:+leader "m" #'+notmuch-goto "C-m" #'+notmuch-goto
532 "n" #'notmuch "C-n" #'notmuch)) 542 "n" #'notmuch "C-n" #'notmuch)
543 ;; For `focus'
544 (put 'notmuch-message 'bounds-of-thing-at-point 'notmuch-show-message-extent))
533 545
534(setup org 546(setup org
535 ;; Plain org with the `setup' form for sorting, but I install with straight. 547 ;; Plain org with the `setup' form for sorting, but I install with straight.
@@ -552,6 +564,7 @@
552 load-path)) 564 load-path))
553 (:also-load +org) 565 (:also-load +org)
554 (:option org-adapt-indentation nil 566 (:option org-adapt-indentation nil
567 org-auto-align-tags t
555 org-archive-mark-done t 568 org-archive-mark-done t
556 org-catch-invisible-edits 'show-and-error 569 org-catch-invisible-edits 'show-and-error
557 org-clock-clocked-in-display 'mode-line 570 org-clock-clocked-in-display 'mode-line
@@ -575,6 +588,7 @@
575 org-imenu-depth 3 588 org-imenu-depth 3
576 org-indent-indentation-per-level 0 589 org-indent-indentation-per-level 0
577 org-indent-mode-turns-on-hiding-stars nil 590 org-indent-mode-turns-on-hiding-stars nil
591 org-insert-heading-respect-content t
578 org-list-demote-modify-bullet '(("-" . "+") 592 org-list-demote-modify-bullet '(("-" . "+")
579 ("+" . "-")) 593 ("+" . "-"))
580 org-log-done 'time 594 org-log-done 'time
@@ -595,7 +609,7 @@
595 org-src-window-setup 'current-window 609 org-src-window-setup 'current-window
596 org-startup-truncated nil 610 org-startup-truncated nil
597 org-startup-with-inline-images t 611 org-startup-with-inline-images t
598 org-tags-column (- (- fill-column (length org-ellipsis))) 612 org-tags-column 1 ;; (- (- fill-column (length org-ellipsis)))
599 org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)" 613 org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)"
600 "|" "DONE(d!)") 614 "|" "DONE(d!)")
601 (sequence "|" "CANCELED(k@)") 615 (sequence "|" "CANCELED(k@)")
@@ -621,13 +635,25 @@
621 "C-c l" #'org-store-link) 635 "C-c l" #'org-store-link)
622 (:hook #'variable-pitch-mode 636 (:hook #'variable-pitch-mode
623 #'turn-off-auto-fill 637 #'turn-off-auto-fill
624 #'org-indent-mode) 638 #'org-indent-mode
639 #'prettify-symbols-mode
640 ;; TODO: This is only the beginning of a larger idea: I really want the
641 ;; "buffer stats" section of the mode-line to change depending on the
642 ;; mode. So like, org-mode would be a word count (maybe other text
643 ;; modes?), lui-modes could be .... something? etc.
644 (defun turn-off-column-number-mode () (setq-local column-number-mode nil)))
645 (:local-set prettify-symbols-alist '(("DEADLINE:" . ?⏰)
646 ("SCHEDULED:" . ?📅)
647 ("CLOSED:" ?✅))
648 ;;+modeline-position-function #'+org-count-words-stupidly
649 )
625 (:local-hook user-save-hook #'+org-before-save@prettify-buffer) 650 (:local-hook user-save-hook #'+org-before-save@prettify-buffer)
626 (advice-add #'org-delete-backward-char :override #'+org-delete-backward-char) 651 (advice-add #'org-delete-backward-char :override #'+org-delete-backward-char)
627 ;; (define-advice org-open-at-point (:around (fn &rest r) open-external) 652 ;; (define-advice org-open-at-point (:around (fn &rest r) open-external)
628 ;; "Open links from org externally." 653 ;; "Open links from org externally."
629 ;; (let ((browse-url-browser-function browse-url-secondary-browser-function)) 654 ;; (let ((browse-url-browser-function browse-url-secondary-browser-function))
630 ;; (apply fn r))) 655 ;; (apply fn r)))
656 ;; (add-to-list '+custom-variable-allowlist 'org-agenda-files)
631 (with-eval-after-load 'org 657 (with-eval-after-load 'org
632 (setf (alist-get "\\.x?html?\\'" org-file-apps nil nil #'equal) 658 (setf (alist-get "\\.x?html?\\'" org-file-apps nil nil #'equal)
633 #'+org-open-html) 659 #'+org-open-html)
@@ -653,11 +679,10 @@
653 (0 ;; (progn (compose-region (match-beginning 1) (match-end 1) "→") 'fixed-pitch) 679 (0 ;; (progn (compose-region (match-beginning 1) (match-end 1) "→") 'fixed-pitch)
654 'fixed-pitch t)) 680 'fixed-pitch t))
655 ;; Fancy numbered lists (well, monospaced) 681 ;; Fancy numbered lists (well, monospaced)
656 ("^[ \t]*\\(\\(?:[0-9]+\\|[A-Za-z]\\)[.)]\\) " 0 'fixed-pitch t))) 682 ("^[ \t]*\\(\\(?:[0-9]+\\|[A-Za-z]\\)[.)]\\) " 0 'fixed-pitch t)
657 ;; Make nobreak-space fixed-pitch as well, for better alignment (is this the 683 ;; Make leading org-heading stars fixed-pitch
658 ;; best way to do this? probably not!) 684 ("^\*+ " 0 'fixed-pitch t)
659 (:face org-indent ((t (:inherit (fixed-pitch)))) 685 ))
660 nobreak-space ((t (:inherit (fixed-pitch)))))
661 (with-eval-after-load 'form-feed 686 (with-eval-after-load 'form-feed
662 ;; Horizontal lines 687 ;; Horizontal lines
663 (font-lock-add-keywords 688 (font-lock-add-keywords
@@ -672,6 +697,13 @@
672 (:option org-agenda-skip-deadline-if-done t 697 (:option org-agenda-skip-deadline-if-done t
673 org-agenda-skip-scheduled-if-done t 698 org-agenda-skip-scheduled-if-done t
674 org-agenda-span 10 699 org-agenda-span 10
700 org-agenda-block-separator ?─
701 org-agenda-time-grid
702 '((daily today require-timed)
703 (800 1000 1200 1400 1600 1800 2000)
704 " ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄")
705 org-agenda-current-time-string
706 "← now ─────────────────────────────────────────────────"
675 org-agenda-include-diary nil ; I use the org-diary features 707 org-agenda-include-diary nil ; I use the org-diary features
676 org-agenda-todo-ignore-deadlines 'near 708 org-agenda-todo-ignore-deadlines 'near
677 org-agenda-todo-ignore-scheduled 'future 709 org-agenda-todo-ignore-scheduled 'future
@@ -679,12 +711,12 @@
679 org-deadline-warning-days 0 711 org-deadline-warning-days 0
680 org-agenda-show-future-repeats 'next 712 org-agenda-show-future-repeats 'next
681 org-agenda-window-setup 'current-window) 713 org-agenda-window-setup 'current-window)
714 (unless after-init-time
715 (:option org-agenda-files (list (sync/ "org/"))))
682 (dolist (var '(org-agenda-files 716 (dolist (var '(org-agenda-files
683 org-agenda-file-regexp 717 org-agenda-file-regexp
684 org-agenda-templates)) 718 org-agenda-templates))
685 (add-to-list '+custom-variable-allowlist var)) 719 (add-to-list '+custom-variable-allowlist var))
686 (with-eval-after-load 'org
687 (add-to-list 'org-agenda-files (sync/ "org/" t)))
688 (:+leader "a" #'org-agenda "C-a" #'org-agenda) 720 (:+leader "a" #'org-agenda "C-a" #'org-agenda)
689 (:hook #'hl-line-mode) 721 (:hook #'hl-line-mode)
690 (add-hook 'org-agenda-after-show-hook 'org-narrow-to-subtree)) 722 (add-hook 'org-agenda-after-show-hook 'org-narrow-to-subtree))
@@ -770,6 +802,9 @@
770 (:option password-cache t 802 (:option password-cache t
771 password-cache-expiry (* 60 60))) 803 password-cache-expiry (* 60 60)))
772 804
805(setup prettify-symbols-mode
806 (:option prettify-symbols-unprettify-at-point t))
807
773(setup prog 808(setup prog
774 (:local-set comment-auto-fill-only-comments t) 809 (:local-set comment-auto-fill-only-comments t)
775 (:hook #'prettify-symbols-mode)) 810 (:hook #'prettify-symbols-mode))
@@ -815,7 +850,7 @@
815 tab-bar-format-tabs 850 tab-bar-format-tabs
816 tab-bar-separator 851 tab-bar-separator
817 tab-bar-format-add-tab 852 tab-bar-format-add-tab
818 tab-bar-format-align-right 853 +tab-bar-format-align-right
819 ;;+tab-bar-misc-info 854 ;;+tab-bar-misc-info
820 +tab-bar-org-clock 855 +tab-bar-org-clock
821 +tab-bar-bongo 856 +tab-bar-bongo
@@ -852,9 +887,10 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers."
852 (:require +ace-window) 887 (:require +ace-window)
853 (:option aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l) 888 (:option aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
854 aw-display-mode-overlay nil 889 aw-display-mode-overlay nil
855 aw-scope 'frame) 890 aw-scope 'frame
891 aw-minibuffer-flag t)
856 (:+key "M-o" #'+ace-window-or-switch-buffer) 892 (:+key "M-o" #'+ace-window-or-switch-buffer)
857 (:face aw-mode-line-face ((t (:foreground "red")))) 893 (:face 'aw-mode-line-face '((t (:foreground "red"))))
858 (+ace-window-display-mode +1)) 894 (+ace-window-display-mode +1))
859 895
860(setup (:straight (actually-selected-window 896(setup (:straight (actually-selected-window
@@ -902,8 +938,8 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers."
902 '(avy-lead-face 938 '(avy-lead-face
903 avy-lead-face-1 avy-lead-face-1 avy-lead-face-1 939 avy-lead-face-1 avy-lead-face-1 avy-lead-face-1
904 avy-lead-face-1 avy-lead-face-1 avy-lead-face-1)) 940 avy-lead-face-1 avy-lead-face-1 avy-lead-face-1))
905 (:face avy-background-face 941 (:face 'avy-background-face
906 ((t (:foreground "#888888")))) 942 '((t (:foreground "#888888"))))
907 (:+key "M-j" #'avy-goto-char-timer) 943 (:+key "M-j" #'avy-goto-char-timer)
908 (:bind-into isearch 944 (:bind-into isearch
909 "M-j" #'avy-isearch) 945 "M-j" #'avy-isearch)
@@ -1126,11 +1162,11 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers."
1126 (0x0-upload-text (0x0--choose-server))) 1162 (0x0-upload-text (0x0--choose-server)))
1127 (current-kill 0))) 1163 (current-kill 0)))
1128 (add-to-list '+pulse-location-commands #'lui-track-jump-to-indicator) 1164 (add-to-list '+pulse-location-commands #'lui-track-jump-to-indicator)
1129 (:face lui-track-bar ((t (:height 10 1165 (:face 'lui-track-bar '((t ( :height 10
1130 :underline (:color foreground-color 1166 :underline ( :color foreground-color
1131 :style line 1167 :style line
1132 :position line) 1168 :position line)
1133 :extend t :inhert (default))))) 1169 :extend t :inhert (default)))))
1134 (:hook #'visual-line-mode 1170 (:hook #'visual-line-mode
1135 #'enable-lui-track 1171 #'enable-lui-track
1136 #'visual-fill-column-mode 1172 #'visual-fill-column-mode
@@ -1305,9 +1341,9 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers."
1305 (:hook #'turn-off-+key-mode) 1341 (:hook #'turn-off-+key-mode)
1306 (:option crossword-save-path (sync/ "emacs/crosswords/" t) 1342 (:option crossword-save-path (sync/ "emacs/crosswords/" t)
1307 crossword-empty-position-char "=") 1343 crossword-empty-position-char "=")
1308 (:face crossword-grid-face ((t :inherit 'font-lock-string-face)) 1344 (:face 'crossword-grid-face '((t :inherit 'font-lock-string-face))
1309 crossword-current-face ((t :inherit 'highlight)) 1345 'crossword-current-face '((t :inherit 'highlight))
1310 crossword-other-dir-face ((t :inherit 'font-lock-keyword-face)))) 1346 'crossword-other-dir-face '((t :inherit 'font-lock-keyword-face))))
1311 1347
1312(setup (:straight crux) 1348(setup (:straight crux)
1313 ;; yes it's silly I have an addon to this addon. 1349 ;; yes it's silly I have an addon to this addon.
@@ -1531,7 +1567,7 @@ See also `crux-reopen-as-root-mode'."
1531(setup (:straight (filldent 1567(setup (:straight (filldent
1532 :host github 1568 :host github
1533 :repo "duckwork/filldent.el")) 1569 :repo "duckwork/filldent.el"))
1534 (:+key "M-q" #'filldent-dwim)) 1570 (:+key "M-q" #'filldent-unfill-toggle))
1535 1571
1536(setup (:straight (flymake-collection 1572(setup (:straight (flymake-collection
1537 :host github 1573 :host github
@@ -1550,6 +1586,21 @@ See also `crux-reopen-as-root-mode'."
1550 (with-eval-after-load 'vertico-multiform 1586 (with-eval-after-load 'vertico-multiform
1551 (setf (alist-get 'flyspell vertico-multiform-categories) nil))) 1587 (setf (alist-get 'flyspell vertico-multiform-categories) nil)))
1552 1588
1589(setup (:straight focus)
1590 (:require)
1591 (add-hook 'modus-themes-after-load-theme-hook
1592 (defun focus-update@after-modus-load ()
1593 (modus-themes-with-colors
1594 (:face 'focus-unfocused `((t ( :foreground ,fg-inactive
1595 :background ,bg-inactive
1596 :weight normal
1597 :slant normal
1598 :extend t)))))))
1599 ;; XXX: This doesn't work, because notmuch overlays shit on the buffer
1600 (setf (alist-get 'notmuch-show-mode focus-mode-to-thing)
1601 'notmuch-message)
1602 (:hook-into notmuch-show-mode))
1603
1553(setup (:straight-when (forge 1604(setup (:straight-when (forge
1554 :host github :repo "magit/forge") 1605 :host github :repo "magit/forge")
1555 (eq system-type 'gnu/linux)) 1606 (eq system-type 'gnu/linux))
@@ -1582,7 +1633,9 @@ See also `crux-reopen-as-root-mode'."
1582 scheme-complete) 1633 scheme-complete)
1583 (:require +chicken) 1634 (:require +chicken)
1584 (setf (alist-get "\\.scm\\'" auto-mode-alist nil nil #'string=) 1635 (setf (alist-get "\\.scm\\'" auto-mode-alist nil nil #'string=)
1585 'scheme-mode)) 1636 'scheme-mode)
1637 (setf (alist-get "\\.scm\\'" auto-mode-alist nil nil #'string=)
1638 '(insert "#!/bin/sh\n#| -*- scheme -*-\nexec csi -s $0 \"$@\"\n|#\n")))
1586 1639
1587(setup (:straight (git-modes 1640(setup (:straight (git-modes
1588 :host github :repo "magit/git-modes")) 1641 :host github :repo "magit/git-modes"))
@@ -1674,9 +1727,9 @@ See also `crux-reopen-as-root-mode'."
1674 :host nil))) 1727 :host nil)))
1675 (:also-load +jabber) 1728 (:also-load +jabber)
1676 (:option jabber-account-list '(("acdw@hmm.st")) 1729 (:option jabber-account-list '(("acdw@hmm.st"))
1677 jabber-groupchat-buffer-format "xmpp:%n" 1730 jabber-groupchat-buffer-format "X:%n"
1678 jabber-chat-buffer-format "xmpp:%n" 1731 jabber-chat-buffer-format "X:%n"
1679 jabber-muc-private-buffer-format "xmpp:%n(%g)" 1732 jabber-muc-private-buffer-format "X:%n(%g)"
1680 jabber-activity-show-p #'ignore 1733 jabber-activity-show-p #'ignore
1681 jabber-muc-decorate-presence-patterns 1734 jabber-muc-decorate-presence-patterns
1682 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$") 1735 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$")
@@ -1804,7 +1857,7 @@ See also `crux-reopen-as-root-mode'."
1804 :fork (:host github :repo "duckwork/mode-line-bell" 1857 :fork (:host github :repo "duckwork/mode-line-bell"
1805 :branch "remap-face"))) 1858 :branch "remap-face")))
1806 ;; This is still, annoyingly, not quite working right. 1859 ;; This is still, annoyingly, not quite working right.
1807 (:face mode-line-bell ((t (:inherit mode-line-highlight)))) 1860 (:face 'mode-line-bell '((t (:inherit mode-line-highlight))))
1808 (:option mode-line-bell-flash-time 0.1) 1861 (:option mode-line-bell-flash-time 0.1)
1809 (mode-line-bell-mode +1)) 1862 (mode-line-bell-mode +1))
1810 1863
@@ -1812,11 +1865,10 @@ See also `crux-reopen-as-root-mode'."
1812 :host gitlab 1865 :host gitlab
1813 :repo "protesilaos/modus-themes")) 1866 :repo "protesilaos/modus-themes"))
1814 (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes")) 1867 (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes"))
1815 (:also-load dawn)
1816 (:option modus-themes-mixed-fonts t 1868 (:option modus-themes-mixed-fonts t
1817 modus-themes-bold-constructs t 1869 modus-themes-bold-constructs t
1818 modus-themes-italic-constructs t 1870 modus-themes-italic-constructs t
1819 modus-themes-headings '((t . (background regular rainbow)))) 1871 modus-themes-headings '((t t)))
1820 (dotimes (facen-1 8) 1872 (dotimes (facen-1 8)
1821 (let ((facen (1+ facen-1))) 1873 (let ((facen (1+ facen-1)))
1822 (custom-set-faces 1874 (custom-set-faces
@@ -1825,9 +1877,16 @@ See also `crux-reopen-as-root-mode'."
1825 (,(intern (format "modus-themes-heading-%s" facen)) 1877 (,(intern (format "modus-themes-heading-%s" facen))
1826 fixed-pitch)) 1878 fixed-pitch))
1827 :now))))) 1879 :now)))))
1828 (:face modus-themes-tab-active ((t :bold nil)) 1880 (:face 'modus-themes-tab-active '((t :bold nil))
1829 modus-themes-tab-inactive ((t :italic t))) 1881 'modus-themes-tab-inactive '((t :italic t)))
1830 1882
1883 ;; Fix a "nil is not a Modus theme" error
1884 ;; XXX: Need to register a bug report
1885 (define-advice modus-themes--current-theme (:around (fn &rest r))
1886 (or (apply fn r)
1887 'modus-operandi))
1888
1889 ;; This needs to be after the themes are loaded, I think.
1831 (add-hook 'modus-themes-after-load-theme-hook 1890 (add-hook 'modus-themes-after-load-theme-hook
1832 (defun +modus-themes-mostly-monochrome () 1891 (defun +modus-themes-mostly-monochrome ()
1833 "Set up mdous-themes to be mostly monochrome." 1892 "Set up mdous-themes to be mostly monochrome."
@@ -1861,6 +1920,7 @@ See also `crux-reopen-as-root-mode'."
1861 :foreground ,fg-header 1920 :foreground ,fg-header
1862 :background ,yellow-intense-bg))))))) 1921 :background ,yellow-intense-bg)))))))
1863 1922
1923 (require 'dawn)
1864 (dawn-schedule #'modus-themes-load-operandi 1924 (dawn-schedule #'modus-themes-load-operandi
1865 #'modus-themes-load-vivendi)) 1925 #'modus-themes-load-vivendi))
1866 1926
@@ -1930,9 +1990,19 @@ See also `crux-reopen-as-root-mode'."
1930 (defun org-mime-setup@org-mode () 1990 (defun org-mime-setup@org-mode ()
1931 (local-set-key (kbd "C-c M-o") 'org-mime-org-buffer-htmlize)))) 1991 (local-set-key (kbd "C-c M-o") 'org-mime-org-buffer-htmlize))))
1932 1992
1933(setup (:straight org-sticky-header) 1993(setup (:straight org-modern)
1934 ;; (:hook-into org-mode) 1994 (:option org-modern-hide-stars nil
1935 ) 1995 org-modern-star nil
1996 org-modern-list nil)
1997 (:face 'org-modern-label '((t ( :height 1.0
1998 :weight regular
1999 :underline nil
2000 :inherit fixed-pitch))))
2001 (advice-add 'org-modern--update-label-face :override #'ignore)
2002 (:hook-into org-mode))
2003
2004(setup (:straight org-sticky-header) (:quit)
2005 (:hook-into org-mode))
1936 2006
1937(setup (:straight (org-taskwise 2007(setup (:straight (org-taskwise
1938 :host github 2008 :host github
@@ -2018,6 +2088,8 @@ See also `crux-reopen-as-root-mode'."
2018(setup (:straight rainbow-mode) 2088(setup (:straight rainbow-mode)
2019 (:hook-into prog-mode)) 2089 (:hook-into prog-mode))
2020 2090
2091(setup (:straight restart-emacs))
2092
2021(setup (:straight (shell-command+ 2093(setup (:straight (shell-command+
2022 :host nil 2094 :host nil
2023 :repo "https://git.sr.ht/~pkal/shell-command-plus")) 2095 :repo "https://git.sr.ht/~pkal/shell-command-plus"))
@@ -2037,14 +2109,10 @@ See also `crux-reopen-as-root-mode'."
2037 (readonly . "=") 2109 (readonly . "=")
2038 (modified . "+") 2110 (modified . "+")
2039 (t . "-")) 2111 (t . "-"))
2040 ;; '((ephemeral . "🥞")
2041 ;; (special . "🥐")
2042 ;; (readonly . "🦞")
2043 ;; (modified . "🥪")
2044 ;; (t . "🍞"))
2045
2046 +modeline-minions-icon ";" 2112 +modeline-minions-icon ";"
2047 simple-modeline-segments 2113 +modeline-buffer-name-max-length 0.35)
2114 ;; Segments
2115 (:option simple-modeline-segments
2048 `(( ; left 2116 `(( ; left
2049 +modeline-ace-window-display 2117 +modeline-ace-window-display
2050 +modeline-modified 2118 +modeline-modified
@@ -2070,10 +2138,7 @@ See also `crux-reopen-as-root-mode'."
2070 +modeline-narrowed) 2138 +modeline-narrowed)
2071 ",") 2139 ",")
2072 +modeline-input-method 2140 +modeline-input-method
2073 ,(+modeline-concat 2141 +modeline-position
2074 '(+modeline-region
2075 +modeline-line-column
2076 +modeline-file-percentage))
2077 ))) 2142 )))
2078 (simple-modeline-mode +1)) 2143 (simple-modeline-mode +1))
2079 2144
@@ -2201,10 +2266,7 @@ See also `crux-reopen-as-root-mode'."
2201 (:require) 2266 (:require)
2202 (:hook-into text-mode prog-mode)) 2267 (:hook-into text-mode prog-mode))
2203 2268
2204(setup (:straight unfill)) 2269(setup (:straight unfill)) ;; XXX: Is this necessary with changes to filldent?
2205
2206(setup (:straight valign)
2207 (:hook-into org-mode))
2208 2270
2209(setup (:straight valign) (:quit "Doesn't work with narrowed tables.") 2271(setup (:straight valign) (:quit "Doesn't work with narrowed tables.")
2210 (:option valign-fancy-bar t) 2272 (:option valign-fancy-bar t)
@@ -2325,7 +2387,9 @@ See also `crux-reopen-as-root-mode'."
2325 "https://invidious.snopyta.org")) 2387 "https://invidious.snopyta.org"))
2326 (:bind "y" #'+ytdious-watch)) 2388 (:bind "y" #'+ytdious-watch))
2327 2389
2328(setup (:straight zoom-frm)) 2390(setup (:straight zoom-frm)
2391 (:+key "M-+" #'zoom-frm-in
2392 "M-_" #'zoom-frm-out))
2329 2393
2330(setup (:straight zzz-to-char) 2394(setup (:straight zzz-to-char)
2331 (:require +zzz-to-char) 2395 (:require +zzz-to-char)
diff --git a/lisp/+ace-window.el b/lisp/+ace-window.el index fca27d9..9e631a2 100644 --- a/lisp/+ace-window.el +++ b/lisp/+ace-window.el
@@ -10,15 +10,21 @@
10 ;; This is stolen from ace-window.el but with the mode-line stuff ripped out. 10 ;; This is stolen from ace-window.el but with the mode-line stuff ripped out.
11 :global t 11 :global t
12 (if +ace-window-display-mode 12 (if +ace-window-display-mode
13 (progn 13 (progn ; Enable
14 (aw-update) 14 (aw-update)
15 (force-mode-line-update t) 15 (force-mode-line-update t)
16 (add-hook 'window-configuration-change-hook 'aw-update) 16 (add-hook 'window-configuration-change-hook 'aw-update)
17 (add-hook 'after-make-frame-functions 'aw--after-make-frame t) 17 (add-hook 'after-make-frame-functions 'aw--after-make-frame t)
18 (advice-add 'aw--lead-overlay :override 'ignore)) 18 (advice-add 'aw--lead-overlay :override 'ignore))
19 (remove-hook 'window-configuration-change-hook 'aw-update) 19 (progn ; Disable
20 (remove-hook 'after-make-frame-functions 'aw--after-make-frame) 20 (remove-hook 'window-configuration-change-hook 'aw-update)
21 (advice-remove 'aw--lead-overlay 'ignore))) 21 (remove-hook 'after-make-frame-functions 'aw--after-make-frame)
22 (advice-remove 'aw--lead-overlay 'ignore))))
23
24;; (defun +ace-window--mode-line-hint (path leaf)
25;; (let ((wnd (cdr leaf)))
26;; (with-selected-window wnd
27;; ())))
22 28
23;;;###autoload 29;;;###autoload
24(defun +ace-window-or-switch-buffer (arg) 30(defun +ace-window-or-switch-buffer (arg)
@@ -30,8 +36,5 @@ Switch to most recent buffer otherwise."
30 (switch-to-buffer nil) 36 (switch-to-buffer nil)
31 (ace-window arg))) 37 (ace-window arg)))
32 38
33(defun +ace-window@disable-overlay (_fn &rest _args)
34 "ADVICE for FN `aw--lead-overlay' (and ARGS) to not show overlays.")
35
36(provide '+ace-window) 39(provide '+ace-window)
37;;; +ace-window.el ends here 40;;; +ace-window.el ends here
diff --git a/lisp/+modeline.el b/lisp/+modeline.el index 3cc8806..3a922e3 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el
@@ -32,7 +32,7 @@ functions), though it can also contain cons cells of the
32form (SEGMENT . PREDICATE). 32form (SEGMENT . PREDICATE).
33 33
34Segments are separated from each other using SEPARATOR, which 34Segments are separated from each other using SEPARATOR, which
35defaults to a \" \". space. Only segments that evaluate to a 35defaults to a \" \". Only segments that evaluate to a
36non-trivial string (that is, a string not equal to \"\") will be 36non-trivial string (that is, a string not equal to \"\") will be
37separated, for a cleaner look. 37separated, for a cleaner look.
38 38
@@ -42,18 +42,18 @@ This function makes a lambda, so you can throw it straight into
42 (lambda () 42 (lambda ()
43 (apply #'concat 43 (apply #'concat
44 (let (this-sep result-list) 44 (let (this-sep result-list)
45 (dolist (segment segments) 45 (dolist (segment segments)
46 (push (funcall (or (car-safe segment) segment) 46 (push (funcall (or (car-safe segment) segment)
47 this-sep) 47 this-sep)
48 result-list) 48 result-list)
49 (if (or (cdr-safe segment) 49 (if (or (cdr-safe segment)
50 (and (car result-list) 50 (and (car result-list)
51 (not (equal (car result-list) "")))) 51 (not (equal (car result-list) ""))))
52 (setq this-sep separator) 52 (setq this-sep separator)
53 (setq this-sep nil))) 53 (setq this-sep nil)))
54 (unless (seq-some #'null result-list) 54 (unless (seq-some #'null result-list)
55 (push +modeline-default-spacer result-list)) 55 (push +modeline-default-spacer result-list))
56 (nreverse result-list))))) 56 (nreverse result-list)))))
57 57
58;;; Modeline segments 58;;; Modeline segments
59 59
@@ -62,14 +62,36 @@ This function makes a lambda, so you can throw it straight into
62 (when string 62 (when string
63 (string-replace "%" "%%" string))) 63 (string-replace "%" "%%" string)))
64 64
65(defcustom +modeline-buffer-name-max-length 0
66 "Maximum length of `+modeline-buffer-name'.
67If > 0 and < 1, use that portion of the window's width. If > 1,
68use that many characters. If anything else, don't limit. If the
69buffer name is longer than the max length, it will be shortened
70and appended with `truncate-string-ellipsis'."
71 :type '(choice (const :tag "No maximum length" 0)
72 (natnum :tag "Number of characters")
73 (float :tag "Fraction of window's width")))
74
65(defun +modeline-buffer-name (&optional spacer) ; gonsie 75(defun +modeline-buffer-name (&optional spacer) ; gonsie
66 "Display the buffer name." 76 "Display the buffer name."
67 (let ((bufname (string-trim (string-replace "%" "" (buffer-name))))) 77 (let ((bufname (string-trim (string-replace "%" "" (buffer-name)))))
68 (concat (or spacer +modeline-default-spacer) 78 (concat (or spacer +modeline-default-spacer)
69 (propertize bufname 79 (propertize (cond
70 'help-echo (or (buffer-file-name) 80 ((ignore-errors
71 (buffer-name)) 81 (and (> +modeline-buffer-name-max-length 0)
72 'mouse-face 'mode-line-highlight)))) 82 (< +modeline-buffer-name-max-length 1)))
83 (truncate-string-to-width bufname
84 (* (window-total-width) +modeline-buffer-name-max-length)
85 nil nil t))
86 ((ignore-errors
87 (> +modeline-buffer-name-max-length 1))
88 (truncate-string-to-width bufname
89 +modeline-buffer-name-max-length
90 nil nil t))
91 (t bufname))
92 'help-echo (or (buffer-file-name)
93 (buffer-name))
94 'mouse-face 'mode-line-highlight))))
73 95
74(defcustom +modeline-minions-icon "&" 96(defcustom +modeline-minions-icon "&"
75 "The \"icon\" for `+modeline-minions' button." 97 "The \"icon\" for `+modeline-minions' button."
@@ -188,20 +210,49 @@ The order of elements matters: whichever one matches first is applied."
188 "Toggle the percentage display in the mode line (File Percentage Mode)." 210 "Toggle the percentage display in the mode line (File Percentage Mode)."
189 :init-value t :global t :group 'mode-line) 211 :init-value t :global t :group 'mode-line)
190 212
213(defun +modeline--percentage ()
214 "Return point's progress through current file as a percentage."
215 (let ((tot (count-screen-lines (point-min) (point-max) :ignore-invisible)))
216 (floor (* 100 (/ (float (line-number-at-pos)) tot)))))
217
218(defun +modeline--buffer-contained-in-window-p ()
219 "Whether the buffer is totally contained within its window."
220 (let ((window-min (save-excursion (move-to-window-line 0) (point)))
221 (window-max (save-excursion (move-to-window-line -1) (point))))
222 (and (<= window-min (point-min))
223 (>= window-max (point-max)))))
224
191(defun +modeline-file-percentage (&optional spacer) 225(defun +modeline-file-percentage (&optional spacer)
192 "Display the position in the current file." 226 "Display the position in the current file."
193 (when file-percentage-mode 227 (when file-percentage-mode
194 (let* ((tot (count-lines (point-min) (point-max) :ignore-invisible)) 228 ;; (let ((perc (+modeline--percentage)))
195 (perc (/ (* 100 (line-number-at-pos)) tot)) 229 ;; (propertize (concat (or spacer +modeline-default-spacer)
196 (window-min (save-excursion (move-to-window-line 0) 230 ;; (cond
197 (point))) 231 ;; ((+modeline--buffer-contained-in-window-p) "All")
198 (window-max (save-excursion (move-to-window-line -1) 232 ;; ((= (line-number-at-pos) (line-number-at-pos (point-min))) "Top")
199 (point)))) 233 ;; ((= (line-number-at-pos) (line-number-at-pos (point-max))) "Bot")
234 ;; ;; Why the 10 %s? Not sure. `format' knocks them
235 ;; ;; down to 5, then `format-mode-line' kills all but
236 ;; ;; two. If I use only 8, the margin is much too
237 ;; ;; large. Something else is obviously going on, but
238 ;; ;; I'm at a loss as to what it could be.
239 ;; (t (format "%d%%%%%%%%%%" perc))))
240 ;; ;; TODO: add scroll-up and scroll-down bindings.
241 ;; ))
242 (let ((perc (format-mode-line '(-3 "%p"))))
243 (concat (or spacer +modeline-default-spacer)
244 perc
245 (unless (seq-some (lambda (s) (string= perc s))
246 '("Top" "Bot" "All"))
247 "%%%%")))))
248
249(defun +modeline-file-percentage-icon (&optional spacer)
250 "Display the position in the current file as an icon."
251 (when file-percentage-mode
252 (let ((perc (+modeline--percentage)))
200 (propertize (concat (or spacer +modeline-default-spacer) 253 (propertize (concat (or spacer +modeline-default-spacer)
201 (cond 254 (cond
202 ((and (<= window-min (point-min)) 255 ((+modeline--buffer-contained-in-window-p) "⏹")
203 (>= window-max (point-max)))
204 "█")
205 ((= perc 0) "▇") 256 ((= perc 0) "▇")
206 ((< perc 20) "▆") 257 ((< perc 20) "▆")
207 ((< perc 40) "▅") 258 ((< perc 40) "▅")
@@ -231,24 +282,37 @@ The order of elements matters: whichever one matches first is applied."
231 'font-lock-face 'font-lock-variable-name-face)) 282 'font-lock-face 'font-lock-variable-name-face))
232 "")) 283 ""))
233 284
285(defun +modeline-line (&optional spacer)
286 (when line-number-mode
287 (concat (or spacer +modeline-default-spacer) "%2l")))
288
289(defun +modeline-column (&optional spacer)
290 (when column-number-mode
291 (concat (or spacer +modeline-default-spacer)
292 (if column-number-indicator-zero-based "%2c" "%2C"))))
293
234(defun +modeline-line-column (&optional spacer) ; adapted from `simple-modeline' 294(defun +modeline-line-column (&optional spacer) ; adapted from `simple-modeline'
235 "Display the current cursor line and column depending on modes." 295 "Display the current cursor line and column depending on modes."
236 (let ((sep "|") (before "") (after "") 296 (funcall (+modeline-concat '(+modeline-line
237 (line-fmt (if line-number-mode "%2l" "")) 297 +modeline-column)
238 (col-fmt (if column-number-mode 298 "|")))
239 (if column-number-indicator-zero-based 299
240 "%2c" 300(defcustom +modeline-position-function nil
241 "%2C") 301 "Function to use instead of `+modeline-position' in modeline."
242 ""))) 302 :type '(choice (const :tag "None" nil)
243 (concat (or spacer +modeline-default-spacer) 303 function)
244 before line-fmt sep col-fmt after))) 304 :local t)
245 305
246(defun +modeline-position (&optional _) 306(defun +modeline-position (&optional _)
247 "Display the current cursor position. 307 "Display the current cursor position.
248See `line-number-mode', `column-number-mode', `file-percentage-mode'" 308See `line-number-mode', `column-number-mode', and
249 (append (+modeline-line-column) 309`file-percentage-mode'. If `+modeline-position-function' is set
250 (+modeline-region) 310to a function in the current buffer, call that function instead."
251 (+modeline-file-percentage))) 311 (funcall (if +modeline-position-function
312 +modeline-position-function
313 (+modeline-concat '(+modeline-region
314 +modeline-line-column
315 +modeline-file-percentage)))))
252 316
253(defun +modeline-vc (&optional spacer) 317(defun +modeline-vc (&optional spacer)
254 "Display the version control branch of the current buffer in the modeline." 318 "Display the version control branch of the current buffer in the modeline."
diff --git a/lisp/+org.el b/lisp/+org.el index 2a57fe2..e39bdc1 100644 --- a/lisp/+org.el +++ b/lisp/+org.el
@@ -338,6 +338,7 @@ Return as a list."
338 (save-mark-and-excursion 338 (save-mark-and-excursion
339 (mark-whole-buffer) 339 (mark-whole-buffer)
340 ;;(org-fill-paragraph nil t) 340 ;;(org-fill-paragraph nil t)
341 (+org-unsmartify)
341 (+org-fix-blank-lines t) 342 (+org-fix-blank-lines t)
342 (org-align-tags t)))) 343 (org-align-tags t))))
343 344
diff --git a/lisp/+setup.el b/lisp/+setup.el index 7c658b6..02d2f09 100644 --- a/lisp/+setup.el +++ b/lisp/+setup.el
@@ -35,7 +35,7 @@ Good for commenting.")
35 35
36(setup-define :face 36(setup-define :face
37 (lambda (face spec) 37 (lambda (face spec)
38 `(custom-set-faces '(,face ,spec 'now "Customized by `setup'."))) 38 `(custom-set-faces (list ,face ,spec 'now "Customized by `setup'.")))
39 :documentation "Customize FACE with SPEC using `custom-set-faces'." 39 :documentation "Customize FACE with SPEC using `custom-set-faces'."
40 :repeatable t) 40 :repeatable t)
41 41
diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index 1f4745d..2c39dae 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el
@@ -99,10 +99,10 @@
99 emms-player-playing-p) 99 emms-player-playing-p)
100 (let ((now-playing (+string-truncate (emms-mode-line-playlist-current) 100 (let ((now-playing (+string-truncate (emms-mode-line-playlist-current)
101 (- +tab-bar-emms-max-length 2)))) 101 (- +tab-bar-emms-max-length 2))))
102 `((emms-now-playing menu-item 102 `(emms-now-playing menu-item
103 ,(concat "{" now-playing "}" " ") 103 ,(concat "{" now-playing "}" " ")
104 emms-pause 104 emms-pause
105 :help ,(emms-mode-line-playlist-current)))))) 105 ( :help ,(emms-mode-line-playlist-current))))))
106 106
107(defun +tab-bar-bongo () 107(defun +tab-bar-bongo ()
108 "Display Bongo now playing information." 108 "Display Bongo now playing information."
@@ -218,6 +218,17 @@ name to the left."
218 (max 0 (- l-name tab-bar-tab-name-truncated-max l-ell)))) 218 (max 0 (- l-name tab-bar-tab-name-truncated-max l-ell))))
219 'help-echo tab-name)))) 219 'help-echo tab-name))))
220 220
221(defun +tab-bar-format-align-right ()
222 "Align the rest of tab bar items to the right, pixel-wise."
223 ;; XXX: ideally, wouldn't require `shr' here
224 (require 'shr) ; `shr-string-pixel-width'
225 (let* ((rest (cdr (memq '+tab-bar-format-align-right tab-bar-format)))
226 (rest (tab-bar-format-list rest))
227 (rest (mapconcat (lambda (item) (nth 2 item)) rest ""))
228 (hpos (shr-string-pixel-width rest))
229 (str (propertize " " 'display `(space :align-to (- right (,hpos))))))
230 `((align-right menu-item ,str ignore))))
231
221 232
222;;; Menu bar 233;;; Menu bar
223;; stole from https://github.com/emacs-mirror/emacs/blob/master/lisp/tab-bar.el 234;; stole from https://github.com/emacs-mirror/emacs/blob/master/lisp/tab-bar.el