GNU bug report logs -
#30624
27.0.50; dired-create-destination-dirs doesn't work when renaming more than one file
Previous Next
Reported by: Amos Bird <amosbird <at> gmail.com>
Date: Tue, 27 Feb 2018 02:30:03 UTC
Severity: normal
Found in version 27.0.50
Done: Tino Calancha <tino.calancha <at> gmail.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 30624 in the body.
You can then email your comments to 30624 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30624
; Package
emacs
.
(Tue, 27 Feb 2018 02:30:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Amos Bird <amosbird <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 27 Feb 2018 02:30:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi,
I'm using emacs 27.0.50 and have dired-create-destination-dirs set
to 'always.
When renaming more than one files to a new directory, dired throws
an error at
/usr/local/share/emacs/27.0.50/lisp/dired-aux.el.gz:1891 . It
fails early before
it has time to check whether a new directory should be created.
regards,
In GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
3.22.27)
of 2018-02-14 built on t450s
Repository revision: 298275c595f6ca9e77f8131d34dda2b58fe1faa5
Windowing system distributor 'The X.Org Foundation', version
11.0.11906000
System Description: Arch Linux
Recent messages:
Checking 4 files in
/home/amos/.emacs.d/.local/packages/elpa/vimish-fold-20171231.2212...
Checking 4 files in
/home/amos/.emacs.d/.local/packages/elpa/yapfify-20180105.1447...
Checking 4 files in
/home/amos/.emacs.d/.local/packages/elpa/fcitx-20170913.1900...
Checking 20 files in
/home/amos/.emacs.d/.local/packages/elpa/multiple-cursors-20170908.1452...
Checking 4 files in
/home/amos/.emacs.d/.local/packages/elpa/opencl-mode-20170816.549...
Checking for load-path shadows...done
Error during redisplay: (eval (doom-modeline-format--main))
signaled (wrong-type-argument stringp nil) [4 times]
Auto-saving...
Error during redisplay: (eval (doom-modeline-format--main))
signaled (wrong-type-argument stringp nil) [2 times]
Buffer *unsent mail to bug-gnu-emacs* modified; kill anyway? (y or
n) y
dired-do-create-files: Marked Move: target must be a directory:
/home/amos/git/ccutils/ffffff/
Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS NOTIFY ACL
GNUTLS LIBXML2 FREETYPE M17N_FLT
LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD
JSON LCMS2
Important settings:
value of $LC_CTYPE: zh_CN.UTF-8
value of $LANG: C
value of $XMODIFIERS: @im=fcitx
locale-coding-system: utf-8
Major mode: Dired by name
Minor modes in effect:
company-quickhelp-mode: t
company-quickhelp-local-mode: t
company-statistics-mode: t
global-company-mode: t
company-mode: t
TeX-PDF-mode: t
auto-compile-on-save-mode: t
global-git-commit-mode: t
async-bytecomp-package-mode: t
diff-auto-refine-mode: t
winner-mode: t
show-paren-mode: t
evil-escape-mode: t
evil-snipe-override-mode: t
evil-snipe-mode: t
evil-snipe-override-local-mode: t
evil-snipe-local-mode: t
realign-mode: t
save-place-mode: t
recentf-mode: t
smartparens-global-mode: t
evilified-leader-override-mode: t
global-evilified-leader-override-mode: t
auto-insert-mode: t
global-page-break-lines-mode: t
global-hl-line-mode: t
dired-omit-mode: t
savehist-mode: t
ws-butler-global-mode: t
ws-butler-mode: t
xterm-mouse-mode: t
global-git-gutter-mode: t
global-narrow-reindent-mode: t
narrow-reindent-mode: t
eldoc-in-minibuffer-mode: t
projectile-mode: t
ivy-mode: t
persp-mode: t
shell-dirtrack-mode: t
evil-mode: t
evil-local-mode: t
which-key-mode: t
global-undo-tree-mode: t
editorconfig-mode: t
global-auto-revert-mode: t
override-global-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
window-divider-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(pp shadow mail-extr emacsbug sendmail cc-playground time-stamp
modern-cpp-font-lock url-http url-gw
gravatar url-cache bug-reference texmathp unfill preview prv-emacs
tex-buf company-auctex
company-lua company-lsp company-quickhelp company-statistics
company-yasnippet company-ispell
company-dabbrev company-capf company reftex-dcr reftex-auc reftex
reftex-loaddefs reftex-vars
font-latex smartparens-latex latex tex-ispell tex-style tex
latexenc view dired-aux sort tramp
trampver tramp-compat tramp-loaddefs ucs-normalize parse-time
auto-compile packed rainbow-delimiters
highlight-quoted highlight-numbers parent-mode ace-link avy
disp-table eieio-opt speedbar sb-image
ezimage dframe help-fns radix-tree magit-svn evil-magit
magit-obsolete magit-blame magit-stash
magit-bisect magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-collab ghub url-auth
url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf mailcap magit-files
magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode
magit-core magit-autorevert
magit-process magit-margin magit-mode git-commit magit-git
magit-section magit-utils crm magit-popup
log-edit message format-spec rfc822 mml mml-sec epa epg epg-config
gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
mm-util ietf-drums mail-prsvr
mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log
with-editor async-bytecomp smex ido
shrink-path vc-git diff-mode yasnippet elec-pair hl-todo
smartparens-lua lua-mode editorconfig-core
editorconfig-core-handle editorconfig-fnmatch colir all-the-icons
all-the-icons-faces data-material
data-weathericons data-octicons data-fileicons data-faicons
data-alltheicons memoize persistent-soft
list-utils pcache eieio-base font-utils evil-vimish-fold
vimish-fold f winner paren doom-themes-org
doom-themes-neotree doom-one-theme evil-escape evil-snipe
nav-flash pulse warnings realign-mode
face-remap saveplace recentf tree-widget wid-edit
smartparens-config smartparens-text
smartparens-markdown smartparens solaire-mode cquery cquery-tree
cquery-codelens
cquery-semantic-highlighting cquery-common cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs lsp-ui lsp-ui-doc markdown-mode
noutline outline lsp-ui-imenu
lsp-ui-flycheck lsp-ui-peek lsp-ui-sideline lsp-imenu imenu
lsp-mode network-stream puny nsm rmc
starttls tls gnutls lsp-methods inline lsp-io lsp-notifications
lsp-common url-util kurecolor
rainbow-mode color dired-ranger bind-map autoinsert
page-break-lines helm-make helm helm-source
eieio-compat helm-multi-match helm-lib async ag vc-svn find-dired
s hl-line+ hl-line ivy-rich
dired-open dired-hacks-utils dired-x dired-quick-sort savehist
ls-lisp ws-butler xt-mouse
evil-terminal-cursor-changer evil-textobj-line git-gutter fcitx
dbus xml narrow-reindent osc
browse-url perl6-detect flycheck-ledger fringe-helper
flycheck-pos-tip pos-tip flycheck find-func
dash tex-site unicode-fonts let-alist evil-anzu anzu eldoc-eval
derived doom-themes
doom-themes-common counsel-projectile projectile grep ibuf-ext
ibuffer ibuffer-loaddefs counsel
dired dired-loaddefs compile esh-util etags ivy-xref xref project
swiper ivy delsel ivy-overlay ffap
persp-mode cl time-date evil evil-integration evil-maps
evil-commands reveal flyspell ispell
evil-jumps evil-command-window evil-types evil-search evil-ex
shell pcomplete comint ansi-color
evil-macros evil-repeat evil-states evil-core evil-common windmove
thingatpt rect evil-digraphs
evil-vars server core core-keybinds hydra ring lv which-key advice
core-projects core-editor
undo-tree diff editorconfig rx autorevert filenotify core-popups
edmacro kmacro shackle trace
core-ui cl-extra help-mode use-package use-package-ensure
use-package-delight use-package-diminish
use-package-bind-key bind-key use-package-core easy-mmode
autoloads core-os core-lib pcase subr-x
finder-inf package easymenu url-handlers url-parse auth-source
cl-seq eieio eieio-core
eieio-loaddefs password-cache json map url-vars seq byte-opt
bytecomp byte-compile cconv
core-packages cl-macs gv cl-loaddefs cl-lib mule-util china-util
tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame
cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese
eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)
Memory information:
((conses 16 1088997 459602)
(symbols 48 66787 141)
(miscs 40 1354 3276)
(strings 32 291164 33158)
(string-bytes 1 14013832)
(vectors 16 101437)
(vector-slots 8 2423876 103126)
(floats 8 953 3028)
(intervals 56 39806 7836)
(buffers 992 89))
--
Amos Bird
amosbird <at> gmail.com
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30624
; Package
emacs
.
(Mon, 19 Mar 2018 09:49:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 30624 <at> debbugs.gnu.org (full text, mbox):
> From: Amos Bird <amosbird <at> gmail.com>
> Date: Tue, 27 Feb 2018 10:29:09 +0800
>
> I'm using emacs 27.0.50 and have dired-create-destination-dirs set
> to 'always.
> When renaming more than one files to a new directory, dired throws
> an error at
> /usr/local/share/emacs/27.0.50/lisp/dired-aux.el.gz:1891 . It
> fails early before
> it has time to check whether a new directory should be created.
Sorry for the long delay in handling your report.
Tino, could you please look into fixing this? It looks like your
change that introduced dired-create-destination-dirs didn't support
the use case where several files are marked to be moved to a single
non-existent directory.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30624
; Package
emacs
.
(Sun, 01 Apr 2018 09:53:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 30624 <at> debbugs.gnu.org (full text, mbox):
Ping!
> Date: Mon, 19 Mar 2018 11:48:39 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 30624 <at> debbugs.gnu.org
>
> > From: Amos Bird <amosbird <at> gmail.com>
> > Date: Tue, 27 Feb 2018 10:29:09 +0800
> >
> > I'm using emacs 27.0.50 and have dired-create-destination-dirs set
> > to 'always.
> > When renaming more than one files to a new directory, dired throws
> > an error at
> > /usr/local/share/emacs/27.0.50/lisp/dired-aux.el.gz:1891 . It
> > fails early before
> > it has time to check whether a new directory should be created.
>
> Sorry for the long delay in handling your report.
>
> Tino, could you please look into fixing this? It looks like your
> change that introduced dired-create-destination-dirs didn't support
> the use case where several files are marked to be moved to a single
> non-existent directory.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30624
; Package
emacs
.
(Sun, 01 Apr 2018 11:09:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 30624 <at> debbugs.gnu.org (full text, mbox):
On Mon, 19 Mar 2018, Eli Zaretskii wrote:
>> From: Amos Bird <amosbird <at> gmail.com>
>> Date: Tue, 27 Feb 2018 10:29:09 +0800
>>
>> I'm using emacs 27.0.50 and have dired-create-destination-dirs set
>> to 'always.
>> When renaming more than one files to a new directory, dired throws
>> an error at
>> /usr/local/share/emacs/27.0.50/lisp/dired-aux.el.gz:1891 . It
>> fails early before
>> it has time to check whether a new directory should be created.
Thank you very much for your report Amos!
I would be enough to call `dired-maybe-create-dirs' right before
binding `into-dir', as follows:
--8<-----------------------------cut here---------------start------------->8---
commit a89518cfb2f57509d3f0e31ddfe097f56e95c484
Author: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sun Apr 1 19:54:23 2018 +0900
Honor dired-create-destination-dirs if copying/renaming >1 files
Check `dired-create-destination-dirs' when the user wants to
copy/rename several files.
* lisp/dired-aux.el (dired-do-create-files):
Call `dired-maybe-create-dirs' right before bind `into-dir' (Bug#30624).
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index e8b5e6755e..821b7d7975 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1864,29 +1864,31 @@ dired-do-create-files
(dired-mark-read-file-name
(concat (if dired-one-file op1 operation) " %s to: ")
target-dir op-symbol arg rfn-list default))))
- (into-dir (cond ((null how-to)
- ;; Allow users to change the letter case of
- ;; a directory on a case-insensitive
- ;; filesystem. If we don't test these
- ;; conditions up front, file-directory-p
- ;; below will return t on a case-insensitive
- ;; filesystem, and Emacs will try to move
- ;; foo -> foo/foo, which fails.
- (if (and (file-name-case-insensitive-p (car fn-list))
- (eq op-symbol 'move)
- dired-one-file
- (string= (downcase
- (expand-file-name (car fn-list)))
- (downcase
- (expand-file-name target)))
- (not (string=
- (file-name-nondirectory (car fn-list))
- (file-name-nondirectory target))))
- nil
- (file-directory-p target)))
- ((eq how-to t) nil)
- (t (funcall how-to target)))))
+ (into-dir
+ (progn
+ (unless dired-one-file (dired-maybe-create-dirs target))
+ (cond ((null how-to)
+ ;; Allow users to change the letter case of
+ ;; a directory on a case-insensitive
+ ;; filesystem. If we don't test these
+ ;; conditions up front, file-directory-p
+ ;; below will return t on a case-insensitive
+ ;; filesystem, and Emacs will try to move
+ ;; foo -> foo/foo, which fails.
+ (if (and (file-name-case-insensitive-p (car fn-list))
+ (eq op-symbol 'move)
+ dired-one-file
+ (string= (downcase
+ (expand-file-name (car fn-list)))
+ (downcase
+ (expand-file-name target)))
+ (not (string=
+ (file-name-nondirectory (car fn-list))
+ (file-name-nondirectory target))))
+ nil
+ (file-directory-p target)))
+ ((eq how-to t) nil)
+ (t (funcall how-to target))))))
(if (and (consp into-dir) (functionp (car into-dir)))
(apply (car into-dir) operation rfn-list fn-list target (cdr into-dir))
(if (not (or dired-one-file into-dir))
--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 27.0.50 (build 10, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
of 2018-03-30 built on calancha-pc
Repository revision: f759c5cfe4651af5f64fac2492fa362f8d383bd5
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30624
; Package
emacs
.
(Mon, 02 Apr 2018 02:59:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 30624 <at> debbugs.gnu.org (full text, mbox):
Tino Calancha <tino.calancha <at> gmail.com> writes:
> I would be enough to call `dired-maybe-create-dirs' right before
> binding `into-dir', as follows:
Added a test for this bug (dired-test-bug30624):
--8<-----------------------------cut here---------------start------------->8---
commit f7560f9bbbb2470378a1b31b52f6c3ff4cd6a7d7
Author: Tino Calancha <tino.calancha <at> gmail.com>
Date: Mon Apr 2 11:54:58 2018 +0900
Honor dired-create-destination-dirs if copying/renaming >1 files
Check `dired-create-destination-dirs' when the user wants to
copy/rename several files.
* lisp/dired-aux.el (dired-do-create-files):
Call `dired-maybe-create-dirs' right before bind `into-dir' (Bug#30624).
* test/lisp/dired-aux-tests.el (dired-test-bug30624): Add test.
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index e8b5e6755e..821b7d7975 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1864,28 +1864,31 @@ dired-do-create-files
(dired-mark-read-file-name
(concat (if dired-one-file op1 operation) " %s to: ")
target-dir op-symbol arg rfn-list default))))
- (into-dir (cond ((null how-to)
- ;; Allow users to change the letter case of
- ;; a directory on a case-insensitive
- ;; filesystem. If we don't test these
- ;; conditions up front, file-directory-p
- ;; below will return t on a case-insensitive
- ;; filesystem, and Emacs will try to move
- ;; foo -> foo/foo, which fails.
- (if (and (file-name-case-insensitive-p (car fn-list))
- (eq op-symbol 'move)
- dired-one-file
- (string= (downcase
- (expand-file-name (car fn-list)))
- (downcase
- (expand-file-name target)))
- (not (string=
- (file-name-nondirectory (car fn-list))
- (file-name-nondirectory target))))
- nil
- (file-directory-p target)))
- ((eq how-to t) nil)
- (t (funcall how-to target)))))
+ (into-dir
+ (progn
+ (unless dired-one-file (dired-maybe-create-dirs target))
+ (cond ((null how-to)
+ ;; Allow users to change the letter case of
+ ;; a directory on a case-insensitive
+ ;; filesystem. If we don't test these
+ ;; conditions up front, file-directory-p
+ ;; below will return t on a case-insensitive
+ ;; filesystem, and Emacs will try to move
+ ;; foo -> foo/foo, which fails.
+ (if (and (file-name-case-insensitive-p (car fn-list))
+ (eq op-symbol 'move)
+ dired-one-file
+ (string= (downcase
+ (expand-file-name (car fn-list)))
+ (downcase
+ (expand-file-name target)))
+ (not (string=
+ (file-name-nondirectory (car fn-list))
+ (file-name-nondirectory target))))
+ nil
+ (file-directory-p target)))
+ ((eq how-to t) nil)
+ (t (funcall how-to target))))))
(if (and (consp into-dir) (functionp (car into-dir)))
(apply (car into-dir) operation rfn-list fn-list target (cdr into-dir))
(if (not (or dired-one-file into-dir))
diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el
index ab6d1cb056..daf60f760e 100644
--- a/test/lisp/dired-aux-tests.el
+++ b/test/lisp/dired-aux-tests.el
@@ -93,6 +93,27 @@ with-dired-bug28834-test
(should-error (dired-copy-file-recursive from to-cp nil))
(should-error (dired-rename-file from to-mv nil)))))
+(ert-deftest dired-test-bug30624 ()
+ "test for https://debbugs.gnu.org/30624 ."
+ (cl-letf* ((target-dir (make-temp-file "target" 'dir))
+ ((symbol-function 'dired-mark-read-file-name)
+ (lambda (&rest _) target-dir))
+ (inhibit-message t))
+ ;; Delete target-dir: `dired-do-create-files' must recreate it.
+ (delete-directory target-dir)
+ (let ((file1 (make-temp-file "bug30624_file1"))
+ (file2 (make-temp-file "bug30624_file2"))
+ (dired-create-destination-dirs 'always)
+ (buf (dired temporary-file-directory)))
+ (unwind-protect
+ (progn
+ (dired-revert)
+ (dired-mark-files-regexp "bug30624_file")
+ (should (dired-do-create-files 'copy 'dired-copy-file "Copy" nil)))
+ (delete-directory target-dir 'recursive)
+ (mapc #'delete-file `(,file1 ,file2))
+ (kill-buffer buf)))))
+
(provide 'dired-aux-tests)
;; dired-aux-tests.el ends here
--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 27.0.50 (build 10, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
of 2018-04-02 built on calancha-pc
Repository revision: 7bedc8812bd7ca1d9cf36636322068b28b690a85
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30624
; Package
emacs
.
(Mon, 02 Apr 2018 06:15:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 30624 <at> debbugs.gnu.org (full text, mbox):
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Cc: 30624 <at> debbugs.gnu.org, Amos Bird <amosbird <at> gmail.com>
> Date: Mon, 02 Apr 2018 11:58:22 +0900
>
> Tino Calancha <tino.calancha <at> gmail.com> writes:
>
> > I would be enough to call `dired-maybe-create-dirs' right before
> > binding `into-dir', as follows:
>
> Added a test for this bug (dired-test-bug30624):
Thanks, Tino. Please wait a few days, and if there are no comments,
please push to master.
Reply sent
to
Tino Calancha <tino.calancha <at> gmail.com>
:
You have taken responsibility.
(Thu, 05 Apr 2018 03:23:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Amos Bird <amosbird <at> gmail.com>
:
bug acknowledged by developer.
(Thu, 05 Apr 2018 03:23:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 30624-done <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Please wait a few days, and if there are no comments,
> please push to master.
Pushed fix into master branch as commit
"Honor dired-create-destination-dirs if copying/renaming >1 files"
(0b690a83f674a160ccbaa9f374226b1fcfb2d535)
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 03 May 2018 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 6 years and 211 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.