summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnus-conf.el68
1 files changed, 22 insertions, 46 deletions
diff --git a/gnus-conf.el b/gnus-conf.el
index 7c248a8..ffc1f08 100644
--- a/gnus-conf.el
+++ b/gnus-conf.el
@@ -36,6 +36,7 @@
'((nntp "news.gmane.io")
(nnmaildir "gmail" (directory "~/.nnmaildir/gmail"))
(nnmaildir "durand" (directory "~/.nnmaildir/mymail"))
+ ;; (nndiary "diary")
;; (nnmaildir "sent" (directory "~/.nnmaildir"))
;; (nnimap "LocalMail"
;; (nnimap-address "localhost")
@@ -43,6 +44,18 @@
;; (nnimap-server-port 143))
))
+;;; Group timestamps
+
+(require 'gnus-group)
+
+(add-hook 'gnus-select-group-hook #'gnus-group-set-timestamp)
+
+;;; diary reminder
+
+(require 'nndiary)
+
+(setq nndiary-reminders (list (cons 0 'day) (cons 60 'minute)))
+
;;; Prefer TEXT than HTML mails
(require 'mm-decode)
@@ -136,6 +149,8 @@
;;;; Helper function to convert file name to article numbers
+(require 'nnmaildir)
+
(defun durand-gnus-file-name-to-article-number (filename)
"Convert FILENAME to the article number.
An article number is something Gnus uses internally to identity
@@ -173,57 +188,18 @@ groups, so that is a generalization I do not need, at present."
;;;; Query function
-(defvar durand-gnunque-temp-buffer "*gnunque-temp-buffer*"
- "A temporary buffer used by `durand-gnuuque' to collect
-information.")
-
(defalias 'durand-gnunque #'durand-gnus-notmuch-query)
(defun durand-gnus-notmuch-query (query)
"Search mails by QUERY."
(interactive "MSearch mails by: ")
- (let ((original-query query)
- (query (split-string query " "))
- (buffer (get-buffer-create durand-gnunque-temp-buffer))
+ (let ((query (split-string query " "))
results)
- ;; obtain the thread IDs of the matching mails
- (setq
- results
- (apply
- #'process-lines
- "notmuch" "search" "--output=threads"
- "--format=text"
- query))
- ;; disable recording undo information
- (with-current-buffer buffer
- (setq buffer-undo-list t))
- ;; collect all message files of the threads
+ ;; split and join back as a form of normalizatoin
+ (setq query (mapconcat #'identity query " "))
(setq
results
- (apply
- #'append
- (mapcar
- (lambda (thread)
- (with-current-buffer buffer
- (delete-region (point-min) (point-max))
- (call-process
- "notmuch"
- nil
- t
- nil
- "show" "--body=false"
- thread)
- (goto-char (point-min))
- (let (res)
- (while (re-search-forward "filename:" nil t)
- (setq res
- (cons
- (buffer-substring-no-properties
- (point) (line-end-position))
- res)))
- res)))
- results)))
- (kill-buffer buffer)
+ (process-lines "dnw" query))
;; convert message file names to "article numbers" that Gnus uses
;; internally
(setq
@@ -231,7 +207,7 @@ information.")
(apply
#'vector
(mapcar #'durand-gnus-file-name-to-article-number results)))
- ;; finally we can read the articles
+ ;; then read the articles
(gnus-group-read-ephemeral-group
(concat "nnselect-" (message-unique-id))
(list (intern "nnselect") "nnselect")
@@ -276,8 +252,8 @@ no loss in removing this group from other variables."
;; friends
(durand-gnus-save-query "friends"
- "from:r03221010* or to:r03221010* \
-or from:bill821230bill* or to:bill821230bill* \
+ "from:r03221010* or to:r03221010*
+or from:bill821230bill* or to:bill821230bill*
or from:u1991123* or to:u1991123*")
;;;; bind in gnus group buffer