summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-02-17 01:18:11 -0500
committerKyle Meyer <kyle@kyleam.com>2014-02-17 01:18:11 -0500
commita977a1ce48fb23ad1855e25dfe08e8913b022f86 (patch)
tree50464cd179a22bd10c4177a30c4f4fb51d35a2e4 /lisp
parent50c6ee6ede035ae35e661a10a5d527c8ccf86338 (diff)
downloademacs.d-a977a1ce48fb23ad1855e25dfe08e8913b022f86.tar.gz
Check for process before syncing mail
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-gnus.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/init-gnus.el b/lisp/init-gnus.el
index c8120da..cc62335 100644
--- a/lisp/init-gnus.el
+++ b/lisp/init-gnus.el
@@ -18,12 +18,15 @@
(defun km/sync-mail ()
(interactive)
(let ((bufname (get-buffer-create "*Mail sync*"))
- (default-directory "~"))
+ (default-directory "~")
+ (process "mail-sync"))
(with-current-buffer bufname
(view-mode 1)
(goto-char (point-max)))
(display-buffer bufname)
- (start-process "mail sync" bufname km/sync-mail-cmd)))
+ (if (process-live-p process)
+ (message "Mail sync process is already running")
+ (start-process process bufname km/sync-mail-cmd))))
(defvar km/sync-mail-cmd "~/bin/sync-mail.sh"
"Run sync mail script.")