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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 58364 <at> debbugs.gnu.org
Subject: bug#58364: [PATCH] Add new function 'file-name-parent-p'
Date: Sat, 08 Oct 2022 13:10:18 +0300
> From: Philip Kaludercic <philipk <at> posteo.net>
> Cc: 58364 <at> 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.




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

Previous Next


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