From c0d6df70ddf0d32b6c3416bee7b1811b147c3d4b Mon Sep 17 00:00:00 2001 From: Sebastian Hofer Date: Tue, 13 Mar 2012 19:26:03 +0100 Subject: 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 --- offlineimap.el | 7 ++++--- 1 file 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." -- cgit v1.2.3