GNU bug report logs - #6070
23.1.96; delete-by-moving-to-trash

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Sat, 1 May 2010 01:42:01 UTC

Severity: normal

Found in version 23.1.96

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6070 in the body.
You can then email your comments to 6070 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6070; Package emacs. (Sat, 01 May 2010 01:42:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 01 May 2010 01:42:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1.96; delete-by-moving-to-trash
Date: Sat, 01 May 2010 02:41:41 +0100
[Message part 1 (text/plain, inline)]
While experimenting some of the new features, I quite like to use
delete-by-moving-to-trash to double protect deleting files by accident.

However, with (setq delete-by-moving-to-trash t), a lot of (internal)
temporary files are also moved to the trash bin. See the attached file
for an output of `ls' in the .Trash directory after roughly two hours of
emacs.

To reproduce, just (setq delete-by-moving-to-trash t) and carry on with
normal Emacs editing. After a while you should notice the trash bin
heavily populated.

The trash bin is a buffer area to rescue a lost file. Flood it with many
internal temp files makes it very difficult to do so. Before emptying
the trash bin (or remove files permanently) I (I guess many will do the
same) often have a quick look at the files. This is now almost
impossible if delete-by-moving-to-trash has been used.

Could someone take a look at this issue? Thank you.

Leo

[trash-ls.log (text/plain, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6070; Package emacs. (Sat, 01 May 2010 02:20:02 GMT) Full text and rfc822 format available.

Message #8 received at 6070 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Leo <sdl.web <at> gmail.com>
Cc: 6070 <at> debbugs.gnu.org
Subject: Re: bug#6070: 23.1.96; delete-by-moving-to-trash
Date: Fri, 30 Apr 2010 22:19:45 -0400
Leo <sdl.web <at> gmail.com> writes:

> While experimenting some of the new features, I quite like to use
> delete-by-moving-to-trash to double protect deleting files by accident.
>
> However, with (setq delete-by-moving-to-trash t), a lot of (internal)
> temporary files are also moved to the trash bin. See the attached file
> for an output of `ls' in the .Trash directory after roughly two hours of
> emacs.

Good point.  I have commited a change that inhibits trashing for
jka-compr, server, diff, and epg.  Probably more such changes are
required.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6070; Package emacs. (Sat, 01 May 2010 04:01:01 GMT) Full text and rfc822 format available.

Message #11 received at 6070 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 6070 <at> debbugs.gnu.org
Subject: Re: bug#6070: 23.1.96; delete-by-moving-to-trash
Date: Sat, 01 May 2010 05:00:00 +0100
On 2010-05-01 03:19 +0100, Chong Yidong wrote:
>> However, with (setq delete-by-moving-to-trash t), a lot of (internal)
>> temporary files are also moved to the trash bin. See the attached file
>> for an output of `ls' in the .Trash directory after roughly two hours of
>> emacs.
>
> Good point.  I have commited a change that inhibits trashing for
> jka-compr, server, diff, and epg.  Probably more such changes are
> required.

Thank you for the quick fix. I will be using it and let you if there are
other cases need fixing.

Leo




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6070; Package emacs. (Sat, 01 May 2010 04:45:02 GMT) Full text and rfc822 format available.

Message #14 received at 6070 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 6070 <at> debbugs.gnu.org
Subject: Re: bug#6070: 23.1.96; delete-by-moving-to-trash
Date: Sat, 01 May 2010 05:44:52 +0100
On 2010-05-01 05:00 +0100, Leo wrote:
>> Good point.  I have commited a change that inhibits trashing for
>> jka-compr, server, diff, and epg.  Probably more such changes are
>> required.
>
> 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?

Cheers,

Leo




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6070; Package emacs. (Sat, 01 May 2010 12:44:02 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#6070: 23.1.96; delete-by-moving-to-trash
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 <at> 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






Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6070; Package emacs. (Sat, 01 May 2010 14:19:02 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Leo <sdl.web <at> gmail.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#6070: 23.1.96; delete-by-moving-to-trash
Date: Sat, 01 May 2010 17:17:51 +0300
> From: Leo <sdl.web <at> gmail.com>
> Date: Sat, 01 May 2010 13:43:28 +0100
> Cc: 
> 
> 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?

Perhaps the few functions that create temporary files should record
the file in some list, and delete-file could then consult that list to
decide whether to delete or move to trash bin.

Alternatively, perhaps only a few interactive commands should actually
move to trash, while all the other uses of delete-file should actually
delete.





bug closed, send any further explanations to Leo <sdl.web <at> gmail.com> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Mon, 22 Nov 2010 00:43:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 20 Dec 2010 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 180 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.