diff options
author | Kyle Meyer <kyle@kyleam.com> | 2017-02-26 23:45:41 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2017-03-01 00:00:42 -0500 |
commit | def9e6d16b0d39fadebfcad8ad1d5464c53df5dd (patch) | |
tree | 99a81e7aca83f712adcedbccbb33971ef8c6c032 | |
parent | f63ab8705efc5d6e3794ab83492812600cabbb38 (diff) | |
download | emacs.d-def9e6d16b0d39fadebfcad8ad1d5464c53df5dd.tar.gz |
mail: Log sync to file rather than buffer
-rw-r--r-- | lisp/km-mail.el | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/km-mail.el b/lisp/km-mail.el index d64ee96..ddc5de9 100644 --- a/lisp/km-mail.el +++ b/lisp/km-mail.el @@ -35,13 +35,13 @@ ;;; Mail sync -(defun mail-sync-log-buffer (buf _) - (let ((bstring (with-current-buffer buf - (buffer-string)))) - (with-current-buffer (get-buffer-create "*mail-sync-log*") - (goto-char (point-max)) - (insert "\n\n\n") - (insert bstring)))) +(defvar mail-sync-log-file "/var/log/mail-sync/mail-sync") + +(defun mail-sync-log-to-file (buf _) + (with-temp-buffer + (insert "\n") + (insert (with-current-buffer buf (buffer-string))) + (write-region nil nil mail-sync-log-file 'append 'no-msg))) (defvar mail-sync-calling-buffer nil) (defun mail-sync-refresh-caller (_ exit) @@ -56,7 +56,7 @@ (define-compilation-mode mail-sync-mode "Mail-sync" "Sync mail, logging output to *mail-sync-log*." (set (make-local-variable 'compilation-finish-functions) - '(mail-sync-log-buffer mail-sync-refresh-caller))) + '(mail-sync-log-to-file mail-sync-refresh-caller))) ;;;###autoload (defun km/notmuch-sync-mail (&optional cmd-append) |