bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58364: [PATCH] Add new function 'file-name-parent-p'


From: Eli Zaretskii
Subject: bug#58364: [PATCH] Add new function 'file-name-parent-p'
Date: Sat, 08 Oct 2022 13:10:18 +0300

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: 58364@debbugs.gnu.org
> Date: Sat, 08 Oct 2022 09:23:40 +0000
> 
> > 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.

I think a better place is in "Contents of Directories", since
locate-dominating-file is already there.  More importantly, what index
entries should we have for this function to make its discovery easier?
Something like "@cindex parent directory of file", perhaps?

For apropos, how about changing the doc string to say this instead:

  Return non-nil if DIR is a parent directory of FILE.

  Value is non-nil if FILE is inside DIR or inside a subdirectory of
  DIR.  A directory is considered to be a "parent" of itself.

  Dir must be an existing directory, otherwise the function returns
  nil.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]