diff options
Diffstat (limited to 'custom/jao-custom-gnus.el')
| -rw-r--r-- | custom/jao-custom-gnus.el | 92 |
1 files changed, 45 insertions, 47 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index bc39f5b..597ef85 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -89,7 +89,12 @@ (defun jao-gnus-use-two-panes () (let ((wide-len jao-gnus-wide-width) (groups-len jao-gnus-groups-width) - (summary-len (- jao-gnus-wide-width jao-gnus-groups-width))) + (summary-len (- jao-gnus-wide-width jao-gnus-groups-width)) + (msg-edit '(horizontal 1.0 + (message 1.0 point) + (vertical 0.5 + ("*Org Agenda*" 0.5) + ("inbox.org" 1.0))))) (gnus-add-configuration `(article (horizontal 1.0 @@ -102,16 +107,8 @@ `(group (horizontal 1.0 (group 0.5 point) (vertical 1.0 - ("*Org Agenda*" 0.5) - ("inbox.org" 1.0) - ;; ("*notmuch-hello*" 1.0) - )))) - - (gnus-add-configuration - `(message (horizontal 1.0 (message 1.0 point)))) - - (gnus-add-configuration - `(reply-yank (horizontal 1.0 (message 1.0 point)))) + ("*Org Agenda*" 1.0) + ("*Calendar*" 9))))) (gnus-add-configuration `(summary @@ -119,11 +116,16 @@ (vertical ,groups-len (group 1.0)) (vertical 1.0 (summary 1.0 point))))) + (gnus-add-configuration `(message ,msg-edit)) + + (gnus-add-configuration `(forward ,msg-edit)) + + (gnus-add-configuration `(reply-yank ,msg-edit)) + (gnus-add-configuration - `(reply - (horizontal 1.0 - (message ,(- wide-len 100) point) - (article 1.0)))))) + `(reply (horizontal 1.0 + (message ,(- wide-len 100) point) + (article 1.0)))))) (if jao-gnus-use-three-panes (jao-gnus-use-three-panes) @@ -255,10 +257,12 @@ ;;; groups (setq gnus-group-line-format - " %m%S%p%3y%P%* %~(pad-right 30)G %B\n" + " %m%S%p%3y%P%* %~(pad-right 25)G %B\n" ;; " %m%S%p%P:%~(pad-right 35)c %3y %B\n" ;; " %m%S%p%3y%P%* %~(pad-right 30)C %B\n" - gnus-topic-line-format "%i[ %(%{%n%}%) -- %A ]%v\n" + ;; gnus-topic-line-format "%i[ %(%{%n%}%) -- %A ]%v\n" + gnus-face-2 'jao-themes-f11 + gnus-topic-line-format "%i %2{%~(pad-right 8)n ┄┄ %A%v%}\n" gnus-group-uncollapsed-levels 2 gnus-auto-select-subject 'unread gnus-large-newsgroup 2000) @@ -642,6 +646,8 @@ (let ((inhibit-message t)) (gnus-demon-scan-news) (jao-shell-exec "notmuch-gnus-tags.sh") + (when-let* ((a (get-buffer "*Org Agenda*"))) + (with-current-buffer a (org-agenda-redo-all))) (jao-gnus--notify))) (defun jao-gnus--scan-local-mail () @@ -674,21 +680,14 @@ (directory-files mail-source-directory nil "feeds\\.[^e]") (seq-difference '("feeds.trove" "feeds.emacs" "feeds.emacs-devel"))))) - `( - ;; ("nnml:bigml\\.inbox" "B" jao-themes-f00) - ;; ("nnml:bigml\\.alba" "A" jao-themes-f00) - ;; ("nnml:bigml\\.ryou" "R" jao-themes-f00) - ;; ("nnml:bigml\\.bugs" "b" jao-themes-error) - ;; ("nnml:bigml\\.support" "S" default) - ;; ("nnml:bigml\\.[^aibsr]" "W" jao-themes-dimm) - ("nnml:jao\\.bigml" "B" jao-themes-f00) + `(("nnml:jao\\.bigml" "B" jao-themes-f00) ("nnml:jao\\.\\(inbox\\|trove\\)" "I" jao-themes-f01) - ("nnml:jao.hunting" "H" jao-themes-f02) ("nnml:jao.write" "W" jao-themes-warning) ("nnml:jao.[^ithwb]" "J" jao-themes-dimm) - ("nnml:jao.hacking" "J" jao-themes-dimm) - (,(format "^nnml:%s" (regexp-opt feeds)) "F" jao-themes-dimm) - ("feeds\\.emacs" "E" jao-themes-dimm) + ("nnml:jao.hacking" "H" jao-themes-dimm) + ;; (,(format "^nnml:%s" (regexp-opt feeds)) "F" jao-themes-dimm) + ;; ("feeds\\.emacs" "E" jao-themes-dimm) + ("nnml:feeds\\." "F" jao-themes-dimm) ("nnml:local" "l" jao-themes-dimm) ("nnrss:.*" "R" jao-themes-dimm) ("^\\(gwene\\|gmane\\)\\." "N" jao-themes-dimm)))) @@ -696,9 +695,12 @@ (defun jao-gnus--unread-counts () (seq-reduce (lambda (r g) (let ((n (gnus-group-unread (car g)))) - (if (and (numberp n) (> n 0)) (cons (cons (car g) n) r) r))) + (if (and (numberp n) (> n 0)) + (cons (+ n (car r)) + (cons (cons (car g) n) (cdr r))) + r))) gnus-newsrc-alist - ())) + '(0))) (defun jao-gnus-unread-count () (seq-reduce (lambda (c g) (+ c (or (gnus-group-unread (car g)) 0))) @@ -714,24 +716,20 @@ (defvar jao-gnus--notify-strs ()) -(defun jao-gnus--nnw-count () - (jao-when-darwin - (when-let* ((n (jao-nnw-unread-count))) - (when (> n 0) (list (format "(%s)" n)))))) - -(defun jao-gnus-xbar () - (let ((n (jao-gnus-unread-count))) - (concat (if (> n 0) (format "%s " n) "") - (or (car (jao-gnus--nnw-count)) "")))) +(defun jao-gnus--xbar-echo (labels) + (jao-shell-exec + (let* ((ls (mapconcat (lambda (x) (plist-get x :propertize)) labels " ")) + (m (when ls (format "%s | color=#8b3626 | size=11" ls)))) + (format "echo '%s' >/tmp/xbar" (or m " "))))) (defun jao-gnus--notify-strs () - (let ((counts (jao-gnus--unread-counts))) - (append - (seq-filter #'identity - (seq-map (lambda (args) - (apply 'jao-gnus--unread-label counts args)) - jao-gnus-tracked-groups)) - (jao-gnus--nnw-count)))) + (let* ((all (jao-gnus--unread-counts)) + (counts (cdr all)) + (labels (seq-keep (lambda (args) + (apply 'jao-gnus--unread-label counts args)) + jao-gnus-tracked-groups))) + (jao-when-darwin (jao-gnus--xbar-echo labels)) + labels)) (defun jao-gnus--notify () (setq jao-gnus--notify-strs (jao-gnus--notify-strs)) |
