aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init/ycp-gnus.el1
-rw-r--r--emacs/.emacs.d/lisp/my/my-gnus.el23
-rw-r--r--emacs/.emacs.d/lisp/my/my-wget.el3
3 files changed, 25 insertions, 2 deletions
diff --git a/emacs/.emacs.d/init/ycp-gnus.el b/emacs/.emacs.d/init/ycp-gnus.el
index 9e89ee9..50901dd 100644
--- a/emacs/.emacs.d/init/ycp-gnus.el
+++ b/emacs/.emacs.d/init/ycp-gnus.el
@@ -147,6 +147,7 @@
(my-package gnus-group
(require 'my-gnus)
(my-keybind gnus-group-mode-map
+ "g" #'my-gnus-group-refresh
"n" #'next-line
"p" #'previous-line
"m" #'my-gnus-group-compose
diff --git a/emacs/.emacs.d/lisp/my/my-gnus.el b/emacs/.emacs.d/lisp/my/my-gnus.el
index 6a2142b..ff0ec64 100644
--- a/emacs/.emacs.d/lisp/my/my-gnus.el
+++ b/emacs/.emacs.d/lisp/my/my-gnus.el
@@ -419,5 +419,28 @@ The archiving target comes from `my-gnus-group-alist'."
(let ((inhibit-message nil))
(message "Copied region with %d links." (length pairs)))))
+(defun my-isync-sync-mail ()
+ "Call `mbsync' to sync mail"
+ (interactive)
+ (message "isync in progress...")
+ (set-process-sentinel
+ (start-process "isync" "*isync*" "mbsync" "-a")
+ (lambda (proc event)
+ (let ((status (process-exit-status proc)))
+ (when (eq status 0)
+ (message "isync in progress... done: %s"
+ (with-current-buffer (process-buffer proc)
+ (goto-char (point-max))
+ (re-search-backward " ")
+ (buffer-substring (1+ (point)) (point-max))))
+ (gnus-group-get-new-news))))))
+
+(defun my-gnus-group-refresh (arg)
+ "Call `gnus-group-get-new-news' or, with a prefix arg, `my-isync-sync-mail'"
+ (interactive "P")
+ (if arg
+ (my-isync-sync-mail)
+ (gnus-group-get-new-news)))
+
(provide 'my-gnus)
;;; my-gnus.el ends here
diff --git a/emacs/.emacs.d/lisp/my/my-wget.el b/emacs/.emacs.d/lisp/my/my-wget.el
index e7283aa..a55bb12 100644
--- a/emacs/.emacs.d/lisp/my/my-wget.el
+++ b/emacs/.emacs.d/lisp/my/my-wget.el
@@ -53,8 +53,7 @@
(my-start-process-with-torsocks
no-tor "wget" "*wget*" "wget" url "-c" "-O" filename)
(lambda (proc event)
- (let ((ps (process-status proc))
- (status (process-exit-status proc)))
+ (let ((status (process-exit-status proc)))
(if (eq status 0)
(progn
(message "[DONE] Fetched %s to %s" url filename)