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:26:26 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11488d169f366b055b511bd1" X-Trace: blaine.gmane.org 1507778838 10350 195.159.176.226 (12 Oct 2017 03:27:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2017 03:27:18 +0000 (UTC) To: 28792@debbugs.gnu.org, tino.calancha@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 12 05:27:12 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 1e2U9H-0000qK-Sx for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Oct 2017 05:27:04 +0200 Original-Received: from localhost ([::1]:43485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2U9O-0000HJ-VL for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Oct 2017 23:27:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2U9H-0000Gz-R1 for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:27:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2U9G-0001ew-5j for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:27:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54270) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2U9G-0001ep-1w for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e2U9F-0006Ut-P3 for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:27:01 -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:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28792 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" , Tino Calancha Original-Received: via spool by submit@debbugs.gnu.org id=B.150777881224951 (code B ref -1); Thu, 12 Oct 2017 03:27:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Oct 2017 03:26:52 +0000 Original-Received: from localhost ([127.0.0.1]:34718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2U95-0006UN-Le for submit@debbugs.gnu.org; Wed, 11 Oct 2017 23:26:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2U93-0006U8-57 for submit@debbugs.gnu.org; Wed, 11 Oct 2017 23:26:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2U8w-0001WG-DR for submit@debbugs.gnu.org; Wed, 11 Oct 2017 23:26:44 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42135) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2U8w-0001WC-92 for submit@debbugs.gnu.org; Wed, 11 Oct 2017 23:26:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2U8u-0000F6-Jo for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:26:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2U8s-0001Ui-UA for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:26:40 -0400 Original-Received: from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d]:47381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2U8s-0001UQ-O3 for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2017 23:26:38 -0400 Original-Received: by mail-qt0-x22d.google.com with SMTP id z50so11301094qtj.4 for ; Wed, 11 Oct 2017 20:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=rP3OEhA45lv7O4QRaxZgSRjZTp3Ig+oI8C5TydlbmUI=; b=FIoTaqL7Ps9fWJ+bRgrd3TeVKnrJ9Kec7XdhIFM1xDBvNOJhLVzjgPAb7ZGZP5zcmj rpyPHLkRLZg6lGJQrO2M78PsikYw8PdDWHcGQlIhS/4ySVJ/FdYIwEszk9R7wAzDoSPA aXWyAG/1qRyQvAF896I7CtOfu5jUsABKdT8+45oFplRPhQms1qeVET8hIas9Pk52jpZ6 IlrpIyU7sxc++mZjHZpyO2mqGh0jx/TSlF4Gt336l0zYSJgVF+LqyDX2aP6a7FfngRPQ CKgrrYNdRWdpzrdeGNOFNRdDp/KzhlQzJfPphj6Qw4LNXadMB6WfZIj5ZsJW40yMT8f8 FsDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rP3OEhA45lv7O4QRaxZgSRjZTp3Ig+oI8C5TydlbmUI=; b=dEO/wev9DgslhPZiEjz6UBapj6yOCdeyaeQ11qV/++nkmCnH4KV0Wn+6YukFdalaOs UoZI5D2FAAwYh7385fEiO3W4hP7naSNIfINxF9dEgnn/bv1wJMjIZ5WGwcSN97P20l5y 33gyllC3UUdjKNi+SmgslT6sGppB8T5IzIWCFNVhAioU7yhVbdRjf7Pe2OlnbOfbsjE7 2o54n5iQMxLb3WWLD9GUUpaoatv1Pj18tQFASndsX13LSvJr34StelINfPff0bf4f6Uz ZGb1N9XxzLTfalfSMQNCOqRfqBDuIwiC0fO/TfKf2fHtHNwr28WkoEkMyG/3/Q3EaR2K 1MGQ== X-Gm-Message-State: AMCzsaUUznR5L80n6NEgBi66JW8sO9v8XhsyY3M6O5yNVR4qXaVWlt1O DnPGe1tE2EqrXpm6zAkUDYZhAThr37yHAUbsa2o= X-Google-Smtp-Source: AOwi7QDpCNWQUC0iy2TGkRY0w8b7ZHson2bA0z3S3TQ3D1WpvFG+K0C4Yc17bot1SC956LQOwVbIt6ia44uqpGanKfI= X-Received: by 10.37.114.87 with SMTP id n84mr951998ybc.504.1507778797448; Wed, 11 Oct 2017 20:26:37 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:138243 Archived-At: --001a11488d169f366b055b511bd1 Content-Type: text/plain; charset="UTF-8" Hello, This seems to be a regression from emacs 25.x. If I have set delete-by-moving-to-trash to t AND trash-directory to a custom value (there's a qualifier though, read further), I get this error, but that does not trigger backtrace even after toggle-debug-on-error! ===== Trashing... (file-error Non-regular file Is a directory /home/kmodi/.emacs.d/foo) ===== I was though able to force a backtrace (shown below) after trying to recreate the same error after evaluating: (setq debug-on-message "Non-regular") ===== Debugger entered--Lisp error: "(file-error Non-regular file Is a directory /home/kmodi/.emacs.d/foo)\n" message("%s" "(file-error Non-regular file Is a directory /home/kmodi/.emacs.d/foo)\n") dired-log-summary("1 of 1 deletion failed" ("/home/kmodi/.emacs.d/foo")) dired-internal-do-deletions((("/home/kmodi/.emacs.d/foo" . 2827)) nil t) dired-do-delete(nil) funcall-interactively(dired-do-delete nil) call-interactively(dired-do-delete nil nil) command-execute(dired-do-delete) ===== Here is the recipe to recreate this in emacs -Q: 1. First evaluate the below (progn (setq delete-by-moving-to-trash t) (setq trash-directory (let ((dir (concat temporary-file-directory (getenv "USER") "/.trash_emacs/"))) ;Must end with / (mkdir dir :parents) dir)) (setq debug-on-message "Non-regular")) 2. Now evaluate ;; CASE A (let ((dir (concat user-emacs-directory "foo/"))) (mkdir dir :parents) (dired (concat dir ".."))) Now when you move the point to the foo dir, hit D and type yes, you will get the above pasted backtrace. Now here is the qualifier piece.. the same error does not happen if I try to delete a directory in the temporary-file-directory! So when I evaluate: ;; CASE B (let ((dir (concat temporary-file-directory "foo/"))) (mkdir dir :parents) (dired (concat dir ".."))) Then move the point to the foo dir, hit D and type yes, the deletion (trashing) of that foo directory happens fine without that error. So with this, CASE A gives error, CASE B does not. Here's a twist.. Now let's move the trash directory from temporary-file-directory to user-emacs-directory .. eval the below: (setq trash-directory (let ((dir (concat user-emacs-directory "/.trash_emacs/"))) ;Must end with / (mkdir dir :parents) dir)) NOW, CASE A above will work fine, and CASE B will give that error. My machine is RHEL 6.6. And the drives are NFS mounts. So I don't know which of the below is true: - Gives an error if the ORIG directory and TRASH directory are on possibly different mounts. - Gives an error if the ORIG and TRASH directory do not have the same root directory (/home vs /tmp in the above example). So that is the main bug report. Side bug report on the fact that the below error does not generate a backtrace with toggle-debug-on-error.. why is that? (file-error Non-regular file Is a directory /home/kmodi/.emacs.d/foo) (Thanks for reading through this whole bug report.. hopefully someone is able to reproduce this issue and fix it.) ----- In GNU Emacs 26.0.60 (build 26, x86_64-pc-linux-gnu, GTK+ Version 2.24.23) of 2017-10-11 Repository revision: 419a371f8b3d4ba200770be07136f909c7984ece Windowing system distributor 'The X.Org Foundation', version 11.0.60900000 System Description: Red Hat Enterprise Linux Workstation release 6.6 (Santiago) Configured using: 'configure --with-modules --prefix=/home/kmodi/usr_local/apps/6/emacs/emacs-26 '--program-transform-name=s/^ctags$/ctags_emacs/' 'CPPFLAGS=-I/home/kmodi/usr_local/6/include -I/usr/include/freetype2 -I/usr/include' 'CFLAGS=-ggdb3 -O0' 'CXXFLAGS=-ggdb3 -O0' 'LDFLAGS=-L/home/kmodi/usr_local/6/lib -L/home/kmodi/usr_local/6/lib64 -ggdb3'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 MODULES Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix -- Kaushal Modi --001a11488d169f366b055b511bd1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

This seems to be a re= gression from emacs 25.x.

If I have set delete-by-= moving-to-trash to t AND trash-directory to a custom value (there's a q= ualifier though, read further), I get this error, but that does not trigger= backtrace even after toggle-debug-on-error!

=3D= =3D=3D=3D=3D
Trashing...
(file-error Non-regular f= ile Is a directory /home/kmodi/.emacs.d/foo)
=3D=3D=3D=3D= =3D

I was though able to force a backtrace (shown = below) after trying to recreate the same error after evaluating:
=
=C2=A0 (setq debug-on-message "Non-regular")=C2=A0=

=3D=3D=3D=3D=3D=C2=A0
Debugger= entered--Lisp error: "(file-error Non-regular file Is a directory /ho= me/kmodi/.emacs.d/foo)\n"
=C2=A0 message("%s" &quo= t;(file-error Non-regular file Is a directory /home/kmodi/.emacs.d/foo)\n&q= uot;)
=C2=A0 dired-log-summary("1 of 1 deletion failed"= ("/home/kmodi/.emacs.d/foo"))
=C2=A0 dired-internal-do= -deletions((("/home/kmodi/.emacs.d/foo" . 2827)) nil t)
=C2=A0 dired-do-delete(nil)
=C2=A0 funcall-interactively(dired-d= o-delete nil)
=C2=A0 call-interactively(dired-do-delete nil nil)<= /div>
=C2=A0 command-execute(dired-do-delete)
=3D=3D=3D= =3D=3D

Here is the recipe to recreate this in emac= s -Q:

1. First evaluate the below
<= br>
(progn
=C2=A0 (setq delete-by-moving-to-trash t)
=C2=A0 (setq trash-directory
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = (let ((dir (concat 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(getenv "USER") "/.trash_emacs/"))) ;Must end with /=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (mkdir dir :parents)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dir))
=C2=A0 (setq debug-on-= message "Non-regular"))

2. Now evaluate<= /div>

;; CASE A
(let ((dir (con= cat user-emacs-directory "foo/")))
=C2=A0 (mkdir dir :p= arents)
=C2=A0 (dired (concat dir "..")))

Now when you move the point to the foo dir, hit D and type yes= , you will get the above pasted backtrace.

Now her= e is the qualifier piece.. the same error does not happen if I try to delet= e a directory in the temporary-file-directory!

So when I evaluate:

;; CASE B
(le= t ((dir (concat temporary-file-directory "foo/")))
=C2= =A0 (mkdir dir :parents)
=C2=A0 (dired (concat dir ".."= )))

Then move the point to the foo dir,= hit D and type yes, the deletion (trashing) of that foo directory happens = fine without that error.

So with this, CASE A gives error, CASE B does= not.

Here's a twist..

Now let's move the trash d= irectory from temporary-file-directory to user-emacs-directory .. eval the = below:

=C2=A0 (setq trash-directory
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((dir (concat user-emacs-directory "= /.trash_emacs/"))) ;Must end with /
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (mkdir dir :parents)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 dir))

NOW, CASE A above will work fine, and CASE B will give that error.=

My machine is RHEL 6.6. And th= e drives are NFS mounts. So I don't know which of the below is true:

- Gives an error if the ORIG directory and TRASH dir= ectory are on possibly different mounts.=C2=A0
- Gives an error i= f the ORIG and TRASH directory do not have the same root directory (/home v= s /tmp in the above example).

<= /div>
So that is the main bug report.

Side bug= report on the fact that the below error does not generate a backtrace with= toggle-debug-on-error.. why is that?

(file-error = Non-regular file Is a directory /home/kmodi/.emacs.d/foo)=C2=A0=C2=A0

(Thanks for reading through this whole bug report..= hopefully someone is able to reproduce this issue and fix it.)
<= br>

-----
In GNU Emacs 26.0.60 (build 26= , x86_64-pc-linux-gnu, GTK+ Version 2.24.23)
=C2=A0of 2017-10-11<= /div>
Repository revision: 419a371f8b3d4ba200770be07136f909c7984ece
Windowing system distributor 'The X.Org Foundation', version= 11.0.60900000
System Description: Red Hat Enterprise Linux Workstation release 6.6 (Santiago)
<= div>
Configured using:
=C2=A0'configure --with-= modules
=C2=A0--prefix=3D/home/kmodi/usr_local/apps/6/emacs/emacs= -26
=C2=A0'--program-transform-name=3Ds/^ctags$/ctags_emacs/&= #39;
=C2=A0'CPPFLAGS=3D-I/home/kmodi/usr_local/6/include -I/u= sr/include/freetype2
=C2=A0-I/usr/include' 'CFLAGS=3D-ggd= b3 -O0' 'CXXFLAGS=3D-ggdb3 -O0'
=C2=A0'LDFLAGS=3D= -L/home/kmodi/usr_local/6/lib -L/home/kmodi/usr_local/6/lib64
=C2= =A0-ggdb3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB
TOO= LKIT_SCROLL_BARS GTK2 X11 MODULES

Important settin= gs:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 value of = $XMODIFIERS: @im=3Dnone
=C2=A0 locale-coding-system: utf-8-unix


--

Kaushal Modi

--001a11488d169f366b055b511bd1--