1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-06 20:49:33 +00:00

Fix agent directory deletion

* lisp/gnus/gnus-agent.el (gnus-agent-expire-unagentized-dirs):
Delete directories in a simpler way that actually works (bug#50986).
This commit is contained in:
Lars Ingebrigtsen 2021-10-03 11:28:27 +02:00
parent b1a8a66fb0
commit b47d7ce1b8

View File

@ -3553,32 +3553,13 @@ articles in every agentized group? "))
(when (and to-remove
(or gnus-expert-user
(gnus-y-or-n-p
"gnus-agent-expire has identified local directories that are\
not currently required by any agentized group. Do you wish to consider\
deleting them?")))
(while to-remove
(let ((dir (pop to-remove)))
(if (or gnus-expert-user
"gnus-agent-expire has identified local directories that are
not currently required by any agentized group. Do you wish to consider
deleting them?")))
(dolist (dir to-remove)
(when (or gnus-expert-user
(gnus-y-or-n-p (format "Delete %s? " dir)))
(let* (delete-recursive
files f
(delete-recursive
(lambda (f-or-d)
(ignore-errors
(if (file-directory-p f-or-d)
(condition-case nil
(delete-directory f-or-d)
(file-error
(setq files (directory-files f-or-d))
(while files
(setq f (pop files))
(or (member f '("." ".."))
(funcall delete-recursive
(nnheader-concat
f-or-d f))))
(delete-directory f-or-d)))
(delete-file f-or-d))))))
(funcall delete-recursive dir)))))))))
(delete-directory dir t)))))))
;;;###autoload
(defun gnus-agent-batch ()