From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#58364: [PATCH] Add new function 'file-name-parent-p' Date: Sat, 08 Oct 2022 10:29:23 +0000 Message-ID: <877d1aham4.fsf@posteo.net> References: <87h70f758g.fsf@posteo.net> <831qrin8jc.fsf@gnu.org> <87sfjy93xe.fsf@posteo.net> <83fsfylp57.fsf@gnu.org> <87h70ehdnn.fsf@posteo.net> <83czb2lj79.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8344"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58364@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 08 12:30:13 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 1oh75w-0001xf-Up for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 12:30:13 +0200 Original-Received: from localhost ([::1]:54180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oh75v-00009J-HE for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 06:30:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh75n-000095-Ez for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 06:30:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oh75n-00015M-5w for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 06:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oh75m-0004Ab-MA for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 06:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Oct 2022 10:30: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.166522497615968 (code B ref 58364); Sat, 08 Oct 2022 10:30:02 +0000 Original-Received: (at 58364) by debbugs.gnu.org; 8 Oct 2022 10:29:36 +0000 Original-Received: from localhost ([127.0.0.1]:38360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh75L-00049S-Rs for submit@debbugs.gnu.org; Sat, 08 Oct 2022 06:29:36 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:44277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh75J-00049B-Bq for 58364@debbugs.gnu.org; Sat, 08 Oct 2022 06:29:34 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 761FD240104 for <58364@debbugs.gnu.org>; Sat, 8 Oct 2022 12:29:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665224967; bh=lPweW/YyHTzOJZkrD2w3JTHEsKHhmXd2t1kGEVq1eQM=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=b+3zQBjEHimg9LaD/Oe16CURZUTmgt3u2REbrO+qqWubeeSthmSRRxmBmMhswMepd 7bcMzk8cffYa1wuWr+KIBOBh5sHvqIXwXjxz91j2q/IqSp4x5NOoRErIBOs0u9h0a3 Ezdz2wWGCOTKTElVDKo1zHIMTEuRGQsjmnHVqQQDMspDBFUIlX22BIwBzvE/5859FM y26OGB6Mvh8YNMYGb84MGM5g0RAevolFfrM8SUZzEMNnOrbLwIhLMvZTQD4nthujpH /C076a50i8g7V/jde3Al8bCeweA4zFIMkT9SHhznxSRP7wZ8DFWFB1ukCdbAnrT/1x wGaZkObnKa0aA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Ml1d02mvMz6tmc; Sat, 8 Oct 2022 12:29:24 +0200 (CEST) In-Reply-To: <83czb2lj79.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Oct 2022 13:10:18 +0300") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB 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:244878 Archived-At: Eli Zaretskii writes: >> 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. I agree, sounds good. > More importantly, what index > entries should we have for this function to make its discovery easier? > Something like "@cindex parent directory of file", perhaps? Drew brought up the word "ancestor", which might also be a word that people would use to find such a function. > 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 ^ shouldn't this be "DIR"? > nil. Sounds good otherwise.