summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-07-12 18:49:12 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-07-13 15:23:41 -0700
commit13ef0dc9e86d9c64be41b7155a3a573062ac9c80 (patch)
tree2c14cf0e7cd86fff7b5a3447f6af1065af1b19bf
parent958e594b3c34b572f6b1d1076a654700d442b0de (diff)
downloaddotfiles-13ef0dc9e86d9c64be41b7155a3a573062ac9c80.tar.gz
spw/gnus: require dedicated Emacs for Gnus first run
-rw-r--r--.emacs.d/init.el33
1 files changed, 20 insertions, 13 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 6d9d6597..f84813b8 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -2717,19 +2717,26 @@ mutt's review view, after exiting EDITOR."
(defun spw/gnus (&optional fetch-and-inbox)
(interactive "P")
- (require 'gnus)
- (if (not fetch-and-inbox)
- (if (gnus-alive-p) (pop-to-buffer-same-window gnus-group-buffer) (gnus))
- ;; We want to see mail that we think has just come in. This is the only
- ;; time we call 'notmuch new' without --no-hooks from Emacs rather than
- ;; just waiting for cron, because it's slow.
- (unless (gnus-alive-p) (gnus))
- (with-temp-message "Fetching & indexing mail ..."
- (call-process "notmuch" nil nil nil "new"))
- (if (not (get-buffer "*Summary nnselect:Process-Weekday*"))
- (gnus-group-read-group nil t "nnselect:Process-Weekday")
- (pop-to-buffer-same-window "*Summary nnselect:Process-Weekday*")
- (gnus-summary-rescan-group))))
+ (cl-flet ((gnus ()
+ ;; Require a dedicated Emacs so that primary session is not
+ ;; locked up for ages while maildir NOV files are generated.
+ (if (and (daemonp) (file-directory-p "~/.fmail/")
+ (not (file-exists-p "~/.newsrc.eld")))
+ (user-error "Must use dedicated Emacs for Gnus first run")
+ (gnus))))
+ (require 'gnus)
+ (if (not fetch-and-inbox)
+ (if (gnus-alive-p) (pop-to-buffer-same-window gnus-group-buffer) (gnus))
+ ;; We want to see mail that we think has just come in. This is the only
+ ;; time we call 'notmuch new' without --no-hooks from Emacs rather than
+ ;; just waiting for cron, because it's slow.
+ (unless (gnus-alive-p) (gnus))
+ (with-temp-message "Fetching & indexing mail ..."
+ (call-process "notmuch" nil nil nil "new"))
+ (if (not (get-buffer "*Summary nnselect:Process-Weekday*"))
+ (gnus-group-read-group nil t "nnselect:Process-Weekday")
+ (pop-to-buffer-same-window "*Summary nnselect:Process-Weekday*")
+ (gnus-summary-rescan-group)))))
(global-set-key "\C-cgn" #'spw/gnus)
(defun spw/gnus-notmuch-ephemeral-search (query &optional limit)