From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs 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 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114fbe68a7786a055b5176ed" X-Trace: blaine.gmane.org 1507781165 21596 195.159.176.226 (12 Oct 2017 04:06:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2017 04:06:05 +0000 (UTC) To: 28792@debbugs.gnu.org, Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 12 06:05:59 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2Ukx-0004uY-0O for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Oct 2017 06:05:59 +0200 Original-Received: from localhost ([::1]:43631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2Ul4-00012o-9J for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Oct 2017 00:06:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2UYT-0006uH-Nb for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:53:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2UYQ-0003Xc-IU for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:53:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54290) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2UYQ-0003XS-DP for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e2UYQ-0007BU-6n for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Oct 2017 03:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28792 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28792-submit@debbugs.gnu.org id=B28792.150778033227544 (code B ref 28792); Thu, 12 Oct 2017 03:53:02 +0000 Original-Received: (at 28792) by debbugs.gnu.org; 12 Oct 2017 03:52:12 +0000 Original-Received: from localhost ([127.0.0.1]:34737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2UXb-0007AB-LY for submit@debbugs.gnu.org; Wed, 11 Oct 2017 23:52:12 -0400 Original-Received: from mail-qt0-f170.google.com ([209.85.216.170]:43026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2UXa-00079o-Lx for 28792@debbugs.gnu.org; Wed, 11 Oct 2017 23:52:11 -0400 Original-Received: by mail-qt0-f170.google.com with SMTP id j58so278070qtj.0 for <28792@debbugs.gnu.org>; Wed, 11 Oct 2017 20:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=bA/LsDnX7JwT+SixviCDbj8rAiYH28h9pv/T85ZfT9s=; b=U8CygHi8wScGX6UJoVNh7croLqfsJBOZGVpACitu7bBwKHio6GEVd8Ns4SuFoR/M4D aiXVuwoDPp4E6Hq98JwNJyH9CjYBE8OVuR+Qf6rFR+VG+G0qpcfdGgINDUIOpjlBkEsL meNx55mJipt6uBg23ibJF7umsIOLn6yHQ0LTIx9DZBBJHwOvxitpNwkk6ly1WckQlIj7 tw2oQj3pi/Frr5+vE7R2GHdzqbl2G+Opiq4JWnPl5FWbobY7ZExsGCfnw7dDS2eghPE6 3ZaArn0dA1Czd3/RZAglqulbOBlCDDpQSLtJJuarhDb1FdKq+qLEBgEXlsJKg9pggftH P3aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=bA/LsDnX7JwT+SixviCDbj8rAiYH28h9pv/T85ZfT9s=; b=DrircleS8+xK7OWMOkR8eArYUSFIkAn15JHIcLN6TuJ783qwgJntDmixkTaSDD9SWq ebtZbGxvopWGfZhghdzJHMjBlW7z/Es8mhfxYlCDVJ3AcfVsAcG6x+D6Y2qCu2yzpG/d HZrFATj2/hMOKau2b390zGe/tXqUllmf+DJsokylKlXefU03b9Jq8kmpw5y4FdMNO1lk peC8PD4zieHdWngPy07lw/b/E7f+WwncLlbRo4S76Renof2ATdQYcz4io1Wt4BENKh0Y EsfQ9m+XmVEDzuV0SIWqGvlGFINsqZQiGNJNwVkqiVXDc7NR67XoDWuJEJAcCz46Bguf MQ0A== X-Gm-Message-State: AMCzsaV2xwKp7cTy8HWK9PysTqaFYuQZFm+FG+oU5t4xb88lm4gJwyex ykIdqD6DQDV+9YqiwoiGLWt8/xaLjyHNLWHAya0= X-Google-Smtp-Source: AOwi7QCHuuXPU9kvFao8wU7B2ZciZZG4YExJImZOyEh/KzhX7oUTXKPiH29SUyikZ5AU1wxwM+zIv8vOmFAwNMOxG+E= X-Received: by 10.13.213.7 with SMTP id x7mr954337ywd.185.1507780324716; Wed, 11 Oct 2017 20:52:04 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138246 Archived-At: --001a114fbe68a7786a055b5176ed Content-Type: text/plain; charset="UTF-8" On Wed, Oct 11, 2017 at 11:35 PM Kaushal Modi 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 --001a114fbe68a7786a055b5176ed Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 tra= sh-directory to nil, then I believe the default system trash directory is c= reated somewhere in my /home.

