From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58364: [PATCH] Add new function 'file-name-parent-p' Date: Sat, 08 Oct 2022 13:10:18 +0300 Message-ID: <83czb2lj79.fsf@gnu.org> References: <87h70f758g.fsf@posteo.net> <831qrin8jc.fsf@gnu.org> <87sfjy93xe.fsf@posteo.net> <83fsfylp57.fsf@gnu.org> <87h70ehdnn.fsf@posteo.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1036"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58364@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 08 12:11:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oh6nX-000AdP-6m for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 12:11:11 +0200 Original-Received: from localhost ([::1]:36200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oh6nV-00035o-O4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 06:11:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh6nP-00035f-AG for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 06:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39272) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oh6nO-0005GW-My for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 06:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oh6nO-0003Zs-FX for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 06:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Oct 2022 10:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58364 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58364-submit@debbugs.gnu.org id=B58364.166522382413697 (code B ref 58364); Sat, 08 Oct 2022 10:11:02 +0000 Original-Received: (at 58364) by debbugs.gnu.org; 8 Oct 2022 10:10:24 +0000 Original-Received: from localhost ([127.0.0.1]:38350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh6mm-0003Yr-0T for submit@debbugs.gnu.org; Sat, 08 Oct 2022 06:10:24 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh6ml-0003YY-7d for 58364@debbugs.gnu.org; Sat, 08 Oct 2022 06:10:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh6mf-0005Bt-Vp; Sat, 08 Oct 2022 06:10:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=kJKDCJKqhEnn6Co7iEi1TMn70tJWSnJudG8XsyR4Sgk=; b=SafikzuMgU3X aJUqI9L4FsZKzW/3WvTFRJVwQbV1s4+R/nbCSmrPNFheje0yhEjBe995rD6i+YP9lyRYtkatdNlrA FAGgnikXlT/xb/rx1hPhKa67TGCworiDkMO33un6Fz9KAixL1UOLYlXpig/TLZb0fjYvYF3/K9hvw vL8UAI9D04o2b477SrpWSg/YTkqPWtJZo8ct1Xzs/bsCwDX/DPddssRLnnIj+xmuuP9HFdWSjjBsF ydoW8em6cJZ9qqmgB6zaRH+oPaVpngqo3te65Vt4JMyKX80Rd0U/+QaxGaDOeD2FHV02piFM+qpay 5RsXlY4Z3BbyuR280DVVPg==; Original-Received: from [87.69.77.57] (port=2061 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh6mf-0002Fv-EH; Sat, 08 Oct 2022 06:10:17 -0400 In-Reply-To: <87h70ehdnn.fsf@posteo.net> (message from Philip Kaludercic on Sat, 08 Oct 2022 09:23:40 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244877 Archived-At: > From: Philip Kaludercic > 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.