From a977a1ce48fb23ad1855e25dfe08e8913b022f86 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 17 Feb 2014 01:18:11 -0500 Subject: Check for process before syncing mail --- lisp/init-gnus.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp') 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.") -- cgit v1.2.3