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 09:23:40 +0000 Message-ID: <87h70ehdnn.fsf@posteo.net> References: <87h70f758g.fsf@posteo.net> <831qrin8jc.fsf@gnu.org> <87sfjy93xe.fsf@posteo.net> <83fsfylp57.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="23442"; 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 11:24:14 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 1oh646-0005pS-Ji for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 11:24:14 +0200 Original-Received: from localhost ([::1]:60732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oh644-0004ww-1J for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 05:24:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh63v-0004wM-6X for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 05:24:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39168) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oh63u-0001fy-Tb for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 05:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oh63u-0002MW-Ec for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 05:24: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 09:24: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.16652210329064 (code B ref 58364); Sat, 08 Oct 2022 09:24:02 +0000 Original-Received: (at 58364) by debbugs.gnu.org; 8 Oct 2022 09:23:52 +0000 Original-Received: from localhost ([127.0.0.1]:38246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh63k-0002M8-8U for submit@debbugs.gnu.org; Sat, 08 Oct 2022 05:23:52 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:40667) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh63i-0002Lv-9S for 58364@debbugs.gnu.org; Sat, 08 Oct 2022 05:23:51 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6219C24010A for <58364@debbugs.gnu.org>; Sat, 8 Oct 2022 11:23:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665221024; bh=Ip0pBpE33Is0wA25FPq4028J9IyyzHhzT19OjBVxJCk=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=YTtfLtWDwJqZzlKrhdW4sN4prWPQoraG+CXVL/Wn7jSNkZk2PYOrjBOXXePy56717 lcI7KjjGDDIi3qSW27q+F9PYyjAglcFVqAcXOhIg24xFwkbsofPXb21//svDpno1km 6okNmLlJt51KcRyRbdH4d06XSs3gFO7LfiQMTpfpR5nS6o95BYQyUDXW3o4vz/t4hb Tl8vwpXhwdaNLwOan2HfvIbRKjqo4Hzfl4H87Q9NqiDxpHEPNTnJgegjfIZnwkVnQh qp+tl+4bcvQjszyt0eS9ey/hfu9GHERBtN0gcsSsJoOAqLp1zu3eHS1hREeoqGPaYV wimOPDNWcfrvw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Ml09B4Rflz6tp6; Sat, 8 Oct 2022 11:23:41 +0200 (CEST) In-Reply-To: <83fsfylp57.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Oct 2022 11:01:56 +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:244874 Archived-At: Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: 58364-done@debbugs.gnu.org >> Date: Sat, 08 Oct 2022 07:21:01 +0000 >> >> Eli Zaretskii writes: >> >> >> From: Philip Kaludercic >> >> 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.