summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--attic/misc.org20
-rw-r--r--gnus.org41
-rw-r--r--org.org2
3 files changed, 33 insertions, 30 deletions
diff --git a/attic/misc.org b/attic/misc.org
index be5ae99..74667ad 100644
--- a/attic/misc.org
+++ b/attic/misc.org
@@ -1133,26 +1133,6 @@
;; (spam-initialize)
#+end_src
-*** notmuch -> gnus
- #+begin_src emacs-lisp
- (defun jao-notmuch-goto-message-in-gnus ()
- "Open a summary buffer containing the current notmuch article."
- (interactive)
- (let ((group (jao-maildir-file-to-group (notmuch-show-get-filename)
- mail-source-directory))
- (message-id (replace-regexp-in-string "^id:"
- ""
- (notmuch-show-get-message-id))))
- (if (and group message-id)
- (org-gnus-follow-link group message-id)
- (message "Couldn't get relevant infos for switching to Gnus."))))
-
- (defalias 'jao-open-gnus-frame 'jao-afio--goto-mail)
-
- (eval-after-load "notmuch-show"
- '(define-key notmuch-show-mode-map (kbd "C-c C-c")
- #'jao-notmuch-goto-message-in-gnus))
- #+end_src
* snippets
#+begin_src emacs-lisp
(defun jao-minibuffer--text-with-padding (text)
diff --git a/gnus.org b/gnus.org
index faadeec..3273750 100644
--- a/gnus.org
+++ b/gnus.org
@@ -119,8 +119,6 @@
(setq gnus-search-use-parsed-queries t
gnus-search-notmuch-raw-queries-p nil
- gnus-fetch-old-headers nil
- gnus-fetch-old-ephemeral-headers nil
gnus-permanently-visible-groups "^nnselect:.*today"
gnus-search-ignored-newsgroups "nndraft.*\\|nnselect.*")
@@ -369,6 +367,37 @@
(jao-minibuffer-add-variable 'jao-gnus--notify-strs -20))
#+end_src
+* Notmuch integration
+*** notmuch -> gnus
+ #+begin_src emacs-lisp
+ (defun jao-notmuch-goto-message-in-gnus ()
+ "Open a summary buffer containing the current notmuch article."
+ (interactive)
+ (let ((group (jao-maildir-file-to-group (notmuch-show-get-filename)
+ mail-source-directory))
+ (message-id (replace-regexp-in-string "^id:"
+ ""
+ (notmuch-show-get-message-id))))
+ (if (and group message-id)
+ (org-gnus-follow-link group message-id)
+ (message "Couldn't get relevant infos for switching to Gnus."))))
+
+ (defun jao-gnus-open-consult-candidate (candidate)
+ (consult-notmuch--preview candidate nil)
+ (with-current-buffer consult-notmuch--buffer-name
+ (jao-notmuch-goto-message-in-gnus)
+ (save-window-excursion (consult-notmuch--close-preview))))
+
+ (defun jao-gnus-consult-notmuch ()
+ (interactive)
+ (jao-gnus-open-consult-candidate (consult-notmuch--search)))
+
+ (with-eval-after-load "notmuch-show"
+ (define-key gnus-group-mode-map "z" #'jao-gnus-consult-notmuch)
+ (define-key gnus-group-mode-map "Z" #'notmuch)
+ (define-key notmuch-show-mode-map (kbd "C-c C-c")
+ #'jao-notmuch-goto-message-in-gnus))
+ #+end_src
* Delayed messages
#+BEGIN_SRC emacs-lisp
;;; delayed messages (C-cC-j in message buffer)
@@ -444,10 +473,6 @@
(gnus-server-exit)
(message "Restarting all servers... done"))
- (define-key gnus-group-mode-map "z" nil)
- (define-key gnus-group-mode-map "zg" #'notmuch)
- (define-key gnus-group-mode-map "zz" #'jao-consult-notmuch-folder)
- (define-key gnus-group-mode-map "zZ" #'consult-notmuch)
(define-key gnus-group-mode-map "\C-x\C-s" #'gnus-group-save-newsrc)
(jao-transient-major-mode gnus-group
@@ -736,8 +761,4 @@
(define-key gnus-summary-mode-map "e" 'jao-gnus-open-enclosure)
(define-key gnus-summary-mode-map "\C-l" nil)
- (with-eval-after-load "w3m"
- (define-key gnus-article-mode-map "\C-ci" 'w3m-view-image)
- (define-key gnus-article-mode-map "z" 'w3m-lnum-zoom-in-image))
-
#+end_src
diff --git a/org.org b/org.org
index 0b62dd9..7d9e2f5 100644
--- a/org.org
+++ b/org.org
@@ -7,6 +7,8 @@
:ensure t
:custom ((org-export-backends '(ascii html latex texinfo)))
:init
+ (defalias 'jao-open-gnus-frame 'jao-afio--goto-mail)
+
(setq org-adapt-indentation t
org-catch-invisible-edits 'smart
org-complete-tags-always-offer-all-agenda-tags t