summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el101
-rw-r--r--lisp/+jabber.el12
2 files changed, 83 insertions, 30 deletions
diff --git a/init.el b/init.el index ca0c507..dc3427b 100644 --- a/init.el +++ b/init.el
@@ -55,6 +55,8 @@
55 line-number-minor-tick 55 line-number-minor-tick
56 line-number-current-line)) 56 line-number-current-line))
57 (:face face '((t (:inherit fixed-pitch))))) 57 (:face face '((t (:inherit fixed-pitch)))))
58 (:face 'font-lock-comment-face '((t ( :inherit variable-pitch
59 :slant italic))))
58 ;; Hooks 60 ;; Hooks
59 (add-hook 'prog-mode-hook #'turn-on-auto-fill) 61 (add-hook 'prog-mode-hook #'turn-on-auto-fill)
60 (add-hook 'prog-mode-hook #'font-lock-todo-insinuate) 62 (add-hook 'prog-mode-hook #'font-lock-todo-insinuate)
@@ -732,9 +734,13 @@
732 org-agenda-file-regexp 734 org-agenda-file-regexp
733 org-agenda-templates)) 735 org-agenda-templates))
734 (add-to-list '+custom-variable-allowlist var)) 736 (add-to-list '+custom-variable-allowlist var))
737 (define-advice org-agenda-files (:filter-return (ret))
738 "Remove SyncThing's sync-conflict files from the org agenda."
739 (seq-remove (lambda (f) (string-match-p "sync-conflict" f)) ret))
735 (:+leader "a" #'org-agenda "C-a" #'org-agenda) 740 (:+leader "a" #'org-agenda "C-a" #'org-agenda)
736 (:hook #'hl-line-mode) 741 (:hook #'hl-line-mode)
737 (add-hook 'org-agenda-after-show-hook 'org-narrow-to-subtree)) 742 (:local-set truncate-lines t)
743 (add-hook 'org-agenda-after-show-hook #'org-narrow-to-subtree))
738 744
739(setup org-attach 745(setup org-attach
740 (:also-load +org-attach) 746 (:also-load +org-attach)
@@ -825,12 +831,7 @@
825(setup scratch 831(setup scratch
826 (:require +scratch) 832 (:require +scratch)
827 (:option initial-major-mode #'lisp-interaction-mode 833 (:option initial-major-mode #'lisp-interaction-mode
828 initial-scratch-message 834 initial-scratch-message (+scratch-fortune))
829 (concat (replace-regexp-in-string "^" ";; "
830 (string-trim (if (executable-find "fortune")
831 (shell-command-to-string "fortune -s")
832 "ABANDON ALL HOPE YE WHO ENTER HERE")))
833 "\n\n"))
834 (add-hook 'kill-buffer-query-functions #'+scratch-immortal)) 835 (add-hook 'kill-buffer-query-functions #'+scratch-immortal))
835 836
836(setup shr 837(setup shr
@@ -927,8 +928,8 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers."
927 (setq affe-regexp-compiler (defun affe-orderless-regexp-compiler (input &rest _) 928 (setq affe-regexp-compiler (defun affe-orderless-regexp-compiler (input &rest _)
928 (setq input (orderless-pattern-compiler input)) 929 (setq input (orderless-pattern-compiler input))
929 (cons input (lambda (str) (orderless--highlight input str))))) 930 (cons input (lambda (str) (orderless--highlight input str)))))
930 (setf (alist-get 'affe-grep vertico-multiform-commands) '(buffer) 931 (setf (alist-get 'affe-grep vertico-multiform-commands) nil
931 (alist-get 'affe-find vertico-multiform-commands) '(buffer)) 932 (alist-get 'affe-find vertico-multiform-commands) nil)
932 (:+key "M-s g" #'affe-grep 933 (:+key "M-s g" #'affe-grep
933 "M-s f" #'affe-find))) 934 "M-s f" #'affe-find)))
934 935
@@ -1023,6 +1024,13 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers."
1023 (with-eval-after-load 'notifications 1024 (with-eval-after-load 'notifications
1024 (add-hook 'bongo-player-metadata-changed-hook #'+bongo-notify))) 1025 (add-hook 'bongo-player-metadata-changed-hook #'+bongo-notify)))
1025 1026
1027(setup (:straight browse-kill-ring)
1028 (:+key "C-M-y" #'browse-kill-ring)
1029 (:option browse-kill-ring-highlight-current-entry t
1030 browse-kill-ring-highlight-inserted-item 'pulse
1031 browse-kill-ring-separator " ")
1032 (:hook #'form-feed-mode))
1033
1026(setup (:straight (cape 1034(setup (:straight (cape
1027 :host github :repo "minad/cape")) 1035 :host github :repo "minad/cape"))
1028 (dolist (fn 1036 (dolist (fn
@@ -1330,7 +1338,7 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers."
1330 consult-imenu 1338 consult-imenu
1331 consult-imenu-multi 1339 consult-imenu-multi
1332 consult-outline)) 1340 consult-outline))
1333 (setf (alist-get buf-cmd vertico-multiform-commands) '(buffer)))))) 1341 (setf (alist-get buf-cmd vertico-multiform-commands) nil)))))
1334 1342
1335(setup (:straight consult-dir) 1343(setup (:straight consult-dir)
1336 (:+key "C-x C-d" #'consult-dir) 1344 (:+key "C-x C-d" #'consult-dir)
@@ -1341,8 +1349,8 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers."
1341(setup (:straight consult-notmuch) 1349(setup (:straight consult-notmuch)
1342 (:load-after consult notmuch) 1350 (:load-after consult notmuch)
1343 (with-eval-after-load 'vertico-multiform 1351 (with-eval-after-load 'vertico-multiform
1344 (setf (alist-get 'consult-notmuch vertico-multiform-commands) '(buffer) 1352 (setf (alist-get 'consult-notmuch vertico-multiform-commands) nil
1345 (alist-get 'consult-notmuch-tree vertico-multiform-commands) '(buffer)))) 1353 (alist-get 'consult-notmuch-tree vertico-multiform-commands) nil)))
1346 1354
1347(setup (:straight corfu 1355(setup (:straight corfu
1348 :quit "Turns out, I actually like minibuffer completion better.") 1356 :quit "Turns out, I actually like minibuffer completion better.")
@@ -1501,7 +1509,8 @@ See also `crux-reopen-as-root-mode'."
1501 (file+olp ,(car rmh-elfeed-org-files) "Feeds") 1509 (file+olp ,(car rmh-elfeed-org-files) "Feeds")
1502 "* %? %^g"))) 1510 "* %? %^g")))
1503 1511
1504(setup (:straight elpher)) 1512(setup (:straight elpher)
1513 (:bind "l" #'elpher-back))
1505 1514
1506(setup (:straight embark) 1515(setup (:straight embark)
1507 (:require embark 1516 (:require embark
@@ -1633,6 +1642,8 @@ See also `crux-reopen-as-root-mode'."
1633 forge-gitea-repository))) 1642 forge-gitea-repository)))
1634 1643
1635(setup (:straight form-feed) 1644(setup (:straight form-feed)
1645 ;; See also `page-break-lines', further down.
1646 (:face 'form-feed-line '((t (:strike-through t))))
1636 (global-form-feed-mode +1)) 1647 (global-form-feed-mode +1))
1637 1648
1638(setup (:straight (frowny 1649(setup (:straight (frowny
@@ -1684,7 +1695,12 @@ See also `crux-reopen-as-root-mode'."
1684 describe-function describe-variable 1695 describe-function describe-variable
1685 helpful-function helpful-macro helpful-callable 1696 helpful-function helpful-macro helpful-callable
1686 helpful-variable)) 1697 helpful-variable))
1687 (setf (alist-get cmd vertico-multiform-commands) nil)))) 1698 (setf (alist-get cmd vertico-multiform-commands) nil)))
1699 ;; Load faster on first invocation by pre-loading a slow function
1700 ;; (see https://github.com/Wilfred/helpful/issues/236)
1701 (run-with-idle-timer 1 nil (lambda ()
1702 (require 'info-look)
1703 (info-lookup-setup-mode 'symbol 'emacs-lisp-mode))))
1688 1704
1689(setup (:straight (hippie-completing-read 1705(setup (:straight (hippie-completing-read
1690 :host github 1706 :host github
@@ -1753,25 +1769,32 @@ See also `crux-reopen-as-root-mode'."
1753 "jabber-fallback-lib/hexrgb.el" 1769 "jabber-fallback-lib/hexrgb.el"
1754 "jabber-fallback-lib/srv.el" 1770 "jabber-fallback-lib/srv.el"
1755 "jabber-fallback-lib/fsm.el") 1771 "jabber-fallback-lib/fsm.el")
1756 "jabber-pkg.el"))) 1772 "jabber-pkg.el")
1773 :fork ( :host nil
1774 :repo "https://codeberg.org/acdw/emacs-jabber")))
1757 (:also-load +jabber) 1775 (:also-load +jabber)
1758 (defvar +jabber-ws-prefix 8 "Width to pad left side of chats.") 1776 (defvar +jabber-ws-prefix 0 "Width to pad left side of chats.")
1777 (defvar +jabber-pre-prompt " \n"
1778 "String to show before a prompt.")
1759 (:option jabber-account-list '(("acdw@hmm.st")) 1779 (:option jabber-account-list '(("acdw@hmm.st"))
1760 jabber-groupchat-buffer-format "X:%n" 1780 jabber-groupchat-buffer-format "%n"
1761 jabber-chat-buffer-format "X:%n" 1781 jabber-chat-buffer-format "%n"
1762 jabber-muc-private-buffer-format "X:%n(%g)" 1782 jabber-muc-private-buffer-format "%n(%g)"
1763 jabber-activity-show-p #'ignore 1783 jabber-activity-show-p #'ignore
1764 jabber-muc-decorate-presence-patterns 1784 jabber-muc-decorate-presence-patterns
1765 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$") 1785 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$")
1766 ("." . jabber-muc-presence-dim)) 1786 ("." . jabber-muc-presence-dim))
1767 jabber-muc-colorize-foreign t 1787 jabber-muc-colorize-foreign t
1768 jabber-chat-foreign-prompt-format (concat "[%t] %n:\n" 1788 jabber-chat-foreign-prompt-format (concat +jabber-pre-prompt
1789 "[%t] %n\n"
1769 (make-string +jabber-ws-prefix 1790 (make-string +jabber-ws-prefix
1770 ?\ )) 1791 ?\ ))
1771 jabber-chat-local-prompt-format (concat "[%t] %n:\n" 1792 jabber-chat-local-prompt-format (concat +jabber-pre-prompt
1793 "[%t] %n\n"
1772 (make-string +jabber-ws-prefix 1794 (make-string +jabber-ws-prefix
1773 ?\ )) 1795 ?\ ))
1774 jabber-groupchat-prompt-format (concat "[%t] %n:\n" 1796 jabber-groupchat-prompt-format (concat +jabber-pre-prompt
1797 "[%t] %n\n"
1775 (make-string +jabber-ws-prefix 1798 (make-string +jabber-ws-prefix
1776 ?\ )) 1799 ?\ ))
1777 jabber-auto-reconnect t) 1800 jabber-auto-reconnect t)
@@ -1780,20 +1803,28 @@ See also `crux-reopen-as-root-mode'."
1780 (modus-themes-with-colors 1803 (modus-themes-with-colors
1781 (:face 'jabber-chat-prompt-foreign `((t (:foreground ,red))) 1804 (:face 'jabber-chat-prompt-foreign `((t (:foreground ,red)))
1782 'jabber-chat-prompt-local `((t (:foreground ,blue))) 1805 'jabber-chat-prompt-local `((t (:foreground ,blue)))
1783 'jabber-chat-prompt-system `((t (:foreground ,green))))))) 1806 'jabber-chat-prompt-system `((t (:foreground ,green)))))
1807 (setq jabber-muc-nick-value (pcase (frame--current-backround-mode (selected-frame))
1808 ('light 0.5)
1809 ('dark 1.0)))
1810 (+mapc-some-buffers #'+jabber-colors-update
1811 (lambda () (derived-mode-p 'jabber-chat-mode
1812 'jabber-roster-mode
1813 'jabber-activity-mode
1814 'jabber-browse-mode)))))
1784 (dolist (mode '(jabber-chat-mode 1815 (dolist (mode '(jabber-chat-mode
1785 jabber-browse-mode 1816 jabber-browse-mode
1786 jabber-roster-mode 1817 jabber-roster-mode
1787 jabber-console-mode)) 1818 jabber-console-mode))
1788 (add-hook (intern (format "%s-hook" mode)) #'visual-fill-column-mode)) 1819 (let ((hook (intern (format "%s-hook" mode))))
1820 (add-hook hook #'visual-fill-column-mode)))
1789 (add-hook 'jabber-activity-mode-hook #'tracking-mode) 1821 (add-hook 'jabber-activity-mode-hook #'tracking-mode)
1790 (:with-mode jabber-chat-mode 1822 (:with-mode jabber-chat-mode
1791 (:local-set +modeline-position-function (lambda () 1823 (:local-set +modeline-position-function (lambda ()
1792 (cond 1824 (cond
1793 ((string-match-p "hmm@" (buffer-name)) 1825 ((string-match-p "hmm@" (buffer-name))
1794 "🤔 "))) 1826 "🤔 ")))
1795 wrap-prefix (make-string +jabber-ws-prefix ?\ ) 1827 wrap-prefix (make-string +jabber-ws-prefix ?\ )))
1796 ))
1797 (:+leader "C-j" jabber-global-keymap) 1828 (:+leader "C-j" jabber-global-keymap)
1798 (advice-add 'jabber-activity-add :after #'+jabber-tracking-add) 1829 (advice-add 'jabber-activity-add :after #'+jabber-tracking-add)
1799 (advice-add 'jabber-activity-add-muc :after #'+jabber-tracking-add-muc)) 1830 (advice-add 'jabber-activity-add-muc :after #'+jabber-tracking-add-muc))
@@ -1933,9 +1964,8 @@ See also `crux-reopen-as-root-mode'."
1933 (:face 'modus-themes-tab-active '((t :bold nil)) 1964 (:face 'modus-themes-tab-active '((t :bold nil))
1934 'modus-themes-tab-inactive '((t :italic t))) 1965 'modus-themes-tab-inactive '((t :italic t)))
1935 1966
1936 ;; Fix a "nil is not a Modus theme" error
1937 ;; XXX: Need to register a bug report
1938 (define-advice modus-themes--current-theme (:around (fn &rest r)) 1967 (define-advice modus-themes--current-theme (:around (fn &rest r))
1968 "Fix a \"nil is not a Modus theme\" error."
1939 (or (apply fn r) 1969 (or (apply fn r)
1940 'modus-operandi)) 1970 'modus-operandi))
1941 1971
@@ -1996,6 +2026,10 @@ See also `crux-reopen-as-root-mode'."
1996 :quit "Buggy") 2026 :quit "Buggy")
1997 (:load-after notmuch)) 2027 (:load-after notmuch))
1998 2028
2029(setup (:straight nov)
2030 (:hook #'visual-fill-column-mode)
2031 (:file-match (rx ".epub" eos)))
2032
1999(setup (:straight ol-notmuch)) 2033(setup (:straight ol-notmuch))
2000 2034
2001(setup (:straight orderless) 2035(setup (:straight orderless)
@@ -2045,7 +2079,8 @@ See also `crux-reopen-as-root-mode'."
2045(setup (:straight org-modern) 2079(setup (:straight org-modern)
2046 (:option org-modern-hide-stars nil 2080 (:option org-modern-hide-stars nil
2047 org-modern-star nil 2081 org-modern-star nil
2048 org-modern-list nil) 2082 org-modern-list nil
2083 org-modern-progress ["..." "o.." "oo." "Oo." "Ooo" "OOo" "OOO"])
2049 (:face 'org-modern-label '((t ( :height 1.0 2084 (:face 'org-modern-label '((t ( :height 1.0
2050 :weight regular 2085 :weight regular
2051 :underline nil 2086 :underline nil
@@ -2079,6 +2114,10 @@ See also `crux-reopen-as-root-mode'."
2079 ;; Remove it from init.el files 2114 ;; Remove it from init.el files
2080 (add-hook '+init-mode-hook #'flymake-mode-off)) 2115 (add-hook '+init-mode-hook #'flymake-mode-off))
2081 2116
2117(setup (:straight page-break-lines)
2118 (:option page-break-lines-char ?—)
2119 (:hook-into jabber-chat-mode))
2120
2082(setup (:straight paredit) 2121(setup (:straight paredit)
2083 (:also-load +paredit) 2122 (:also-load +paredit)
2084 (:bind "DEL" #'paredit-backward-delete 2123 (:bind "DEL" #'paredit-backward-delete
@@ -2349,7 +2388,7 @@ See also `crux-reopen-as-root-mode'."
2349 (setf (alist-get 'completion-at-point vertico-multiform-commands) '(flat)) 2388 (setf (alist-get 'completion-at-point vertico-multiform-commands) '(flat))
2350 (setf (alist-get 'indent-for-tab-command vertico-multiform-commands) '(flat)) 2389 (setf (alist-get 'indent-for-tab-command vertico-multiform-commands) '(flat))
2351 (setf (alist-get 'insert-char vertico-multiform-commands) nil) 2390 (setf (alist-get 'insert-char vertico-multiform-commands) nil)
2352 (setf (alist-get 'file vertico-multiform-categories) '(buffer)) 2391 (setf (alist-get 'file vertico-multiform-categories) nil)
2353 (setf (alist-get 'bookmark vertico-multiform-categories) nil) 2392 (setf (alist-get 'bookmark vertico-multiform-categories) nil)
2354 ;; Default. Needs to be `add-to-list' so that it appears at the end. 2393 ;; Default. Needs to be `add-to-list' so that it appears at the end.
2355 (add-to-list 'vertico-multiform-categories '(t flat) :append) 2394 (add-to-list 'vertico-multiform-categories '(t flat) :append)
@@ -2421,6 +2460,8 @@ See also `crux-reopen-as-root-mode'."
2421 (:also-load +xkcd) 2460 (:also-load +xkcd)
2422 (:hook #'visual-fill-column-mode)) 2461 (:hook #'visual-fill-column-mode))
2423 2462
2463(setup (:straight xr))
2464
2424(setup (:straight yaoddmuse)) 2465(setup (:straight yaoddmuse))
2425 2466
2426(setup (:straight yasnippet) 2467(setup (:straight yasnippet)
diff --git a/lisp/+jabber.el b/lisp/+jabber.el index 2382102..c5d568c 100644 --- a/lisp/+jabber.el +++ b/lisp/+jabber.el
@@ -250,5 +250,17 @@ associated face. Ignore notification if face is ‘nil’."
250 (buffer-string)) 250 (buffer-string))
251 :time (current-time)))))))))))) 251 :time (current-time))))))))))))
252 252
253(defun +jabber-colors-update (&optional buffer)
254 "Update jabber colors in BUFFER, defaulting to the current."
255 (with-current-buffer (or buffer (current-buffer))
256 (when jabber-buffer-connection
257 (setq jabber-muc-participant-colors nil)
258 (cond (jabber-chatting-with
259 (jabber-chat-create-buffer jabber-buffer-connection
260 jabber-chatting-with))
261 (jabber-group
262 (jabber-muc-create-buffer jabber-buffer-connection
263 jabber-group))))))
264
253(provide '+jabber) 265(provide '+jabber)
254;;; +jabber.el ends here 266;;; +jabber.el ends here