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#56754: 28.1; Please move general stuff from `ffap.el' to `files.el' Date: Tue, 26 Jul 2022 15:00:00 +0000 Message-ID: References: <87y1wg11jz.fsf@gnus.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="30532"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "56754@debbugs.gnu.org" <56754@debbugs.gnu.org> To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 26 17:01:26 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 1oGM3p-0007h5-R8 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Jul 2022 17:01:26 +0200 Original-Received: from localhost ([::1]:42642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGM3o-0000oa-Il for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Jul 2022 11:01:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGM3S-0000lS-Mt for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2022 11:01:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36146) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGM3S-0002NA-8w for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2022 11:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oGM3S-0004YW-1t for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2022 11:01: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: Tue, 26 Jul 2022 15:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56754 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 56754-submit@debbugs.gnu.org id=B56754.165884761517399 (code B ref 56754); Tue, 26 Jul 2022 15:01:02 +0000 Original-Received: (at 56754) by debbugs.gnu.org; 26 Jul 2022 15:00:15 +0000 Original-Received: from localhost ([127.0.0.1]:54122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGM2g-0004WY-H9 for submit@debbugs.gnu.org; Tue, 26 Jul 2022 11:00:14 -0400 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:29568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGM2c-0004WJ-Nw for 56754@debbugs.gnu.org; Tue, 26 Jul 2022 11:00:13 -0400 Original-Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26QEE3Cp021339; Tue, 26 Jul 2022 15:00:08 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=Hbr3kcPy0cw/4wLC2i5bj2syup3WXX7vz/jWxbjHacg=; b=wb65UuoL2ZaHkvx99q2jCH5aiiRa6Q53vJi8zcu0rI24kumUJait7oescKbAOzxPxe3r nMuRHgp6IHU2XX80JnxiN6vJR/L1wDeAoKKlh/9GmTFKXwbqFR0usIXC5OAcmBM18mG6 I16GdjEQy3W6kdHRe/Z9bQu8CjYH50hGh0KU4ljUFH3HzLGMekmtmjDL5neAn0pnEo47 GUotDenx0QMl+/nasOn6m3jND0lG+psi7ofqAvMpwYOYs4Xs29TJbLebmjL+Enpa7AAL w0zFMEEDEShRD7zHJ1WZzCVh8QGYhlZSqa6xzhWZ9V+95DzIuObhGyGYN7ZWoVyPrOYU YQ== Original-Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hg940pmh0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Jul 2022 15:00:07 +0000 Original-Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 26QEiVQs023014; Tue, 26 Jul 2022 15:00:05 GMT Original-Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hh5yuvq1t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Jul 2022 15:00:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TG+DqDAWFV4kQ9bY0mfJKvRRlVC2dPCSofz+0GYWsYh6v10O1MvjdGmSpp6WofY6GHRp/rV3eOGyTJxEH6uzt1mWfBBPxrCBxX5p+HYKhdh1IASJCMxjODu4AQ6vzDRslsvvnPIots6bbF7jcgODVV8va/rfIjS+Vqj7kFGk71/+zFUlYNX9mkiRnWuNvdAdtMP2LAAfmPEHDXdpN7ttkFZoGPOxW1+od+c8gp/pZn8hL5i9CChl98dFNeJK0sjECh0fuBU1GUjnXQgPY/n5jhdXXNl6A9C4QULCAU9K17zgUhTiNWQg70qfwuzxxC+SDrU2y0NMoyn6KYmslLhhFg== 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=Hbr3kcPy0cw/4wLC2i5bj2syup3WXX7vz/jWxbjHacg=; b=WP/T6k3iQmo6nLpXAA3slQHPSseTqexcp/WQrmm5t3AW3XETUIH0+R5j4RqdMKYcUTX6laJKrGr0D9dwOe6Wq25bBUQfQLc4RZP5Z/7n3/PAUhBigR7heegcngWm2pkur48w3MQ6oNmjbxTKXxFthJQ6Ctk+fCMv2OqZCGBGpRT5fV6bSyeD6lFm1U9EPflulot9DF60HE0NQNcB7zxjx8dLD/yUFB2fJbwUQjgHJ9/sD3X+9XXqbP0KJjZS5KzuUAH4njKBl2+opmeRoAu50VkhSsti4DPhJbWqNWUJUcpDeHG34sqQicEWw8tt5TR8cPLeUDNWvjAnjxtbviWtMA== 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=Hbr3kcPy0cw/4wLC2i5bj2syup3WXX7vz/jWxbjHacg=; b=Q+ls+Sjp/y8u0EEXbOWMHRc4NITzCxCrHOECwIA9EtSefElpP0tUhNqLM9yTHp8EcSFAleZ8PmgnDe4kxfUXt6t3Udj04PaZy3WTbb1hjQwvEj/LFQNqyGco2rneGrvOUfa8Vxy9Ltf03O66OXKJvKtmdZ/iutcdXkPpqKFz7kk= Original-Received: from CO6PR10MB5473.namprd10.prod.outlook.com (2603:10b6:5:355::21) by BN6PR10MB1810.namprd10.prod.outlook.com (2603:10b6:404:108::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Tue, 26 Jul 2022 15:00:01 +0000 Original-Received: from CO6PR10MB5473.namprd10.prod.outlook.com ([fe80::e4fd:b150:d0b8:80b8]) by CO6PR10MB5473.namprd10.prod.outlook.com ([fe80::e4fd:b150:d0b8:80b8%3]) with mapi id 15.20.5458.025; Tue, 26 Jul 2022 15:00:00 +0000 Thread-Topic: [External] : Re: bug#56754: 28.1; Please move general stuff from `ffap.el' to `files.el' Thread-Index: AdiftsBr0niNzbowSmixwMeCjbAPsABN3DXsAAJVv6A= In-Reply-To: <87y1wg11jz.fsf@gnus.org> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9b0afecf-3447-4510-b413-08da6f178391 x-ms-traffictypediagnostic: BN6PR10MB1810:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KLmEblxLcaO8PUYkSZEy764eMAohFNOSqxVJleA4BJ94J+TFP6vnNhpHZJ7rFsBvt8ViKk/jGKJpYL9LeIIeyNF15hrdIK58uHsSutz4zZQ4f9MaFLrAPgm7PKSnA3RJPZnN4lA9OA3fPvhdrMuhs/5kI6y4mermxq0pWQA3Mk6649KeeRrllfj8/JBLcLUCvqxTfUhoRoVFAMusBe9SUClsHpqjEJ7ZMnoqLINK0OEhHaHMaoHwHn07yRmGZf+U7HMtFhgimriEHD0vntpJIAjyFQkx2rMyWWnU41S279ls+LxLy7YcQxxGqTPP0zxRwv+vNMYIynEJ6VNanmhPOatQotgzHPl22D3E48sqeArNha9UgUt00SeH1KniUGMChkJoceIG+siGYkLYylGHSPWST0oaZrhmf1eBqK1KD251DYZbt4DEX1kytiCbb/++4Zr+ZaJhOJDGpsp8IxHcyv5MBgZqe+Q7MJPpNbIQdbFbjxzlH7kdH1JLOn6Zze4vS5b9Q/OssC7b2UaqjLWHpsD250GjgTowrV6x26qSdbUMXBuupowJfmK9CVTFq++iou/LjuzUWNhqwyfXvag7UbJ3c0551RfYbmucDR2MnlQ8xMJO54VdUSr6orhT3T1pJTlzH6pVVUcZ19yQwxJ3lJJHoy8eRVAPIO9P9oZTXMObSTxCcRjfJLmgkAv7KdGwU6/6T1abIpcO/s6+7WnpzRqlVb575GtIt3xzCvDgSuXu97EMsDNfmcDUX8LjE 0PVXIADLweb+IfUkBP0YDnjyOOEJlhNr9zutmp7/GjihzpzMYSGomsBMkJrC68WTx1s/ObCPWSekcPDmxOlQoLBnw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR10MB5473.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(346002)(396003)(376002)(366004)(39860400002)(136003)(4326008)(8676002)(7696005)(6506007)(64756008)(66556008)(66476007)(66946007)(66446008)(2906002)(71200400001)(5660300002)(76116006)(41300700001)(33656002)(86362001)(8936002)(9686003)(478600001)(26005)(44832011)(55016003)(52536014)(38070700005)(83380400001)(316002)(122000001)(6916009)(186003)(38100700002)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: +IEV/HKlcTqUypZigh+xv+SBk2sEbCAyhVDX6hGMgzVqvtsdeE8UDilBigDjKwz3KlWZ3Sbqxzt03PghUL9wk9vTyLkXJ61fii54BB1WzTlNBfCyalAtwsa039SGEDisdVJviKqizg4nrKLOhj4nCLSB0aviCMF6KDfeWgCIinUizZVS5vIAgxVbODqWHyhxbCJ1Ah+bVUR1tFqMnw6oyk6PGQIyNb13VitIYoHtJdSTbPj8JwMVbi+Xmlc2mni+yUofsIh6kLaEaNtfgxOb89fx1XIgjB864rHurw4z3s+kfExqrOx6jSwp8I6TvC2Es5PZT/qrCMf/0ai6qVEMVo/3FNFkw4Vwu8/aTC45aJ6dWAhYEF1u5k/RJWVnrcxWGkonx42cNO0lIQ7aOOiSi49CCgYdnt9MCSfhrQWIMIrot1ErOmvw1GxXlFl3KIiY/BvSbkMnkForDY7Yd5VuyAIx1vd8vCqz+ETd6XgLpn0p46qGWlKWTaEychred3qG8Pre/DgrC8daEzdwPI+JGU6keGzlE0+TmJgtY8TubgXNOUucS3XODoj3nIMriRap9WmHnlnB+bjUyk+p7GMz4gnHCNDZktJZSCur8p9+TkatU6fCH5mjG1L5M2pAem4pNywUXijT7Lljaunut13/IadhdNTCfQEYCMuA40G9t9BouOoEg9aj8cR4T9+RDYndShlSfuktcBJrUjk4hvkQMfUi8vJ494KB/+eeKXDJTfZndeihXxRDcv0Jnn 18S5K4LxmkJYCrH2YobyQHbbcT77cGVKkVzWEjxlzKsZ8fgeHKHkDA4cXGLcqe1lRMFainaCwgHGb4NzqTz51sO0MM2dFA37my X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5473.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b0afecf-3447-4510-b413-08da6f178391 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jul 2022 15:00:00.8485 (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: JKDatHWwVy460VyrfMXgxi5yDSSmQn8w+iTWE3dONRlVztoAcAs2MirsRkNZFNau0cEEm4lE/F60yae+JzLygQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1810 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-26_04,2022-07-26_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=343 mlxscore=0 suspectscore=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207260057 X-Proofpoint-GUID: ThcnGAOQriGmt3Oe4EWxLraDKY3SYJ2- X-Proofpoint-ORIG-GUID: ThcnGAOQriGmt3Oe4EWxLraDKY3SYJ2- 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:237976 Archived-At: > > One example of such a function: `ffap-all-subdirs' (and its internal > > helper function `ffap-all-subdirs-loop'). >=20 > I don't think ffap-all-subdirs is generally useful: Did you understand that the request is not about `ffap-all-subdirs'? If not, please read it again. [ And see the comment in ffap.el under "File Name Handling": "Too many features here." That's essentially a "TODO". And the example is set there by commenting out the general functions `ffap-last' and `ffap-splice'. And see the comment with `ffap-locate-file', which cries out for `locate-library' to accept an optional arg to override suffixes. ] > --- > Directories beginning with \".\" are ignored, and directory > symlinks are listed but never searched (to avoid loops). > --- Ignoring symlinks by default is what you generally want from a function that gives you a list of directories under/within the current one. If you're really interested in a more general function that lets you get or not get symlinks, then define it. The point is that such a general function doesn't belong in `ffap.el'. `ffap.el' could just make use of it (ditto, `dired.el' or any other library). Here's one such general function from Dired+, for instance: diredp-directories-within is a Lisp function in 'dired+.el'. (diredp-directories-within &optional DIRECTORY NO-SYMLINKS-P PREDICATE) List of accessible directories within DIRECTORY. Directories in `vc-directory-exclusion-list' are skipped. Optional arg DIRECTORY defaults to the value of `default-directory'. Non-nil optional arg NO-SYMLINKS-P means do not follow symbolic links. Non-nil optional arg PREDICATE must be a function that accepts a file-name argument. Only directories that satisfy PREDICATE are included in the result. And yes, that's similarly more general than Dired. Such a function really belongs in `files.el', not in `ffap.el' or `dired.el'. > It's well-suited for what ffap does, though,=20 > which is why it lives in that file. Nah. It lives in `ffap.el' for hysterical raisins. What about other `ffap.el' functions (and vars) that, like `ffap-all-subdirs', aren't particularly related to ffap? E.g.: ffap-list-env ffap-reduce-path ffap-locate-file ffap-symbol-value ffap-file-suffix ffap-file-exists-string ffap-file-remote-p ffap-machine-p ffap-machine-at-point ffap-host-to-filename ffap-fixup-machine ffap-url-p ffap-url-unwrap-local ffap-url-unwrap-remote ffap-fixup-url ffap-read-file-or-url There's a bunch of stuff in `ffap.el' that isn't specifically related to picking up a file/url/* name at point. It's there because such picking-up needs it - because _it isn't defined elsewhere_, in a more general, always-loaded library. That it's used in `ffap.el' doesn't mean its definition belongs there. And why do some of the `ffap.el' commands that open Dired have names with prefix `ffap-dired-', but others have only prefix `dired-'? Hysterical raisins? =20 > Closing. Too bad. `ffap.el' needs cleanup. Other files could take advantage of its too-general stuff. File-general functions belong in a library such as `files.el'.