summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
Diffstat (limited to 'custom')
-rw-r--r--custom/jao-custom-eww.el4
-rw-r--r--custom/jao-custom-notmuch.el56
-rw-r--r--custom/jao-custom-org.el5
3 files changed, 38 insertions, 27 deletions
diff --git a/custom/jao-custom-eww.el b/custom/jao-custom-eww.el
index dda2de9..30dbdf9 100644
--- a/custom/jao-custom-eww.el
+++ b/custom/jao-custom-eww.el
@@ -23,8 +23,10 @@
(setq eww-use-browse-url "^\\(gemini\\|gopher\\):")
;;; multipart html renderer
+(defvar jao-shr-max-width 110)
+
(defun jao-shr-html-renderer (handle)
- (let* ((w (min 10ai0 (- (window-width) 10)))
+ (let* ((w (min jao-shr-max-width (- (window-width) 10)))
(fill-column nil)
(shr-width w)
(shr-max-width w))
diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el
index ee8872c..68a7d99 100644
--- a/custom/jao-custom-notmuch.el
+++ b/custom/jao-custom-notmuch.el
@@ -73,12 +73,13 @@
(notmuch-tree-close-message-window)
(notmuch-tree (string-replace jao-notmuch--newa "" query)))))
+(defun jao-notmuch--widen (s &optional extra)
+ (let* ((q (plist-get s :query))
+ (qs (string-replace jao-notmuch--newa "" q)))
+ (plist-put (copy-sequence s) :query (concat qs extra))))
+
(defun jao-notmuch-widen-searches (searches &optional extra)
- (mapcar (lambda (s)
- (let* ((q (plist-get s :query))
- (qs (string-replace jao-notmuch--newa "" q)))
- (plist-put (copy-sequence s) :query (concat qs extra))))
- searches))
+ (mapcar (lambda (s) (jao-notmuch--widen s extra)) searches))
(defun jao-notmuch-hello--insert-searches (searches title)
(when-let (searches (notmuch-hello-query-counts searches))
@@ -92,26 +93,29 @@
(widget-insert (propertize title 'face 'jao-themes-f00))
(notmuch-hello-insert-buttons searches))))
+(defun jao-notmuch--replace (lst s)
+ (let ((n (plist-get s :name)))
+ (set lst (seq-remove (lambda (s0) (string= name (plist-get s0 :name)))
+ (symbol-value lst)))
+ (add-to-list lst s t)))
+
+(defun jao-notmuch-add-saved-searches (searches)
+ (dolist (s searches)
+ (jao-notmuch--replace 'notmuch-saved-searches s)
+ (jao-notmuch--replace 'jao-notmuch-widened-searches s)))
+
(defmacro jao-notmuch-def-searches (name searches &optional no-save)
(declare (indent 1))
(let ((name (and name (format "%s" name)))
(id (intern (format "jao-notmuch-%s-searches" (or name (gensym))))))
`(progn (defvar ,id ,searches)
(defun ,id () (jao-notmuch-hello--insert-searches ,id ,name))
- ,@(unless no-save
- `((setq notmuch-saved-searches
- (append notmuch-saved-searches ,id))))
+ ,@(unless no-save `((jao-notmuch-add-saved-searches ,id)))
(add-to-list 'notmuch-hello-sections ',id t))))
-(setq notmuch-hello-sections nil notmuch-saved-searches nil)
+(defvar jao-notmuch-widened-searches nil)
-;; (jao-notmuch-def-searches bigml
-;; `(,(jao-notmuch--q "bigml" "inbox" "bi")
-;; ,(jao-notmuch--q "bigml" "alba" "ba")
-;; ,(jao-notmuch--q "bigml" "support" "bs")
-;; ,(jao-notmuch--q "bigml" "bugs" "bb")
-;; ,(jao-notmuch--q "bigml" "drivel" "bd")
-;; ,(jao-notmuch--q "bigml" "lists" "bl")))
+(setq notmuch-hello-sections nil notmuch-saved-searches nil)
(jao-notmuch-def-searches inbox
`(,(jao-notmuch--q "jao" "inbox" "ji")
@@ -124,20 +128,21 @@
,(jao-notmuch--qn "jao" "local" "jl" '("tag:local"))))
(jao-notmuch-def-searches news
- (mapcar #'jao-notmuch--sq '("news" "noticias" "fun" "words" "computers")))
+ (mapcar #'jao-notmuch--sq
+ '("news" "noticias" "fun" "words" "computers" "pens")))
(jao-notmuch-def-searches hacking
(mapcar #'jao-notmuch--sq '("xmobar" "geiser" "mdk" "mailutils" "notmuch")))
(jao-notmuch-def-searches prog
(append (mapcar #'jao-notmuch--sq
- '("lobsters" "clojure" "lisp" "scheme"
+ '("emacs" "lobsters" "clojure" "lisp" "scheme"
"haskell" "idris" "erlang" "pharo" "rust"))
`(,(jao-notmuch--qn "feeds" "prog" "fp"
'("tag:prog" "not tag:\"/emacs/\"")))))
(jao-notmuch-def-searches emacs
- `(,(jao-notmuch--sq "emacs" "ee" "emacs" "feeds")
+ `(;; ,(jao-notmuch--sq "emacs" "ee" "emacs" "feeds")
,(jao-notmuch--sq "emacs-help" "eh" "emacs" "help")
,(jao-notmuch--sq "emacs-github" "eg" "emacs" "github")
,(jao-notmuch--sq "emacs-devel" "ed" "emacs" "devel")
@@ -178,15 +183,11 @@
'("jao" "hacking" "feeds" "bills")))
(jao-notmuch-def-searches nil
- '((:query "not tag:trove and not tag:bigml" :name "jao/untroved"
+ '((:query "not tag:trove and not tag:hacking" :name "jao/untroved"
:search-type tree)
- (:query "tag:sent and tag:bigml" :name "bigml/sent" :search-type tree)
- (:query "tag:sent and not tag:bigml" :name "jao/sent" :search-type tree)
+ (:query "tag:sent" :name "jao/sent" :search-type tree)
(:query "*" :name "messages" :search-type tree)))
-(defvar jao-notmuch-widened-searches
- (jao-notmuch-widen-searches notmuch-saved-searches))
-
(defun jao-notmuch-jump-search (&optional widen)
(interactive "P")
(let ((notmuch-saved-searches
@@ -522,6 +523,7 @@
("h" . jao-notmuch-goto-message-buffer)
("i" . jao-notmuch-toggle-images)
("k" . jao-notmuch-tree-read-thread)
+ ("K" . jao-notmuch-tree-mark-all-read)
("N" . jao-notmuch-tree--forward)
("O" . notmuch-tree-toggle-order)
("o" . jao-notmuch-tree-widen-search)
@@ -621,7 +623,9 @@
(org-capture nil "X"))))
;;; html renderer
-(when jao-notmuch-enabled (setq mm-text-html-renderer 'shr))
+
+;; we can use the default defined in jao-custom-ewww
+;; (when jao-notmuch-enabled (setq mm-text-html-renderer 'shr))
;;; consult
(jao-when-linux
diff --git a/custom/jao-custom-org.el b/custom/jao-custom-org.el
index bf15f87..4021955 100644
--- a/custom/jao-custom-org.el
+++ b/custom/jao-custom-org.el
@@ -108,6 +108,11 @@
(window-parameters (mode-line-format . none))
(body-function . jao-org-agenda-hook)))
+(add-to-list 'display-buffer-alist
+ '("inbox\\.org"
+ (display-buffer-reuse-window)
+ (window-parameters (mode-line-format . none))))
+
;;; Capture templates
(setq org-capture-templates
'(("t" "TODO" entry