From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 22300@debbugs.gnu.org, John Wiegley <jwiegley@gmail.com>
Subject: bug#22300: 25.1.50; Dired -- renaming folders/files to CamelCase/UPPERCASE/lowercase.
Date: Tue, 05 Jan 2016 19:56:35 -0800 [thread overview]
Message-ID: <m28u43fjik.wl%esq@lawlist.com> (raw)
In-Reply-To: <m2a8oml6tk.wl%esq@lawlist.com>
Perhaps my misunderstanding stems from a belief that "/Users/HOME/Desktop/foo/FOO" is a bad thing (to have as a result) when `dired-create-files` runs `(setq to (funcall name-constructor from))`. I was looking at this as a black and white situation -- i.e., `from` is "/Users/HOME/Desktop/FOO"; and, `to` should be "/Users/HOME/Desktop/foo".
Because I do not understand the usefulness of "/Users/HOME/Desktop/foo/FOO" (when the user had explicitly entered a new name of "/Users/HOME/Desktop/foo"), I was expecting `(setq to (funcall name-constructor from))` to return "/Users/HOME/Desktop/foo" in this particular situation.
If I am understanding you correctly, you believe that "/Users/HOME/Desktop/foo/FOO" is a good thing at this point in the `elisp` code -- to be dealt with further on down when `dired-create-files` does its thing (with the assistance of some C-source code stuff under the hood).
From my layman's perspective (i.e., not a programmer by trade), I was thinking that `(setq to (funcall name-constructor from))` should yield the absolute path of what the user explicitly entered as the new name for the folder or file. I had assumed, perhaps erroneously, that things would go awry rather quickly if the value of "to" was incorrect at the outset of `dired-create-files`.
Keith
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
At Tue, 05 Jan 2016 20:28:21 +0200,
Eli Zaretskii wrote:
>
> Dired -- renaming folders/files to CamelCase/UPPERCASE/lowercase.
>
> > Date: Tue, 05 Jan 2016 09:27:03 -0800
> > From: Keith David Bershatsky <esq@lawlist.com>
> > Cc: 22300@debbugs.gnu.org,Drew Adams <drew.adams@oracle.com>,John Wiegley <jwiegley@gmail.com>
> >
> > Actually, I'm not sure why the `elisp` makes the target "/Users/HOME/Desktop/foo/FOO", instead of just "/Users/HOME/Desktop/foo".
> >
> > When I evaluate
> >
> > (funcall (lambda (from) (expand-file-name (file-name-nondirectory from) "/Users/HOME/Desktop/foo" )) "/Users/HOME/Desktop/FOO")
> >
> > I get the former incorrect value -- i.e., "/Users/HOME/Desktop/foo/FOO", instead of just "/Users/HOME/Desktop/foo".
>
> Maybe there's some misunderstanding here. Let me explain why I think
> this is the correct expected result.
>
> First, (file-name-nondirectory "/Users/HOME/Desktop/FOO") yields
> "FOO", as it should, right?
>
> Then (expand-file-name "FOO" "/Users/HOME/Desktop/foo") returns
> "/Users/HOME/Desktop/foo/FOO" because that's what it's supposed to do:
> it returns a file named "FOO" in the directory "/Users/HOME/Desktop/foo".
>
> Can you tell what in this reasoning seems incorrect, and why?
>
> > And that becomes the initial value of "to" when used by `dired-create-files` -- (setq to (funcall name-constructor from))
>
> The code that special-cases MS-Windows and MS-DOS prevents this from
> causing the unexpected results.
next prev parent reply other threads:[~2016-01-06 3:56 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-03 20:57 bug#22300: 25.1.50; Dired -- renaming folders/files to CamelCase/UPPERCASE/lowercase Keith David Bershatsky
2016-01-03 21:10 ` John Wiegley
2016-01-04 0:47 ` Drew Adams
2016-01-04 1:11 ` John Wiegley
2016-01-04 1:37 ` Drew Adams
2016-01-04 15:46 ` Eli Zaretskii
2016-01-04 16:15 ` Drew Adams
2016-01-04 19:22 ` John Wiegley
2016-01-04 19:27 ` Drew Adams
2016-01-04 19:45 ` Eli Zaretskii
2016-01-04 19:44 ` Eli Zaretskii
2016-01-04 19:48 ` John Wiegley
2016-01-04 20:31 ` Eli Zaretskii
2016-01-04 15:44 ` Eli Zaretskii
2016-01-04 3:31 ` Eli Zaretskii
2016-01-04 4:19 ` Keith David Bershatsky
2016-01-04 15:50 ` Eli Zaretskii
2016-01-04 17:41 ` Keith David Bershatsky
2016-01-04 19:12 ` Eli Zaretskii
2016-01-04 19:45 ` Keith David Bershatsky
2016-01-04 20:24 ` Eli Zaretskii
2016-01-04 20:51 ` Keith David Bershatsky
2016-01-05 16:46 ` Eli Zaretskii
2016-01-05 17:27 ` Keith David Bershatsky
2016-01-05 18:28 ` Eli Zaretskii
2016-01-06 3:56 ` Keith David Bershatsky [this message]
2016-01-06 15:40 ` Eli Zaretskii
2016-01-06 19:57 ` Keith David Bershatsky
[not found] <<m2a8oml6tk.wl%esq@lawlist.com>
[not found] ` <<m24meutlmk.fsf@newartisans.com>
[not found] ` <<a936bee4-3375-45cf-ab35-62e36a21f003@default>
[not found] ` <<83vb7973iy.fsf@gnu.org>
2016-01-04 16:14 ` Drew Adams
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=m28u43fjik.wl%esq@lawlist.com \
--to=esq@lawlist.com \
--cc=22300@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=jwiegley@gmail.com \
/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).