Because then, based on my = earlier email,=C2=A0CASE A (deleting directory in my emacs user dir works fine,= but CASE B (deleting directory in my /tmp) gives that error.
<= div>=
So far, at least on my machine, it looks like if <= /div>

- delete-by-moving-to-trash is t, AND
<= div>= - trash-directory is in /tmp and to-be-deleted-dir in is HOME (or vice-vers= a)

this error occurs.

The situation unfolds further!

<= /div>
Turns out this has nothing to do with dired. So taking off Tino f= rom the To: list (sorry for doing that earlier).

N= ow I think that this probably has to do with the rename-file series of comm= its (=C2=A0http://git.s= avannah.gnu.org/cgit/emacs.git/commit/?h=3Demacs-26&id=3D446e92548f932f= 18d57924573b49b5e6f4ae70c4=C2=A0). 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 t= rash-directory and to-be-del directory do not share the same root?/mount?

;; WORKS
;; Both trash-directory and to-b= e-del dirs in temporary-file-directory
(let ((trash-directory (co= ncat temporary-file-directory
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(getenv "USER") "/.trash_emacs/"))
=C2=A0 = =C2=A0 =C2=A0 (to-be-del (concat temporary-file-directory "foo/")= ))
=C2=A0 (mkdir trash-directory :parents)
=C2=A0 (mkdi= r to-be-del :parents)
=C2=A0 (move-file-to-trash to-be-del))

;; WORKS
;; Both trash-directory and to-be-d= el dirs in user-emacs-directory
(let ((trash-directory (concat us= er-emacs-directory "/.trash_emacs/"))
=C2=A0 =C2=A0 =C2= =A0 (to-be-del (concat user-emacs-directory "foo/")))
= =C2=A0 (mkdir trash-directory :parents)
=C2=A0 (mkdir to-be-del := parents)
=C2=A0 (move-file-to-trash to-be-del))

;; FAILS!!
;; trash-directory in temporary-file-directory= but to-be-del dir in
;; user-emacs-directory
(let ((tr= ash-directory (concat user-emacs-directory "/.trash_emacs/"))
=C2=A0 =C2=A0 =C2=A0 (to-be-del (concat temporary-file-directory &qu= ot;foo/")))
=C2=A0 (mkdir trash-directory :parents)
=C2=A0 (mkdir to-be-del :parents)
=C2=A0 (move-file-to-trash to= -be-del))

When I eval this 3rd form, I get this er= ror back trace:

Debugger entered--Lisp error:= (file-error "Non-regular file" "Is a directory" "= /tmp/foo")
=C2=A0 rename-file("/tmp/foo" "/ho= me/kmodi/.emacs.d/.trash_emacs/foo.~1~")
=C2=A0 move-file-to= -trash("/tmp/foo/")
=C2=A0 (let ((trash-directory (conc= at user-emacs-directory "/.trash_emacs/")) (to-be-del (concat tem= porary-file-directory "foo/"))) (mkdir trash-directory :parents) = (mkdir to-be-del :parents) (move-file-to-trash to-be-del))
=C2=A0= eval((let ((trash-directory (concat user-emacs-directory "/.trash_ema= cs/")) (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)
=C2=A0 elisp--eval-last-sexp(nil)
=C2=A0 eval-last-sexp(nil)
=C2=A0 funcall-interactively(eval-la= st-sexp nil)
=C2=A0 call-interactively(eval-last-sexp nil nil)
=C2=A0 command-execute(eval-last-sexp)

--

Kaushal Modi

--001a114fbe68a7786a055b5176ed--