From: Kaushal Modi <kaushal.modi@gmail.com>
To: 28792@debbugs.gnu.org, Paul Eggert <eggert@cs.ucla.edu>
Subject: bug#28792: 26.0.60; Deleting to a custom trash directory in Dired gives error
Date: Thu, 12 Oct 2017 03:51:54 +0000 [thread overview]
Message-ID: <CAFyQvY14Tq6_9kYSpX01nB25okRPizDpfzA04+zOOVo+Yq50Gw@mail.gmail.com> (raw)
In-Reply-To: <CAFyQvY1-OQ+UdG_RU0TN3p4sn9j4TxYMYJXZVJrO7UAhzrXf1Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3156 bytes --]
On Wed, Oct 11, 2017 at 11:35 PM Kaushal Modi <kaushal.modi@gmail.com>
wrote:
> I'd like to add that if I leave the value of trash-directory to nil, then
> I believe the default system trash directory is created somewhere in my
> /home.
>
> Because then, based on my earlier email, CASE A (deleting directory in my
> emacs user dir works fine, but CASE B (deleting directory in my /tmp) gives
> that error.
>
> So far, at least on my machine, it looks like if
>
> - delete-by-moving-to-trash is t, AND
> - trash-directory is in /tmp and to-be-deleted-dir in is HOME (or
> vice-versa)
>
> this error occurs.
>
The situation unfolds further!
Turns out this has nothing to do with dired. So taking off Tino from the
To: list (sorry for doing that earlier).
Now I think that this probably has to do with the rename-file series of
commits (
http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-26&id=446e92548f932f18d57924573b49b5e6f4ae70c4
).
So copying Paul.
Here are even simpler recipes verified in emacs -Q:
1. First eval this one form to catch the error back trace
(setq debug-on-message "Non-regular")
2. Now eval the 3 forms below one by one.. the last one should fail as the
trash-directory and to-be-del directory do not share the same root?/mount?
;; WORKS
;; Both trash-directory and to-be-del dirs in temporary-file-directory
(let ((trash-directory (concat temporary-file-directory
(getenv "USER") "/.trash_emacs/"))
(to-be-del (concat temporary-file-directory "foo/")))
(mkdir trash-directory :parents)
(mkdir to-be-del :parents)
(move-file-to-trash to-be-del))
;; WORKS
;; Both trash-directory and to-be-del dirs in user-emacs-directory
(let ((trash-directory (concat user-emacs-directory "/.trash_emacs/"))
(to-be-del (concat user-emacs-directory "foo/")))
(mkdir trash-directory :parents)
(mkdir to-be-del :parents)
(move-file-to-trash to-be-del))
;; FAILS!!
;; trash-directory in temporary-file-directory but to-be-del dir in
;; user-emacs-directory
(let ((trash-directory (concat user-emacs-directory "/.trash_emacs/"))
(to-be-del (concat temporary-file-directory "foo/")))
(mkdir trash-directory :parents)
(mkdir to-be-del :parents)
(move-file-to-trash to-be-del))
When I eval this 3rd form, I get this error back trace:
Debugger entered--Lisp error: (file-error "Non-regular file" "Is a
directory" "/tmp/foo")
rename-file("/tmp/foo" "/home/kmodi/.emacs.d/.trash_emacs/foo.~1~")
move-file-to-trash("/tmp/foo/")
(let ((trash-directory (concat user-emacs-directory "/.trash_emacs/"))
(to-be-del (concat temporary-file-directory "foo/"))) (mkdir
trash-directory :parents) (mkdir to-be-del :parents) (move-file-to-trash
to-be-del))
eval((let ((trash-directory (concat user-emacs-directory
"/.trash_emacs/")) (to-be-del (concat temporary-file-directory "foo/")))
(mkdir trash-directory :parents) (mkdir to-be-del :parents)
(move-file-to-trash to-be-del)) nil)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
--
Kaushal Modi
[-- Attachment #2: Type: text/html, Size: 5161 bytes --]
next prev parent reply other threads:[~2017-10-12 3:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 3:26 bug#28792: 26.0.60; Deleting to a custom trash directory in Dired gives error Kaushal Modi
2017-10-12 3:36 ` Kaushal Modi
2017-10-12 3:51 ` Kaushal Modi [this message]
2017-10-12 12:50 ` Göktuğ Kayaalp
2017-10-12 12:58 ` Eli Zaretskii
2017-10-12 13:02 ` Kaushal Modi
2017-10-12 13:37 ` Göktuğ Kayaalp
2017-10-12 12:58 ` Kaushal Modi
2017-10-12 13:16 ` Eli Zaretskii
2017-10-12 13:31 ` Kaushal Modi
2017-10-12 13:44 ` Eli Zaretskii
2017-10-12 14:02 ` Andreas Schwab
2017-10-12 14:06 ` Kaushal Modi
2017-10-12 15:07 ` Kaushal Modi
2017-10-12 15:15 ` Eli Zaretskii
2017-10-12 15:27 ` Andreas Schwab
2017-10-12 15:31 ` Kaushal Modi
2017-10-12 20:25 ` Paul Eggert
2017-10-12 21:41 ` Kaushal Modi
2017-10-15 7:18 ` Paul Eggert
2017-10-15 13:35 ` Kaushal Modi
2017-10-15 13:47 ` Noam Postavsky
2017-10-12 14:24 ` Noam Postavsky
2017-10-12 14:43 ` Drew Adams
2017-10-12 15:07 ` Andreas Schwab
2017-10-12 15:10 ` Drew Adams
2017-10-12 13:34 ` Tino Calancha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFyQvY14Tq6_9kYSpX01nB25okRPizDpfzA04+zOOVo+Yq50Gw@mail.gmail.com \
--to=kaushal.modi@gmail.com \
--cc=28792@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).