Subject: Re: bug#6070: 23.1.96; delete-by-moving-to-trash

From: Leo <[email-masked]>
Date: Sat, 01 May 2010 13:43:28 +0100

On 2010-05-01 05:44 +0100, Leo wrote:
>> Thank you for the quick fix. I will be using it and let you if there are
>> other cases need fixing.
>
> delete-auto-save-file-if-necessary still creates a lot temp files in the
> trash bin. Any idea where names like emacs6ljgy9 or emacsXWkc8c come
> from? They look like temp file. Is it from with-temp-file?

These are from the following files in Gnus:

----------------
leo@Victoria ...share/emacs/23.1.96/lisp/gnus$ zgrep
-n "delete-file" mm*.el.gz
mm-decode.el.gz:874:               (ignore-errors (delete-file file))
mm-decode.el.gz:899:
(delete-file ,file)
mm-decode.el.gz:1031:     (ignore-errors (delete-file (car object)))
mm-decode.el.gz:1434:         (delete-file file)))))
mm-view.el.gz:366:      (delete-file file))
mml-smime.el.gz:140:        (delete-file tmp))
mml-smime.el.gz:143:        (delete-file tmp))
mml2015.el.gz:858:                (delete-file signature-file)
mml2015.el.gz:863:                  (delete-file signature-file)
----------------

In my view the current implementation of this feature is far from
optimal. It is almost sure that every occurrence of delete-file should
not move things to trash bin. And it seems only a handful of commands
need to move things to trash bin when deleting. Do you have a better way
of fixing this bug? Thank you.

I have been thinking whether it will be better to introduce a new
function delete-file-soft that respects delete-by-moving-to-trash while
leaving delete-file alone.

Leo