From 063ab4b028913af59e141da808070b1b38f9c244 Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Thu, 19 Dec 2013 04:41:35 +0000 Subject: [PATCH] lisp/gnus/gnus-uu.el: Fix temporary files deletion bug --- lisp/gnus/ChangeLog | 9 +++++++++ lisp/gnus/gnus-uu.el | 9 ++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index fb5b85356cd..93abbde3bef 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,12 @@ +2013-12-18 Katsumi Yamaoka + + * gnus-uu.el (gnus-uu-decode-binhex, gnus-uu-decode-binhex-view): + Make sure work directory exists. + (gnus-uu-digest-mail-forward): Store temporary files in work directory + rather than tmp directory. + (gnus-summary-prepare-exit-hook): Replace gnus-exit-group-hook, that is + not necessarily always run, with it. + 2013-12-18 Jan Tatarik * gnus-icalendar.el (gnus-icalendar-identities): Make changing the diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 16ed4f17801..0182361e6f3 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -406,6 +406,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (read-directory-name "Unbinhex and save in dir: " gnus-uu-default-dir gnus-uu-default-dir)))) + (gnus-uu-initialize) (setq gnus-uu-binhex-article-name (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir))) (gnus-uu-decode-with-method 'gnus-uu-binhex-article n dir)) @@ -471,6 +472,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (list current-prefix-arg (read-file-name "Unbinhex, view and save in dir: " gnus-uu-default-dir gnus-uu-default-dir))) + (gnus-uu-initialize) (setq gnus-uu-binhex-article-name (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir))) (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) @@ -482,8 +484,9 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (defun gnus-uu-digest-mail-forward (&optional n post) "Digests and forwards all articles in this series." (interactive "P") + (gnus-uu-initialize) (let ((gnus-uu-save-in-digest t) - (file (mm-make-temp-file (nnheader-concat gnus-uu-tmp-dir "forward"))) + (file (mm-make-temp-file (nnheader-concat gnus-uu-work-dir "forward"))) (message-forward-as-mime message-forward-as-mime) (mail-parse-charset gnus-newsgroup-charset) (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) @@ -1836,8 +1839,8 @@ Gnus might fail to display all of it.") ;; Initializing -(add-hook 'gnus-exit-group-hook 'gnus-uu-clean-up) -(add-hook 'gnus-exit-group-hook 'gnus-uu-delete-work-dir) +(add-hook 'gnus-summary-prepare-exit-hook 'gnus-uu-clean-up) +(add-hook 'gnus-summary-prepare-exit-hook 'gnus-uu-delete-work-dir) -- 2.39.2