summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sebastian Hofer <sebastian.hofer@univie.ac.at>2012-03-13 19:26:03 +0100
committerGravatar Julien Danjou <julien@danjou.info>2012-03-14 11:09:24 +0100
commitc0d6df70ddf0d32b6c3416bee7b1811b147c3d4b (patch)
tree6d29996722636cb5627871163204556bb7799afa
parentcbb4ee618a96ec529bcbcac5ee4be36cb1d797f3 (diff)
Send SIGKILL when `offline-imap' is called with prefix
I'm using offlineimap and offlineimap-el to read my mails with wanderlust in emacs. When offlineimap crashes (mostly due to a lost internet connection as I am working on a laptop) it crashes hard, which means I can only kill it with sigkill. Your offlineimap-kill function only sends sigterm, which is not enough. Today I was annoyed enough to finally fix it. Now, when I give a prefix arg sigkill is used. I thought you might want to add that to your git repository (diff attached). Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r--offlineimap.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/offlineimap.el b/offlineimap.el
index f9ac3ac..864d5f8 100644
--- a/offlineimap.el
+++ b/offlineimap.el
@@ -286,10 +286,11 @@ This is used when `offlineimap-mode-line-style' is set to 'symbol."
(interactive)
(signal-process (get-buffer-process (get-buffer offlineimap-buffer-name)) 'SIGUSR1))
-(defun offlineimap-kill ()
+(defun offlineimap-kill (&optional arg)
"Send a TERM signal to OfflineIMAP."
- (interactive)
- (signal-process (get-buffer-process (get-buffer offlineimap-buffer-name)) 'SIGTERM))
+ (interactive "P")
+ (let ((sig (if arg 'SIGKILL 'SIGTERM)))
+ (signal-process (get-buffer-process (get-buffer offlineimap-buffer-name)) sig)))
(define-derived-mode offlineimap-mode fundamental-mode "OfflineIMAP"
"A major mode for OfflineIMAP interaction."