summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el144
-rw-r--r--lisp/+modeline.el41
-rw-r--r--lisp/+notmuch.el35
-rw-r--r--lisp/+tab-bar.el15
-rw-r--r--machines/bob.el45
5 files changed, 201 insertions, 79 deletions
diff --git a/init.el b/init.el index 6775e33..d3fc88e 100644 --- a/init.el +++ b/init.el
@@ -149,7 +149,7 @@
149(setup (:require user-save) 149(setup (:require user-save)
150 (add-hook 'user-save-before-save-hook #'+clean-empty-lines) 150 (add-hook 'user-save-before-save-hook #'+clean-empty-lines)
151 (add-hook 'user-save-before-save-hook (defun user-save@save-some-buffers () 151 (add-hook 'user-save-before-save-hook (defun user-save@save-some-buffers ()
152 (save-some-buffers t t))) 152 (save-some-buffers t t)))
153 (user-save-global-mode +1)) 153 (user-save-global-mode +1))
154 154
155(setup (:require winner) 155(setup (:require winner)
@@ -520,18 +520,18 @@
520 ) 520 )
521 (with-eval-after-load 'transient 521 (with-eval-after-load 'transient
522 (transient-define-prefix net-utils () 522 (transient-define-prefix net-utils ()
523 "Networking utilities" 523 "Networking utilities"
524 ["Actions" 524 ["Actions"
525 ("p" "Ping" ping) 525 ("p" "Ping" ping)
526 ("i" "Ifconfig" ifconfig) 526 ("i" "Ifconfig" ifconfig)
527 ("w" "Iwconfig" iwconfig) 527 ("w" "Iwconfig" iwconfig)
528 ("n" "Netstat" netstat) 528 ("n" "Netstat" netstat)
529 ("a" "Arp" arp) 529 ("a" "Arp" arp)
530 ("r" "Route" route) 530 ("r" "Route" route)
531 ("h" "Nslookup host" nslookup-host) 531 ("h" "Nslookup host" nslookup-host)
532 ("d" "Dig" dig) 532 ("d" "Dig" dig)
533 ("s" "Smb Client" smbclient) 533 ("s" "Smb Client" smbclient)
534 ("t" "Traceroute" traceroute)]) 534 ("t" "Traceroute" traceroute)])
535 (:+key "C-z M-n" #'net-utils))) 535 (:+key "C-z M-n" #'net-utils)))
536 536
537(setup notmuch 537(setup notmuch
@@ -544,13 +544,20 @@
544 notmuch-address-save-filename (notmuch/ "addresses" t) 544 notmuch-address-save-filename (notmuch/ "addresses" t)
545 notmuch-address-use-company (featurep 'company) 545 notmuch-address-use-company (featurep 'company)
546 notmuch-search-oldest-first nil 546 notmuch-search-oldest-first nil
547 notmuch-archive-tags '("-inbox" "-unread")) 547 notmuch-archive-tags '("-inbox" "-unread")
548 notmuch-draft-tags '("+draft" "-inbox" "-unread"))
548 ;; Reading mail 549 ;; Reading mail
549 (:option notmuch-show-indent-content nil) 550 (:option notmuch-show-indent-content nil)
550 (add-hook 'notmuch-show-mode-hook #'visual-fill-column-mode) 551 (add-hook 'notmuch-show-mode-hook #'visual-fill-column-mode)
552 (:with-mode notmuch-search-mode
553 (:bind "RET" #'notmuch-search-show-thread
554 "M-RET" #'notmuch-tree-from-search-thread
555 "!" #'+notmuch-search-mark-spam))
556 (:with-mode notmuch-tree-mode
557 (:bind "!" #'+notmuch-tree-mark-spam-then-next))
551 ;; Composing mail 558 ;; Composing mail
552 (:option message-kill-buffer-on-exit t 559 (:option message-kill-buffer-on-exit t
553 message-auto-save-directory "~/var/mail/drafts") 560 message-auto-save-directory nil)
554 ;; Sending mail 561 ;; Sending mail
555 (:option send-mail-function #'sendmail-send-it 562 (:option send-mail-function #'sendmail-send-it
556 mail-specify-envelope-from t 563 mail-specify-envelope-from t
@@ -568,38 +575,47 @@
568 "tag:inbox" 575 "tag:inbox"
569 "tag:unread" 576 "tag:unread"
570 "NOT tag:Spam") 577 "NOT tag:Spam")
571 :key "i") 578 :key "m"
579 :search-type 'tree)
572 (list :name "inbox" 580 (list :name "inbox"
573 :query (+notmuch-query-concat 581 :query (+notmuch-query-concat
574 "tag:inbox" 582 "tag:inbox"
575 "NOT tag:Spam") 583 "NOT tag:Spam")
576 :key "I") 584 :key "i"
585 :search-type 'tree)
577 (list :name "lists+unread" 586 (list :name "lists+unread"
578 :query (+notmuch-query-concat 587 :query (+notmuch-query-concat
579 "tag:/List/" 588 "tag:/List/"
580 "tag:unread") 589 "tag:unread")
581 :key "l") 590 :key "l"
591 :search-type 'tree)
582 (list :name "lists" 592 (list :name "lists"
583 :query "tag:/List/" 593 :query "tag:/List/"
584 :key "L") 594 :key "L"
595 :search-type 'tree)
585 (list :name "unread" 596 (list :name "unread"
586 :query (+notmuch-query-concat 597 :query (+notmuch-query-concat
587 "tag:unread" 598 "tag:unread"
588 "NOT tag:Spam") 599 "NOT tag:Spam")
589 :key "u") 600 :key "u"
601 :search-type 'tree)
590 (list :name "flagged" 602 (list :name "flagged"
591 :query "tag:flagged" 603 :query "tag:flagged"
592 :key "f") 604 :key "f"
605 :search-type 'tree)
593 (list :name "sent" 606 (list :name "sent"
594 :query "tag:sent" 607 :query "tag:sent"
595 :key "t") 608 :key "t"
609 :search-type 'tree)
596 (list :name "drafts" 610 (list :name "drafts"
597 :query "tag:draft" 611 :query "tag:draft"
598 :key "d") 612 :key "d"
613 :search-type 'tree)
599 (list :name "all mail" 614 (list :name "all mail"
600 :query "*" 615 :query "*"
601 :key "a")))) 616 :key "a"
602 (:+leader "m" #'+notmuch-goto "C-m" #'+notmuch-goto 617 :search-type 'tree))))
618 (:+leader "m" #'notmuch-mua-new-mail "C-m" #'notmuch-jump-search
603 "n" #'notmuch "C-n" #'notmuch) 619 "n" #'notmuch "C-n" #'notmuch)
604 ;; For `focus' 620 ;; For `focus'
605 (put 'notmuch-message 'bounds-of-thing-at-point 'notmuch-show-message-extent)) 621 (put 'notmuch-message 'bounds-of-thing-at-point 'notmuch-show-message-extent))
@@ -671,10 +687,11 @@
671 org-startup-truncated nil 687 org-startup-truncated nil
672 org-startup-with-inline-images t 688 org-startup-with-inline-images t
673 org-tags-column -77 ;; (- (- fill-column 1 (length org-ellipsis))) 689 org-tags-column -77 ;; (- (- fill-column 1 (length org-ellipsis)))
674 org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)" 690 org-todo-keywords
675 "|" "DONE(d!)" "ASSIGNED(a!)") 691 '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)"
676 (sequence "|" "CANCELED(k@)") 692 "|" "DONE(d!)" "ASSIGNED(a@/!)")
677 (sequence "MEETING(m)")) 693 (sequence "|" "CANCELED(k@)")
694 (sequence "MEETING(m)"))
678 org-use-speed-commands t 695 org-use-speed-commands t
679 org-emphasis-alist '(("*" org-bold) 696 org-emphasis-alist '(("*" org-bold)
680 ("/" org-italic) 697 ("/" org-italic)
@@ -921,8 +938,8 @@
921 (:option shell-command-prompt-show-cwd t) 938 (:option shell-command-prompt-show-cwd t)
922 (:local-set +modeline-position-function 939 (:local-set +modeline-position-function
923 (lambda () (string-replace (getenv "HOME") 940 (lambda () (string-replace (getenv "HOME")
924 "~" 941 "~"
925 default-directory))) 942 default-directory)))
926 (:hook #'form-feed-mode)) 943 (:hook #'form-feed-mode))
927 944
928(setup shr 945(setup shr
@@ -1062,7 +1079,8 @@
1062 (:bind-into isearch 1079 (:bind-into isearch
1063 "M-j" #'avy-isearch) 1080 "M-j" #'avy-isearch)
1064 (setf (alist-get ?. avy-dispatch-alist) #'avy-action-embark) 1081 (setf (alist-get ?. avy-dispatch-alist) #'avy-action-embark)
1065 (+avy-buffer-face-mode +1)) 1082 ;; (+avy-buffer-face-mode +1)
1083 )
1066 1084
1067(setup (:straight bbdb) 1085(setup (:straight bbdb)
1068 (:straight bbdb-vcard) 1086 (:straight bbdb-vcard)
@@ -1070,7 +1088,9 @@
1070 (defun +bbdb-load () 1088 (defun +bbdb-load ()
1071 (:require bbdb-autoloads 1089 (:require bbdb-autoloads
1072 bbdb) 1090 bbdb)
1073 (bbdb-initialize 'gnus 'message)))) 1091 (bbdb-initialize 'gnus 'message)
1092 (bbdb-insinuate-message)
1093 (setq bbdb-complete-mail-allow-cycling t))))
1074 1094
1075(setup (:straight (bongo :type git 1095(setup (:straight (bongo :type git
1076 :flavor melpa 1096 :flavor melpa
@@ -1165,8 +1185,8 @@
1165 '(t)))))) 1185 '(t))))))
1166 1186
1167(setup (:straight circe) 1187(setup (:straight circe)
1168 ;; (:require _circe 1188 (:require _circe
1169 ;; +circe) 1189 +circe)
1170 ;; (:also-load circe-chanop) 1190 ;; (:also-load circe-chanop)
1171 ;; (+ensure-after-init (lambda () (defalias 'irc '+irc "Start IRC."))) 1191 ;; (+ensure-after-init (lambda () (defalias 'irc '+irc "Start IRC.")))
1172 1192
@@ -1499,6 +1519,11 @@
1499(setup (:straight dired-open) 1519(setup (:straight dired-open)
1500 (:load-after dired)) 1520 (:load-after dired))
1501 1521
1522(setup (:straight dired-rsync)
1523 (:load-after dired)
1524 (:bind-into dired-mode
1525 "r" #'dired-rsync))
1526
1502(setup (:straight dired-subtree) 1527(setup (:straight dired-subtree)
1503 (:load-after dired) 1528 (:load-after dired)
1504 (:bind-into dired 1529 (:bind-into dired
@@ -1702,6 +1727,12 @@
1702 (:+key "C-=" #'er/expand-region 1727 (:+key "C-=" #'er/expand-region
1703 "C--" #'+er/contract-or-negative-argument)) 1728 "C--" #'+er/contract-or-negative-argument))
1704 1729
1730(setup (:straight fennel-mode)
1731 (with-eval-after-load 'apheleia
1732 (when-let ((fnlfmt (executable-find "fnlfmt")))
1733 (setf (alist-get 'fnlfmt apheleia-formatters) (list fnlfmt 'filepath))
1734 (setf (alist-get 'fennel-mode apheleia-mode-alist) 'fnlfmt))))
1735
1705(setup (:straight (filldent :host nil 1736(setup (:straight (filldent :host nil
1706 :repo "https://codeberg.org/acdw/filldent.el")) 1737 :repo "https://codeberg.org/acdw/filldent.el"))
1707 (:+key "M-q" #'filldent-unfill-toggle)) 1738 (:+key "M-q" #'filldent-unfill-toggle))
@@ -1769,6 +1800,10 @@
1769 (setf (alist-get "\\.scm\\'" auto-insert-alist nil nil #'equal) 1800 (setf (alist-get "\\.scm\\'" auto-insert-alist nil nil #'equal)
1770 '(insert "#!/bin/sh\n#| -*- scheme -*-\nexec csi -s $0 \"$@\"\n|#\n"))) 1801 '(insert "#!/bin/sh\n#| -*- scheme -*-\nexec csi -s $0 \"$@\"\n|#\n")))
1771 1802
1803(setup (:straight (ghelp :repo "https://github.com/casouri/ghelp"))
1804 ;;; XXX: set this up!
1805 (:require))
1806
1772(setup (:straight (git-modes :host github :repo "magit/git-modes")) 1807(setup (:straight (git-modes :host github :repo "magit/git-modes"))
1773 (:require git-modes)) 1808 (:require git-modes))
1774 1809
@@ -1801,7 +1836,10 @@
1801 (:option hungry-delete-chars-to-skip " \t" 1836 (:option hungry-delete-chars-to-skip " \t"
1802 hungry-delete-join-reluctantly nil) 1837 hungry-delete-join-reluctantly nil)
1803 (+with-ensure-after-init 1838 (+with-ensure-after-init
1804 (add-to-list 'hungry-delete-except-modes 'eshell-mode)) 1839 (dolist (m '(eshell-mode
1840 nim-mode
1841 python-mode))
1842 (add-to-list 'hungry-delete-except-modes m)))
1805 (:bind-into paredit 1843 (:bind-into paredit
1806 ;; I define these functions here because they really require both packages 1844 ;; I define these functions here because they really require both packages
1807 ;; to make any sense. So, would I put them in `+hungry-delete' or 1845 ;; to make any sense. So, would I put them in `+hungry-delete' or
@@ -1907,15 +1945,16 @@
1907 ('dark 1.0))) 1945 ('dark 1.0)))
1908 (+mapc-some-buffers #'+jabber-colors-update 1946 (+mapc-some-buffers #'+jabber-colors-update
1909 (lambda () (derived-mode-p 'jabber-chat-mode 1947 (lambda () (derived-mode-p 'jabber-chat-mode
1910 'jabber-roster-mode 1948 'jabber-roster-mode
1911 'jabber-activity-mode 1949 'jabber-activity-mode
1912 'jabber-browse-mode))))) 1950 'jabber-browse-mode)))))
1913 (dolist (mode '(jabber-chat-mode 1951 (dolist (mode '(jabber-chat-mode
1914 jabber-browse-mode 1952 jabber-browse-mode
1915 jabber-roster-mode 1953 jabber-roster-mode
1916 jabber-console-mode)) 1954 jabber-console-mode))
1917 (let ((hook (intern (format "%s-hook" mode)))) 1955 (let ((hook (intern (format "%s-hook" mode))))
1918 (add-hook hook #'visual-fill-column-mode) 1956 (add-hook hook #'visual-fill-column-mode)
1957 (add-hook hook (defun +electric-pair-disable-local-mode () (electric-pair-local-mode -1)))
1919 ;; (add-hook hook (lambda () (setq-local wrap-prefix " "))) 1958 ;; (add-hook hook (lambda () (setq-local wrap-prefix " ")))
1920 )) 1959 ))
1921 (with-eval-after-load 'tracking 1960 (with-eval-after-load 'tracking
@@ -1927,7 +1966,8 @@
1927 "🤔 "))) 1966 "🤔 ")))
1928 file-percentage-mode nil 1967 file-percentage-mode nil
1929 ;; wrap-prefix (make-string +jabber-ws-prefix ?\ ) 1968 ;; wrap-prefix (make-string +jabber-ws-prefix ?\ )
1930 comment-start nil)) 1969 comment-start nil)
1970 (:bind "C-c C-t" #'jabber-muc-set-topic))
1931 (:+leader "C-j" jabber-global-keymap) 1971 (:+leader "C-j" jabber-global-keymap)
1932 (advice-add 'jabber-activity-add :after #'+jabber-tracking-add) 1972 (advice-add 'jabber-activity-add :after #'+jabber-tracking-add)
1933 (advice-add 'jabber-activity-add-muc :after #'+jabber-tracking-add-muc) 1973 (advice-add 'jabber-activity-add-muc :after #'+jabber-tracking-add-muc)
@@ -1955,7 +1995,8 @@
1955 (:require +link-hint) 1995 (:require +link-hint)
1956 (+link-hint-open-secondary-setup) 1996 (+link-hint-open-secondary-setup)
1957 (+link-hint-open-chrome-setup) 1997 (+link-hint-open-chrome-setup)
1958 (:option link-hint-avy-style 'at-full) 1998 (:option link-hint-avy-style 'at-full
1999 link-hint-avy-all-windows t)
1959 (:+key "M-l" +link-hint-map) 2000 (:+key "M-l" +link-hint-map)
1960 (:with-map +link-hint-map 2001 (:with-map +link-hint-map
1961 (:bind "M-l" #'+link-hint-open-link "l" #'+link-hint-open-link 2002 (:bind "M-l" #'+link-hint-open-link "l" #'+link-hint-open-link
@@ -2006,7 +2047,7 @@
2006 (:hook #'visual-fill-column-mode)) 2047 (:hook #'visual-fill-column-mode))
2007 (with-eval-after-load 'apheleia 2048 (with-eval-after-load 'apheleia
2008 (when-let ((mdfmt-exe (executable-find "markdownfmt"))) 2049 (when-let ((mdfmt-exe (executable-find "markdownfmt")))
2009 (setf (alist-get 'markdownfmt apheleia-formatters) mdfmt-exe) 2050 (setf (alist-get 'markdownfmt apheleia-formatters) (list mdfmt-exe))
2010 (setf (alist-get 'markdown-mode apheleia-mode-alist) 'markdownfmt) 2051 (setf (alist-get 'markdown-mode apheleia-mode-alist) 'markdownfmt)
2011 (setf (alist-get 'gfm-mode apheleia-mode-alist) 'markdownfmt)))) 2052 (setf (alist-get 'gfm-mode apheleia-mode-alist) 'markdownfmt))))
2012 2053
@@ -2077,8 +2118,9 @@
2077 ((,class :inherit modus-themes-bold 2118 ((,class :inherit modus-themes-bold
2078 :foreground unspecified))) 2119 :foreground unspecified)))
2079 `(font-lock-comment-face 2120 `(font-lock-comment-face
2080 ((,class :inherit variable-pitch 2121 ((,class :inherit default
2081 :slant italic 2122 :slant normal
2123 :height 1.0
2082 :foreground ,fg-comment-yellow))) 2124 :foreground ,fg-comment-yellow)))
2083 `(font-lock-comment-delimiter-face 2125 `(font-lock-comment-delimiter-face
2084 ((,class :inherit fixed-pitch 2126 ((,class :inherit fixed-pitch
@@ -2265,7 +2307,9 @@
2265 lisp-mode-hook 2307 lisp-mode-hook
2266 scheme-mode-hook 2308 scheme-mode-hook
2267 geiser-mode-hook 2309 geiser-mode-hook
2268 geiser-repl-mode-hook)) 2310 geiser-repl-mode-hook
2311 fennel-mode-hook
2312 fennel-repl-mode-hook))
2269 (add-hook hook #'enable-paredit-mode)) 2313 (add-hook hook #'enable-paredit-mode))
2270 (:also-load eldoc) 2314 (:also-load eldoc)
2271 (eldoc-add-command #'paredit-backward-delete #'paredit-close-round)) 2315 (eldoc-add-command #'paredit-backward-delete #'paredit-close-round))
@@ -2357,6 +2401,8 @@
2357 (+modeline-concat 2401 (+modeline-concat
2358 '(+modeline-track 2402 '(+modeline-track
2359 simple-modeline-segment-misc-info)))) 2403 simple-modeline-segment-misc-info))))
2404 (lambda () (when (featurep 'dired-rsync)
2405 dired-rsync-modeline-status))
2360 ,(+modeline-concat 2406 ,(+modeline-concat
2361 '(+modeline-god-mode 2407 '(+modeline-god-mode
2362 +modeline-kmacro-indicator 2408 +modeline-kmacro-indicator
@@ -2392,7 +2438,10 @@
2392 (:also-load sly-autoloads 2438 (:also-load sly-autoloads
2393 +sly) 2439 +sly)
2394 (:option inferior-lisp-program +lisp-bin 2440 (:option inferior-lisp-program +lisp-bin
2395 sly-kill-without-query-p t) 2441 sly-kill-without-query-p t
2442 sly-command-switch-to-existing-lisp t)
2443 (:with-mode lisp-mode
2444 (:bind "C-c C-z" #'sly-mrepl))
2396 (:with-feature sly-mrepl 2445 (:with-feature sly-mrepl
2397 (dolist (key '("RET" "<return>")) 2446 (dolist (key '("RET" "<return>"))
2398 (:bind key #'sly-mrepl-return-at-end)) 2447 (:bind key #'sly-mrepl-return-at-end))
@@ -2607,6 +2656,9 @@
2607 2656
2608(setup (:straight xr)) 2657(setup (:straight xr))
2609 2658
2659(setup (:straight yaml-mode)
2660 (:file-match (rx "." (or "yml" "yaml") eos)))
2661
2610(setup (:straight yaoddmuse)) 2662(setup (:straight yaoddmuse))
2611 2663
2612(setup (:straight yasnippet) 2664(setup (:straight yasnippet)
diff --git a/lisp/+modeline.el b/lisp/+modeline.el index 11d6a4c..c6e8463 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el
@@ -89,14 +89,15 @@ and appended with `truncate-string-ellipsis'."
89 89
90(defun +modeline-buffer-name (&optional spacer) ; gonsie 90(defun +modeline-buffer-name (&optional spacer) ; gonsie
91 "Display the buffer name." 91 "Display the buffer name."
92 (let ((bufname (string-trim (string-replace "%" "" (buffer-name))))) 92 (let ((bufname (string-trim (string-replace "%" "%%%%" (buffer-name)))))
93 (+modeline-spacer nil spacer 93 (+modeline-spacer nil spacer
94 (if (and +modeline-buffer-position (fboundp +modeline-buffer-position)) 94 (if (and +modeline-buffer-position (fboundp +modeline-buffer-position))
95 (funcall +modeline-buffer-position) 95 (funcall +modeline-buffer-position)
96 (propertize (cond 96 (propertize (cond
97 ((ignore-errors 97 ((ignore-errors
98 (and (> +modeline-buffer-name-max-length 0) 98 (and
99 (< +modeline-buffer-name-max-length 1))) 99 (> +modeline-buffer-name-max-length 0)
100 (< +modeline-buffer-name-max-length 1)))
100 (truncate-string-to-width bufname 101 (truncate-string-to-width bufname
101 (* (window-total-width) 102 (* (window-total-width)
102 +modeline-buffer-name-max-length) 103 +modeline-buffer-name-max-length)
@@ -149,14 +150,14 @@ in the cdr will be applied to the major-mode in the mode line."
149 (propertize ;; (+string-truncate (format-mode-line mode-name) 16) 150 (propertize ;; (+string-truncate (format-mode-line mode-name) 16)
150 (format-mode-line mode-name) 151 (format-mode-line mode-name)
151 'face (when (actually-selected-window-p) 152 'face (when (actually-selected-window-p)
152 ;; XXX: This is probably really inefficient. I need to 153 ;; XXX: This is probably really inefficient. I need to
153 ;; simply detect which mode it's in when I change major 154 ;; simply detect which mode it's in when I change major
154 ;; modes (`change-major-mode-hook') and change the face 155 ;; modes (`change-major-mode-hook') and change the face
155 ;; there, probably. 156 ;; there, probably.
156 ;; (catch :done (dolist (cel +modeline-major-mode-faces) 157 ;; (catch :done (dolist (cel +modeline-major-mode-faces)
157 ;; (when (derived-mode-p (car cel)) 158 ;; (when (derived-mode-p (car cel))
158 ;; (throw :done (cdr cel)))) 159 ;; (throw :done (cdr cel))))
159 ;; (alist-get t +modeline-major-mode-faces)) 160 ;; (alist-get t +modeline-major-mode-faces))
160 '+modeline-major-mode-face) 161 '+modeline-major-mode-face)
161 'keymap (let ((map (make-sparse-keymap))) 162 'keymap (let ((map (make-sparse-keymap)))
162 (bindings--define-key map [mode-line down-mouse-1] 163 (bindings--define-key map [mode-line down-mouse-1]
@@ -302,13 +303,13 @@ The order of elements matters: whichever one matches first is applied."
302 (when file-percentage-mode 303 (when file-percentage-mode
303 (+modeline-spacer nil spacer 304 (+modeline-spacer nil spacer
304 (let ((perc (format-mode-line '(-2 "%p")))) 305 (let ((perc (format-mode-line '(-2 "%p"))))
305 (pcase perc 306 (pcase perc
306 ("To" "/\\") 307 ("To" "/\\")
307 ("Bo" "\\/") 308 ("Bo" "\\/")
308 ("Al" "[]") 309 ("Al" "[]")
309 (_ (let ((vec (vector "/|" "//" "||" "\\\\" "\\|" "\\|")) 310 (_ (let ((vec (vector "/|" "//" "||" "\\\\" "\\|" "\\|"))
310 (perc (string-to-number perc))) 311 (perc (string-to-number perc)))
311 (aref vec (floor (/ perc 17)))))))))) 312 (aref vec (floor (/ perc 17))))))))))
312 313
313(defun +modeline-file-percentage-icon (&optional spacer) 314(defun +modeline-file-percentage-icon (&optional spacer)
314 "Display the position in the current file as an icon." 315 "Display the position in the current file as an icon."
@@ -379,8 +380,8 @@ to a function in the current buffer, call that function instead."
379 "Display the version control branch of the current buffer in the modeline." 380 "Display the version control branch of the current buffer in the modeline."
380 ;; from https://www.gonsie.com/blorg/modeline.html, from Doom 381 ;; from https://www.gonsie.com/blorg/modeline.html, from Doom
381 (when-let ((backend (vc-backend buffer-file-name))) 382 (when-let ((backend (vc-backend buffer-file-name)))
382 (+modeline-spacer nil spacer 383 (+modeline-spacer nil spacer
383 (substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2))))) 384 (substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2)))))
384 385
385(defun +modeline-track (&optional spacer) 386(defun +modeline-track (&optional spacer)
386 "Display `tracking-mode' information." 387 "Display `tracking-mode' information."
diff --git a/lisp/+notmuch.el b/lisp/+notmuch.el index 890edbe..9e79c5a 100644 --- a/lisp/+notmuch.el +++ b/lisp/+notmuch.el
@@ -58,5 +58,40 @@ for search."
58 nil) 58 nil)
59 'notmuch-address-history))) 59 'notmuch-address-history)))
60 60
61(defcustom +notmuch-spam-tags '("+spam" "+Spam")
62 "A list of tag changes to apply when marking a thread as spam."
63 :type '(repeat string))
64
65(defun +notmuch-tree-mark-spam-then-next (&optional ham beg end)
66 "Mark the current message as spam and move to the next."
67 (interactive "P")
68 (+notmuch-tree-mark-spam ham)
69 (notmuch-tree-next-matching-message))
70
71(defun +notmuch-tree-mark-spam (&optional ham)
72 "Mark the current message as spam.
73That is, apply the tag changes in `+notmuch-spam-tags' to it. If
74an optional prefix HAM argument is given, the message will be
75marked as not-spam (\"ham\"), i.e., the tag changes in
76`+notmuch-spam-tags' will be reversed."
77 (interactive "P")
78 (when +notmuch-spam-tags
79 (notmuch-tree-tag
80 (notmuch-tag-change-list +notmuch-spam-tags ham))))
81
82(defun +notmuch-search-mark-spam (&optional ham beg end)
83 "Mark the current thread or region as spam.
84This adds the tags in `+notmuch-spam-tags' to the message. With
85an optional HAM prefix argument, mark the messages as
86not-spam (\"ham\").
87
88This function advances the next thread when finished."
89 (interactive (cons current-prefix-arg (notmuch-interactive-region)))
90 (when +notmuch-spam-tags
91 (notmuch-search-tag
92 (notmuch-tag-change-list +notmuch-spam-tags ham) beg end))
93 (when (eq beg end)
94 (notmuch-search-next-thread)))
95
61(provide '+notmuch) 96(provide '+notmuch)
62;;; +notmuch.el ends here 97;;; +notmuch.el ends here
diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index 7ff991c..6c9debd 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el
@@ -32,6 +32,19 @@
32 "Hide the `tracking-mode' information when clocked in." 32 "Hide the `tracking-mode' information when clocked in."
33 :type 'boolean) 33 :type 'boolean)
34 34
35(defun format-mode-line-unescaping (construct)
36 "Return a mode-line construct as a string, but unescape `%'s."
37 (format-mode-line
38 (cond ((listp construct)
39 (cl-loop for item in construct
40 collect (cond ((stringp item)
41 (string-replace "%" "%%" item))
42 ((and (listp item) (eq :propertize (car item)))
43 (format-mode-line-unescaping item))
44 (t item))))
45 ((stringp construct) (string-replace "%" "%%" construct))
46 (t construct))))
47
35(defun +tab-bar-tracking-mode () 48(defun +tab-bar-tracking-mode ()
36 "Display `tracking-mode-line-buffers' in the tab-bar." 49 "Display `tracking-mode-line-buffers' in the tab-bar."
37 ;; TODO: write something to convert a mode-line construct to a tab-bar 50 ;; TODO: write something to convert a mode-line construct to a tab-bar
@@ -45,7 +58,7 @@
45 as item = (nth i tracking-mode-line-buffers) 58 as item = (nth i tracking-mode-line-buffers)
46 collect (append (list (intern (format "tracking-mode-line-%s" i)) 59 collect (append (list (intern (format "tracking-mode-line-%s" i))
47 'menu-item 60 'menu-item
48 (string-trim (format-mode-line item))) 61 (string-trim (format-mode-line-unescaping item)))
49 (if-let ((keymap (plist-get item 'keymap))) 62 (if-let ((keymap (plist-get item 'keymap)))
50 (list (alist-get 'down-mouse-1 (cdadr keymap))) 63 (list (alist-get 'down-mouse-1 (cdadr keymap)))
51 (list #'ignore)) 64 (list #'ignore))
diff --git a/machines/bob.el b/machines/bob.el index 5effc5b..7c1a16d 100644 --- a/machines/bob.el +++ b/machines/bob.el
@@ -7,18 +7,37 @@
7(require 'acdw) 7(require 'acdw)
8(require 'machine) 8(require 'machine)
9 9
10(defcustom +bob-face-plist
11 '( :dejavu ("DejaVu Sans Mono" "DejaVu Sans")
12 :iosevka ("Iosevka Comfy Wide" "Iosevka Comfy Duo")
13 :plex ("IBM Plex Mono" "IBM Plex Serif")
14 :go/djv ("Go Mono" "DejaVu Sans")
15 :tt (("TT2020Base" 120) "TT2020 Base Style E") ; no italic
16 :courier ("Courier Prime Code" "Courier Prime")
17 :gaegu (("Gaegu" 140) "Gaegu") ; no italic
18 :comic (("Comic Code" 100) "Comic Code")
19 :go/comic (("Go Mono" 100) ("Comic Code" 100))
20 )
21 "A plist of possible font combinations.")
22
23(defcustom +bob-face-pair :comic ;; (+bob-set-faces)
24 "The index of `+bob-face-pairs' to use.")
25
10(defun +bob-set-faces (&rest _) 26(defun +bob-set-faces (&rest _)
11 (let (;;(base-face "IBM Plex Mono") 27 (let* ((face-pair (plist-get +bob-face-plist +bob-face-pair))
12 ;; (var-face "IBM Plex Sans") 28 (base-face (if (stringp (car face-pair))
13 ;; (base-face "Iosevka Comfy Wide") 29 (car face-pair)
14 ;; (var-face "Iosevka Comfy Duo") 30 (caar face-pair)))
15 (base-face "DejaVu Sans Mono") 31 (var-face (if (stringp (cadr face-pair))
16 (var-face "DejaVu Sans") 32 (cadr face-pair)
17 (base-size 100) 33 (caadr face-pair)))
18 (var-size 1.0) 34 (base-size (or (ignore-errors (cadar face-pair))
19 (italic-face nil) 35 100))
20 ;; (bold-face nil) 36 (var-size (or (ignore-errors (cadadr face-pair))
21 (mono-face nil)) 37 1.0))
38 (italic-face nil)
39 ;; (bold-face nil)
40 (mono-face nil))
22 (+set-faces 41 (+set-faces
23 `((default 42 `((default
24 :family ,base-face 43 :family ,base-face
@@ -33,7 +52,9 @@
33 :height 1.0) 52 :height 1.0)
34 (variable-pitch 53 (variable-pitch
35 :family ,(or var-face base-face) 54 :family ,(or var-face base-face)
36 :height ,var-size) 55 :height ,var-size
56 ;; :weight medium
57 )
37 ;; (org-italic 58 ;; (org-italic
38 ;; :family ,(or var-face base-face) 59 ;; :family ,(or var-face base-face)
39 ;; :slant italic) 60 ;; :slant italic)