GNU bug report logs - #58364
[PATCH] Add new function 'file-name-parent-p'

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Fri, 7 Oct 2022 20:24:01 UTC

Severity: normal

Tags: patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


Message #25 received at 58364 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58364 <at> debbugs.gnu.org
Subject: Re: bug#58364: [PATCH] Add new function 'file-name-parent-p'
Date: Sat, 08 Oct 2022 09:23:40 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Philip Kaludercic <philipk <at> posteo.net>
>> Cc: 58364-done <at> debbugs.gnu.org
>> Date: Sat, 08 Oct 2022 07:21:01 +0000
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> From: Philip Kaludercic <philipk <at> posteo.net>
>> >> Date: Fri, 07 Oct 2022 20:23:27 +0000
>> >> 
>> >> Unless I am mistaken, there is no direct function to quickly test if a
>> >> directory is a super-directory of file.  As I have encountered this
>> >> issue more than once the last few days of hacking, I would like to
>> >> propose the below function.
>> >
>> > We have file-in-directory-p.  Doesn't that fit the bill?
>> 
>> I hive tried it out and yes that was the function I was looking for.  My
>> apologies for the noise.
>
> No need to apologize: no one can know and remember everything.  I only
> remembered that because I recently fixed a bug in Dired which used
> that function.
>
> But perhaps our take from this is that file-in-directory-p is not
> discoverable enough?  Can you describe how and where you looked for
> this functionality?  Maybe if we know that, we could make some changes
> to have this function pop up in similar searches.

I used M-x apropos-command "file parent" tried to find something in
(elisp) File Names.  I now see that the function is documented under
(elisp) Truenames, which appears unintuitive to me.  My guess is that
had I seen the function name mentioned somewhere, I would have read over
it since it sounds like a function that checks for "direct entries" in a
directory.

When writing my own patch I considered adding it to the shortdocs for
"file-name", but as the function checks for actually existing file names
the examples would probably not work in a portable way.




This bug report was last modified 2 years and 222 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.