From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#58364: [PATCH] Add new function 'file-name-parent-p' Date: Sat, 8 Oct 2022 17:20:57 +0000 Message-ID: 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; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6330"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "58364@debbugs.gnu.org" <58364@debbugs.gnu.org> To: Eli Zaretskii , Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 08 19:22:38 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 1ohDX3-0001QP-BO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 19:22:37 +0200 Original-Received: from localhost ([::1]:50462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohDX1-0007HM-SK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 13:22:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohDWU-0007GH-NC for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 13:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohDWU-0004ML-Ez for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 13:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ohDWU-0003Ku-71 for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 13:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Oct 2022 17:22: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.166524967012763 (code B ref 58364); Sat, 08 Oct 2022 17:22:02 +0000 Original-Received: (at 58364) by debbugs.gnu.org; 8 Oct 2022 17:21:10 +0000 Original-Received: from localhost ([127.0.0.1]:41380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohDVd-0003Jn-TG for submit@debbugs.gnu.org; Sat, 08 Oct 2022 13:21:10 -0400 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:19894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohDVX-0003Jb-Sn for 58364@debbugs.gnu.org; Sat, 08 Oct 2022 13:21:07 -0400 Original-Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 298G0HIN019044; Sat, 8 Oct 2022 17:21:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=gmD3IR82cMtVvVsylBxEC8DtrLtXL9u02QPuzyp9wOc=; b=dVlXL9bvQCIYEd1QlBQNQrVqVZwB5nrpNUXHF8EZ6pKG5C0NuNBCdVK/L+qjSvVeSnC5 pcnZ8R1g2B0CVLTdE44kHsTyByYwB072Llk1irmWRxR9Zy8oFeN4g664yJQynnGrwhra 2Z6npko7OgsT32gjTNd/zofjReqBgx0NSvQT90JfI1/6AxUuaXHei0lDsAk/Nk/dmRd8 gwqJ7Jqq0nEygJmyMuRrJUHFyG4SDmBrU+3VHOph9A3xvQ9IeswxFN/OXEggeBOidkw/ 0aGWGoOF6BBZNdXkou3s/GeTdteOM+nKmRv3yAUwFKCzIVMSHLeV5BYa1hPEKob3Hwum Ww== Original-Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k2yt18uss-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 08 Oct 2022 17:21:02 +0000 Original-Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 298HJdbB029343; Sat, 8 Oct 2022 17:21:00 GMT Original-Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2177.outbound.protection.outlook.com [104.47.73.177]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k2yn8b64y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 08 Oct 2022 17:21:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jNozwTK4ltmgz1/tVm1mtIQ22K9PKVPkeyHY8cenTJDF+mZcbsK1YMQs4YCoV35apKITVMxTV96nPXAALqLjEs1ooWYVHf0nrd9NuXXmj0gl0p7UsTxcK5/i3SrDttssRanYX+SzliM758Iw6CE3iZMoHPgVn5rUga2FSR0l197/jZT+Bs/yFBQRSe9cj7MKONhBWHlhxn3/HpbDfMT+hqvY1TVB7R+LRNC8K6vkAFeRop4CJLWjjdxitG2YL36wvUJCxr5E/pycUc2rZHkkX85rm0j2Yf4mBvhcrh/bWw/il/wDQO2KNEgp7EG+72U3odAiXyFKFI0thnsp+qp2kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gmD3IR82cMtVvVsylBxEC8DtrLtXL9u02QPuzyp9wOc=; b=dmXgqu32KxCkWNMuV2qafH3jIl3cOjjcIeD+eeE9I8Hfu5SH2yAPWVfzloL9FB0YAYhww+aARe36PRm7Cima1o2orW7W0yD6G+vNL7AffQgD7uqCyKlVrgENXE/uqcWynQNBD0q/fuPh0JAMP5X2LdaeGERBqOSoVUqDMXaRNYIT27zU6maEahJb1ZTbHmg7TUm/1Sza114LI/sAfyXx2HiqyK7H8ixDfda0B6h4zsz5Rbv8pbLt4BVchxxwmGyVaeIdMoZSqw+7H/RLu6OXR7dAA7w5w67b+g4c343Xn6o06GUyMmibeElrVp5sh4vrMaspIiOm3AsBfK4evTEMGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gmD3IR82cMtVvVsylBxEC8DtrLtXL9u02QPuzyp9wOc=; b=THkvmQvUqPiIqQ/RAp6+jhw86QhUVFOWVC8tmWBpLKngc0U5ov9L9SNvxlPYmepgrSiO72gf5oIrYSS+epwaqQwYifVCEgRSywstwiRpz+mbgo6GaoC0WWU26H2mzXyJac9rQ8PV7ivprR9VNMi37iTmwSULxJk18/j/jXEBolY= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BN0PR10MB4918.namprd10.prod.outlook.com (2603:10b6:408:12e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Sat, 8 Oct 2022 17:20:58 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::f319:dced:1a48:779a]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::f319:dced:1a48:779a%3]) with mapi id 15.20.5709.015; Sat, 8 Oct 2022 17:20:58 +0000 Thread-Topic: [External] : bug#58364: [PATCH] Add new function 'file-name-parent-p' Thread-Index: AQHY2v5KVQBKhCinrEu6zOcUHXJmq64EsQhw In-Reply-To: <83czb2lj79.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|BN0PR10MB4918:EE_ x-ms-office365-filtering-correlation-id: 0792232e-b563-480f-dd0a-08daa95176ff x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yzbsbHaV9T1o241fu8/tVQ16ctYFK5gsJTYUVzozVgMPzQ1Nl6d7Crh2JSPipaqHJFBJ+3/z1KUv2jUaym0AEJzUcSZzSZzCTHVN7bqvXFe7OsJ4DqByElHqkYu5XWeWt2+2QIZs1JfgaYkjPjmTxrHKrBr6ttGts9AytGUhor6KpsQyGtdCHGe/TyyQ7KAblW9glUaKt9BtdOgq1VMeIm8cmeXRgjX/Im3GF6q0zKAHQcVthrxqi4P5tXfidAJZyvSSRuC0z5gyTS48DuMNR1/HBsN9X8rwc4mR21A3/4f6HpI4ejlIAXuGLV61iSv++XgrAs5B5nQCIJYLocV1KDYw58qQnDreYv8kW8WzhGjmp3Ryt7Qg5N6UCH/IYrpB4yW+FwzORFzJbh1YJusHshEvdFLKJdcxWWPHzjFGK85f3q3s3IERU4rzQLRY48NaRBfoRM/rPFbhxJ6tJzWItHmPwCPSFmT30rQi6M5tAWtC+XleoWOdxG650bX0MiJAmOq/7PxBIJONxRDN+Foqzcfx4W3FAePhb9QwQgElFkqDxMae6778qtmyVar9xruV7FE34J1mmElfCmcmJKomqejoArPk6Wxw0wgknX7dSZnKi2kFhM0oAmoJyRGF8kStMHaLmPvXJnPv5Q4HTuHQ5MZHui8nHXjWs4iRVdRJ4rDxpXkD5qjU0lmq3NGmCU31f4BK4W+4jgUG4pUDUxKDLbjFncBUNLpJWD8a2T3ub+dSgtHJT+qyKWcSgOG+q fFQz8oTWiSwQCkIigcv6XIV4pX5i03PuFGyUEVRjQHRFY+6hVgeabzWfvL//Brqc5NLToVi6tIuizd9p8euR+B27A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(346002)(376002)(39860400002)(396003)(366004)(451199015)(4326008)(41300700001)(186003)(38070700005)(66946007)(66556008)(66476007)(66446008)(64756008)(8676002)(76116006)(86362001)(2906002)(52536014)(8936002)(33656002)(44832011)(5660300002)(6506007)(7696005)(478600001)(38100700002)(966005)(122000001)(71200400001)(55016003)(110136005)(316002)(26005)(9686003)(66899015); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: t0sTkJG47Qg13zYlYoRmHQaG4FpjMp2JdBJhBkW/usLVNSMpXzoh563cWd4TCzuvrSZnS+vQBhNeRqPt1G9HGZz+rUeNe8r3Aosl7vg1mjy8Kmk30HbFU99uAWw3w3O1I40+WxeCQrBCCARZyscVI/B6cvNVzMgH7FVOR8FYEz5BXAqj39cKsgZX1R7XIu2I1ho+ga8NE3y3Pceo5zieynwkDi4+4zDvnUm7lhcIkMydfvKkWqX5HLlT/97BWV+m07UKo7o1X5NWLfohXqNnRFG7aXtvYzQvYlN3e86RlN7V9gZP2CpVMFWcaI+4gn1p33frtXFuRRE/T56oNU1JmQg0lT9ldtPumW2LiXOapQvoPc3HKW6NR3MVF8+wwnMTibnFG4pd+0HK6t+GpEIMUyriKaPYQKt6dawGu0C+SyFlNzxi4pZLPhh4YX9nYLWTNsj1oIIBdStk0s2yJEHBd/qIlb/mUBbR6waRHb7uT9ns4uXpMGWhYdWU0t8U6XNsbMGqhjPgHc8ynwF12IEBNqJvI0hHDr4KYiZMXEJo6hI4CJq95zgSMIt82Q2GSeeQF2OmV3lm/saJNeDwcSc9JjrEtsgDUQD+Bft5tM0SZMJaX7l82G4pA2ToqehHyFAOj6zd2+MnmldwcgPuWe2oQbS7u8eqkWOI0OkvFmg9zi2TqoBFvsM6JWHkUDAzSpUbwU5qa4uTYtQ2wbQarEU5BBhxn71KD8SPv/zf9oujIAIbTraVamtx8ofoEQ 58BzxgF0eY0B9ZWP3KfiWbYJUfJ2/SWN/ZKHpwKXDmT2fE3p4HuNKdcj9agH+DiHQVdlSOMyoUtmYFtgIShuyMHda4RDZh+3gP X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0792232e-b563-480f-dd0a-08daa95176ff X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2022 17:20:57.9958 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: l3xj0wen3P8/llYM568G96TJ9uMURI/F2NZP+1NEC7OrJLOvNoJDZzb3QREtovBz0barDS8vdHbINazY61Q7bg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB4918 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-07_04,2022-10-07_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210080112 X-Proofpoint-GUID: mjeAGwdDLnxxxylUSA0lwF9pB-DocIE6 X-Proofpoint-ORIG-GUID: mjeAGwdDLnxxxylUSA0lwF9pB-DocIE6 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:244925 Archived-At: > For apropos, how about changing the doc string to say this instead: >=20 > 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. This is what's wrong with talking loosely about a file being "inside" a directory - confusion. The function is called `file-in-directory-p', where you expect "in" to mean _either_ "inside" DIR _or_ "inside" a subdir of DIR. And does "subdir" here mean a child of DIR or a descendent of DIR? Right away, this introduces confusion. What does it mean to be "inside" DIR - does it mean be directly in DIR? Or does it mean be directly in either DIR or a directory that's a descendent of DIR? If you mean the latter then it makes no sense to add "or inside a subdirectory of DIR", since anything "in" any "subdir" of DIR is in that case also "in" DIR. And then there's the first doc-string line: ...DIR is a parent directory of FILE. This is wrong. The predicate apparently tests whether DIR is an _ancestor_ directory; it doesn't test whether it's a _parent_ directory. In some languages "parent" can mean "ancestor" or even "relative". But not in English. And this leaves aside the problem of whether you really want to say that a _directory_ is a parent of a _file_. A dir _contains_ files. Do you want to also say that a dir is a parent or ancestor of a file? (And this has nothing to do with the fact that a directory itself is also a file.) The predicate is about an ancestor-descendent relation, not a parent-child relation. And it's really about such a relation between the directory that FILE is contained in directly and DIR - that is, it's more precise not to speak of a directory being a parent or an ancestor of a file. (But if you want to skip over that distinction, that could be OK.) The predicate name is maybe less important than getting the doc to be correct. But there's really no reason they can't both be=20 accurate. And if Emacs starts using accurate terminology here then search, completion, apropos etc. will be more helpful. And the manual's Index can still offer (also) entries that are less than accurate, as some users may well think of a term like "parent" before they think of "ancestor". That possibility isn't a reason not to use more accurate terms in the doc (in particular), or even in the function name. https://en.wikipedia.org/wiki/Ancestor https://stackoverflow.com/a/10993384/729907 https://stackoverflow.com/questions/55607027/git-what-is-the-logical-differ= ence-between-parent-and-ancestor https://stackoverflow.com/a/54889445/729907 https://sebastian.expert/ancestor-descendant-sibling-parent-child-explained= / https://teamtreehouse.com/community/what-is-the-difference-between-an-ances= tor-and-parent-how-do-ancestors-parents-and-child-elements-relate https://www.wwp.northeastern.edu/outreach/seminars/_current/presentations/x= slt_intro/xpath_intro_tutorial_08.xhtml https://wp-qa.com/what-is-the-difference-between-current_page_parent-and-cu= rrent_page_ancestor https://wikidiff.com/ancestor/parent