From: Arthur Miller <arthur.miller@live.com>
To: Boruch Baum <boruch_baum@gmx.com>
Cc: 43961@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>,
Richard Stallman <rms@gnu.org>
Subject: bug#43961: read carefully: dired-file-name-at-point vs dired-filename-at-point
Date: Tue, 13 Oct 2020 12:58:10 +0200 [thread overview]
Message-ID: <VI1PR06MB4526D1E530C2B707E34131C496040@VI1PR06MB4526.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <20201013102511.5nuu3p3dcyr6poft@E15-2016.optimum.net> (Boruch Baum's message of "Tue, 13 Oct 2020 06:25:12 -0400")
Boruch Baum <boruch_baum@gmx.com> writes:
> On 2020-10-13 06:54, Lars Ingebrigtsen wrote:
>> Boruch Baum <boruch_baum@gmx.com> writes:
>>
>> > They return different values. One returns an expanded (canonical)
>> > path-name, and the other an abbreviated one.
>>
>> Why not just have one call the other, and wrap the results in
>> abbreviate-file-name?
>
> You could, but you wouldn't be saving anything since the inner function
> would still need to perform the expansion, so for the abbreviated
> function you end up in effect with an inefficient (abbrev (expand file))
> instead of a choice between (abbrev file) or (expand file).
>
> Also, much of the change ends up being defaliases, docstrings and
> deprecation notices, so its more clearly presented without nesting
> functions.
>
> --
> hkp://keys.gnupg.net
> CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0
Boruch you are mind reader! At least I thought so when I saw your mail
yesterday.
I was playing with Dired myself on Monday and I actually wrote a mail
about those two functions + file-name-directory and directory-file-name,
I just never send it.
dired-filename-at-point is supposed to return a filename closest to the
point, according to docs. For me it didn't work at all.
But I mostly disliked the name. Why are there two almost identical name
for different functionality? I like self-documented names for variables
but if there are names like directory-file-name and file-name-directory
or something like dired-file-name-at-point and dired-filename-at-point;
then I have to remember and actively think about which one was that I
want? Usually ends up with unnecessary look-up into docs, because I
don't remember which one was that I want. Not that I hate so much to
think :-), but it does interrupt the flow of thoughts.
I understand that logic was 'objectoworkon-followed-by-operation' but I
still find it unnecessary convoluted. It is just so much more
straightforward if each function has unique descriptive name, and yes I
am aware that such names are sometimes hard to get by.
I have seen also discussion about string-replace and replace-string, can
we plase not? For the reason above. And for the new APIs added, please
don't use naming patterns like word1-word2 and word2-word1 or similar
where same words are used just with some slight variation.
next prev parent reply other threads:[~2020-10-13 10:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-12 14:26 bug#43961: read carefully: dired-file-name-at-point vs dired-filename-at-point Boruch Baum
2020-10-13 3:49 ` Richard Stallman
2020-10-13 4:08 ` Boruch Baum
2020-10-13 4:54 ` Lars Ingebrigtsen
2020-10-13 10:25 ` Boruch Baum
2020-10-13 10:58 ` Arthur Miller [this message]
2020-10-13 11:27 ` Boruch Baum
2020-10-14 3:45 ` Lars Ingebrigtsen
2020-10-14 4:19 ` Boruch Baum
2020-10-14 4:43 ` Richard Stallman
2020-10-14 4:58 ` Lars Ingebrigtsen
2020-10-15 3:57 ` Richard Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=VI1PR06MB4526D1E530C2B707E34131C496040@VI1PR06MB4526.eurprd06.prod.outlook.com \
--to=arthur.miller@live.com \
--cc=43961@debbugs.gnu.org \
--cc=boruch_baum@gmx.com \
--cc=larsi@gnus.org \
--cc=rms@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.