From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70593: 30.0.50; Dired: buffers of renamed dirs are broken Date: Fri, 10 May 2024 16:51:50 +0000 Message-ID: References: <87a5lguygb.fsf@web.de> <861q6syxzb.fsf@gnu.org> <87plu8xmb9.fsf@web.de> <87msozqes5.fsf@web.de> <87ikzmg50t.fsf@web.de> <87msoxddw7.fsf@web.de> Reply-To: Drew Adams 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="8746"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70593@debbugs.gnu.org, eliz@gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 10 18:52:22 2024 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 1s5TTp-00023o-FR for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 May 2024 18:52:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5TTc-0004rv-Pm; Fri, 10 May 2024 12:52:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5TTa-0004rX-56 for bug-gnu-emacs@gnu.org; Fri, 10 May 2024 12:52:06 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5TTY-00049o-Li for bug-gnu-emacs@gnu.org; Fri, 10 May 2024 12:52:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s5TTW-0004Mx-EH for bug-gnu-emacs@gnu.org; Fri, 10 May 2024 12:52: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: Fri, 10 May 2024 16:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70593 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: "70593@debbugs.gnu.org" <70593@debbugs.gnu.org>, "Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors" , Eli Zaretskii Original-Received: via spool by 70593-submit@debbugs.gnu.org id=B70593.171535991816788 (code B ref 70593); Fri, 10 May 2024 16:52:02 +0000 Original-Received: (at 70593) by debbugs.gnu.org; 10 May 2024 16:51:58 +0000 Original-Received: from localhost ([127.0.0.1]:42998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5TTR-0004Mh-Kv for submit@debbugs.gnu.org; Fri, 10 May 2024 12:51:58 -0400 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:28222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5TTO-0004Mb-Hi for 70593@debbugs.gnu.org; Fri, 10 May 2024 12:51:55 -0400 Original-Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44AGj5H6000893; Fri, 10 May 2024 16:51:54 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-2023-11-20; bh=qTe4x0aP1RpaXQJ1HZaqfxSAV4NTiJf162oKWsKpXkw=; b=DKxD20ZTR/LAu2rDgGnkUSoQ50GU6FBEmjDTiVsSMUOnRZu3ZwwcC5Kvp9yoPzCbl/pW D+LQh7QpnVYncn1hHEA6QIdD1B/lyIqiN1oz7ibwtjAgdIvavH/sNa946A3gNe+1X4s8 VIAnbwgCtecO8o6DGfsch3zhWQF5VU2Y8hH2D4JPC+Zi/4e5TZ3pQvSeIJbVq9L3Ul8R +03i3/5HcSQZwrEpcUVH4NsvZZjaCBK4OQKstb4wXeA+XhUXxVldB9Dwp0Ev3PxcrPUQ iphB6lK+Pa9oSGkBDGm9EdgoYJeywlekSwzJTrlI4lth53z2B+nhpYs6FeKKK8Uj7lEi dQ== 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 3y1pgw04mn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 May 2024 16:51:54 +0000 Original-Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44AGBkr7021427; Fri, 10 May 2024 16:51:53 GMT Original-Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3xysfsc7ga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 May 2024 16:51:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DA5JT+QXWzvcWaZ+iXR8ue1otuRivtj1BS7TyK1JDzZdUzpcjCH4jgGxV+D0zsmEqbum5bqqlJqSFqz5YuO4jHFTVMzjrSOuSSBgrFI0YxmIVbZhJ4NGXwJs76G7OqXbj7/nzoZWxVgNSJCBeUffukvgRTIP73gIsPzFz2NXR8GtOlNDQKso/E7c3kWeUGQ/BLZqt5+12DTPOCqJJy5fugBS4gJ2iJ+Y4tqZpwNgwG560iPoIZtYRtcrRYbzg9ZWT9hADTt08z+vHGoRL9Xi1S032cqvmAiEcZeTe0N8NPKX+Al3Gxw5FLPNJKC3d3gICEv0V5LzXRofWoEnjgeb8A== 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=qTe4x0aP1RpaXQJ1HZaqfxSAV4NTiJf162oKWsKpXkw=; b=OTMEkfWRQmkf+OTCeGRBFl9kwaRIFPwnpby+WMufFj/gwozKNvN2g/u8n+TaFnCLI0ojuvbzTnIStwCWYbBwtE2yxbnNPN7qYjnk+IdF91qikCK0a/4Gw0GoRj8hhPf//+XGsP4V2sA5HYI7Ipp+EiUabvtudn03SQ44w49i+IAHZmK8kCh4b175HYXDopmhcnLbKOtj6HjLvjXJUEzgb3H3+LyR7awVD8yNK3IX83QitGKA9/Tj2ZBdvVPr96NTdrfjn7BYweVUpS1c8NxcmFsc852IFkGDeqzIrN3k7Mt4IQMPxMYtX6/l8DSqdxW1XxISNt7F6ZkWYgVKyHT3LQ== 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=qTe4x0aP1RpaXQJ1HZaqfxSAV4NTiJf162oKWsKpXkw=; b=wVMuCqzpZ8x0TIzE2vo1FZtfSFmpHFoo0kid/DMUd5W115FW7xKUq179Sng4WMnQ07PqcRVXVzO+Txw6mvohgI+VIfB0s0HJDWJbq1r8ciT4D/CcKBHmTAzYO0pepDLNmedNaP2CrbQ0Vz2KhQVRAJd/evqz4Y1hvBjzyu+PqIQ= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by IA1PR10MB7515.namprd10.prod.outlook.com (2603:10b6:208:450::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.49; Fri, 10 May 2024 16:51:51 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::380d:4e6d:faae:a72a]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::380d:4e6d:faae:a72a%7]) with mapi id 15.20.7544.048; Fri, 10 May 2024 16:51:50 +0000 Thread-Topic: [External] : Re: bug#70593: 30.0.50; Dired: buffers of renamed dirs are broken Thread-Index: AQHaotlbu87NZYrC1UyVsotVEvSM6bGQiU2w In-Reply-To: <87msoxddw7.fsf@web.de> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|IA1PR10MB7515:EE_ x-ms-office365-filtering-correlation-id: 4c650c66-0174-4c14-55f3-08dc71117d30 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|366007|376005|1800799015|38070700009; x-microsoft-antispam-message-info: 1HsyMxBjwqS4T7pWt4+H/ad0/1kqLe4shKtjTgoddNvwpLYUQN2845JWPXB151uSBfEEnGG4tN33sc5d7wfx/NmPD/fTmhdLUmyZp1owXm2PKkyOtdkt/JuLexf+bXxofIy19lTr8xtKQcqwx2NWI5OeUFWh1iLzTpu9Z5btHQrleFavqBPNB01tYkLW04eff2YrtIQMJtH6tWgvo6y4jsH4tAWuKSYhQxI+J9LP8paviwOh1DCb5kGG+HTlzTT7V9oLnFtKCFRh7DVRzl5jgy+9PBL4J40g14VzQUXdY/Z8L8BAOH/+vN0M1g3ynlpZqUa+Gw2gkaRQ9mX7Xtg2sKnYLBk9+X3DLb15oAm1gMoK5XZ1eYVLKazkb7ycsHFUcSP95HA/UjUPN+wFWubf+gkqfaWfXF36aFKNN46WurGMq3GMmCUR4muDH660kqYW4XQcpAnGD4uOyvXlSUi1Fbt0vZ2w89tEoBrWjzJAk9bS812lA01ez2ipKw8Gww5p9DdrwSjcbURoWVQl7MBt4aSm6EkOGuLSyg/kYoPnqKHRUTuF+EyllIDqD1vM8fQGkkNRmHVSKh625dK9nmBs6YDIaOmF9GnYMx8+TNJM9iZn2VgM0lpFRFR1nAc502bBE8rHQIMLG2TAqXE8FbC4XDtuEwmUA6ZWUZidt3XOq2WeYrNcELjHrAlvdkY+jCimSuAFYgw6/opGslctCuVjsVadfR+ETPfK69NParpExYlVHGaxpwIBNjpiLWME9 7Q9h6IdRWgvbPozYIqe7J/hVDOYPNAboD+wGU/xNuYu03BEHGS8eX1+ul1PmRdklsxYwMPYyY7jdEwYBqgYxNhNKsE8jhxD9dj 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:(13230031)(366007)(376005)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: hdpoQiuv/GfzL3DxFmsD6NK5usHwzkFEk6NoLbkafulTDH2B9f+ozg1VkEG7gNLwd+uxrvzg4WzU+BpKoMmtAXvRtL4d9ewr85kyO8FQQj05XlPbkyhf/2R68jAKgMK8grK1xaSJyWGtEW1DxL7Plyu7fXpscdOVLjBRWNQR2eDPtYtboD/hN6oHn4ifIj3aYLt7whabAtpjkb1KykqEgEzw+p7qa6/HSV2QN5Ib/FSunVSu/w+h8ufsKhSynKm/ybFxZSbnXvTWtWraPgmHelTo6Vjahoc34RCWly8SBIlHSGeIo0KPYip0sm0mox6I17E3WcCpecWsaVUYXtOWAqmXvQ1GgSAXnxog0Y+R8HyLU5DrMqkP86E9c0M1BGEUmDvtgryo3uPqPJDeb3D3r1FCLRLRSbf8IXaDJri7Cfw/Zq40skvDgJs/rz1X+Tlyb/QTKoHNBpsPRKStkzOiRUhw8G/C4KhTJfiswZFsG/avcqLOegMstGOzr2T2lw5U5tKiTCl7skcC7Iu4NnfW8ip4YGvFzE5Id1L0aQb9cUYRjTyIFyaF95ADcIqX+Cu7y2SYQ5D6B4VCG2SZ2vL6AKEEGOoGs9wTs4m1d81lhEGb+j3WviBLm3zjhkGjiY5mIk68+OHXqRf44uYMgrQyHhvG7qEkBIg96+Xm1W3s92l/Ui3LQjfrsy49qrlAGQuVu+SB0QB1eQQALwC71MjOD6n3Tmg1VY0w50t2rwO6ejB0LXYDQLKRNDBKRi vYaemI4SbaYdnrkzsPvuokB/LweZVZptXU0W8KFOo+D8ElMEU1nn9VakwtWez+y5j1yjpNhh+5HeAaYP/LRaukzgyrsX5yWUWZ X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: UShA5C+mJtbFP5Kx4CSoWEQzImMmOGfGJUfVZPOwZyYbpgnrp8oI9ljDzWo+Ic1Bu0GFl0NqItmDPWOFNpJ9rLieYnHgg8YWF7LrYMcl7cyKOkEzaS+ebhPm3zta7jllcQHc4nE22iwXnwRVTD/m7S153xbzouE9XAiQYBhBxKnKlqyLqSZiKBOXd2SphQI974uKnyy4APGJB8ZC5WkeMRkP57lEt/ILyvsE4Me64yddfFpoS8R+DngAEuEZJMquL5bSaMGYOoqQjY2SuO9X/cdvV1nAs/vJHxtxmX/zl9ZAJhkE8ArKcKfzmACMYX1t7fi3ckUuU7pOXBv2YSupT8eNUDUX+5dR61sVlLvro1WDwKBGFsyw8Kjw4kSZYKJvt54sm2ylxGB7gAbBNyBgXbNhGyMa0qyl4k2Vg0WlJss4dZFA9mIu7d6v7sTPobl8uAif4xsll8pdLXOex/eQVzvP8+m57KiyDvGnrupk+v5BKseDNfWV7Qq8VUW9NIIFutMTHpx5XMBRBSEyB0Ep/OD/tm15ediKeEWjf2f6o5fvGJnUpXl4dOffi0OAqsfsBoyXv8wW+NosVgrSUxSZyR87QbLeilC7BD7KW2Pw2qc= 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: 4c650c66-0174-4c14-55f3-08dc71117d30 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2024 16:51:50.7889 (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: rH6/OrtAFDQkIi4MeYmEHQjOzg7diVSC407ffMiY6+2LoX4zRETKRFEtwRNQOOwXhU4DmBD27+8L1LX6naIrmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7515 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-10_12,2024-05-10_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405100122 X-Proofpoint-ORIG-GUID: nPvyfNrpLNWXBEu1RWVkOtY1_1nWJDS9 X-Proofpoint-GUID: nPvyfNrpLNWXBEu1RWVkOtY1_1nWJDS9 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284825 Archived-At: > > But the car of a cons `dired-directory' isn't > > necessarily a directory name or any file name. > > It's just a string used as the Dired buffer > > name. (Often it is a directory name, but it > > need not be.) >=20 > That's exactly the kind of problem why I have CC'd you. >=20 > Is this a documented feature, however? No, I don't think so. But very little is said in any doc about Dired listings of arbitrary files (i.e., the cons `dired-directory' case). Even in the code very little is said about it. > Heard about it (from you). But > `dired-noselect' doesn't seem to handle or support this case at all, at > least not specifically, although the code doesn't error in this case. Dunno much about that, or I don't recall what I might have known about it; sorry. But note this comment in the code for `dired-internal-noselect' (in dired.el): ;; We can do this unconditionally ;; because dired-noselect ensures that the name ;; is passed in directory name syntax ;; if it was the name of a directory at all. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Whether doc'd or commented or not, it's pretty clear to me that the any-string (i.e., non-dir) case for the car of `dired-directory' was expected/intended from the outset, even if it's not always respected (taken into account). Someone (maybe Sebastian Kremer) provided for it, from the outset.=20 And even if that weren't the case, that's the behavior. To me, it makes sense. If a listing can list files and dirs from anywhere - not even the same file-system hierarchy, then clearly the name of the Dired buffer isn't necessarily a directory name. Or, put differently, whatever its name, the listed files and dirs don't necessarily "belong" to any particular directory - they need not even have a common ancestor (at least in Dired+ - see my other reply to you today). I agree that the cons case isn't as fully supported or fleshed out as the straightforward single-directory case. In particular, there's no _interactive_ support for it, i.e., no way for users to interactively create a Dired buffer listing arbitrary files and dirs. (Dired+ does let users do that, in multiple ways.) > I can only find places in the documentation where the > car is described or referred to as "directory name". Yes, I know. As I say, AFAIK the cons case was never fully developed, especially at the user level (e.g. interactive use). > Could you please briefly refresh my knowledge about this use > case? Does Vanilla Emacs somewhere make use of this case? No, not that I know of. I think I discovered it by accident. This isn't the only thing in Dired that's not particularly well-known/advertised, but it might be the main such thing that wasn't ever fully exploited/developed. Apart from WDired, I don't think much in the way of _features_ has been added to Dired since its beginning. I think most work on the code has been essentially maintenance. I have no doubt that there are hidden/unknown corners concerning the use of arbitrary Dired listings. Someday maybe someone will dig in and develop it more thoroughly. ___ FWIW, this is my take (for Dired+) on how a Dired listing of arbitrary files and dirs can be used, including caveats about side-band modifications (e.g. renaming, addition, and deletion of files originally listed). It's from the dired+.el Commentary. HTH. _________________ Dired Snapshot Listings: Arbitrary Files and Dirs From Anywhere --------------------------------------------------------------- Suppose you use a command such as `find-name-dired', to generate a Dired buffer that lists files from various places. The search part of that operation might take a long time. And suppose that you later want to get back to such a listing, even if that buffer no longer exists. In particular, maybe you want to get to it in another Emacs session. And suppose that you don't want to pay the penalty of performing the `find' search again, and you're content with the set of file names found by the original search. That is, you don't care whether that set of names is still 100% up-to-date. In such a context you want, in effect, to create a Dired buffer snapshot of some sort - you want to record the set of names that your search found, and later use them again in Dired. Dired+ gives you two ways to do this. Both involve first creating a Dired buffer that's produced from an explicit set of file names, from anywhere, rather than one that's produced using `ls' or similar, and then saving that set of file names for re-creating such a Dired buffer later. 1. Use `C-M-*' (`diredp-marked-other-window') or `diredp-marked', to create a snapshot Dired buffer. Then bookmark that buffer. Just jump to the bookmark to restore the snapshot buffer. 2. Use command `diredp-define-snapshot-dired-commands', to create two commands (for same-window and other-window) that will create a snapshot Dired buffer. Save the `defun's of those commands to your init file, for persistent access. The saved set of files, whether embedded in a bookmark or in a special Dired command, is a snapshot of the files available at a particular time. When you later use Dired with that explicit set of file names, only those files are listed - if a name no longer corresponds to an existing file then it is ignored. The resulting Dired buffer represents the current state of the file system, but only as far as the files it lists are concerned. I think the first approach is generally preferable, but you might prefer the second. If you use approach #1 then you also need my library Bookmark+: https://www.emacswiki.org/emacs/BookmarkPlus If you bookmark a Dired buffer without using Bookmark+ then the bookmark records only the Dired directory name. It doesn't record the snapshot information - the explicit list of files to be restored. (It also doesn't record the `ls' switches or which files were marked in the bookmarked snapshot listing, so you can't restore them.) Both approaches, #1 and #2, use the marked files and dirs as the set to snapshot. More precisely, they use the Dired+ version of function `dired-get-marked-files'. That means that you can use a prefix arg to get a different set of files to snapshot, instead of those that are explicitly marked. See the doc strings. Note too that it is the full content of the original Dired buffer that's used to define the files to snapshot. In particular, inserted subdir listings are included. Snapshot listings are composed of arbitrary files and directories. Such a listing might result from a program such as `find', or from a particular set of Dired markings, of from some other way of selecting files - any way at all. What makes them different from the usual Dired listings is that they're not the output of `ls'. You can persist any snapshot listing, as just mentioned, but in most cases you won't. The case of not wanting to recompute a `find' result is a bit of an exception. You can create snapshot listings in the following additional ways. You can use the regular `dired' commands (`C-x d', `C-x 4 d', `C-x 5 d'). Just use a non-positive prefix arg (e.g., `C--') when invoking them. You're then prompted for the Dired buffer name (anything you like, not necessarily a directory name) and for the individual files and directories that you want listed. (Use `C-g' to stop selecting.) A non-negative prefix arg still prompts you for the `ls' switches to use. (So `C-0' does both: prompts for `ls' switches and for the Dired buffer name and the files to list.) `Dired+' provides these snapshot-producing commands for combining and augmenting existing Dired listings. * `diredp-add-to-dired-buffer', bound globally to `C-x D A', lets you add arbitrary file and directory names to those in an existing Dired buffer. * `diredp-dired-union', bound globally to `C-x D U', lets you take the union of multiple Dired listings, or convert an ordinary Dired listing to an explicit list of absolute file names. With a non-positive prefix arg, you can add extra file and directory names, just as for `diredp-add-to-dired-buffer'. You can use `C-x D S' or `C-x 4 D S' to open an Emacs fileset as a Dired (snapshot) listing. See the Emacs manual, node Filesets, or https://www.emacswiki.org/emacs/FileSets, for info about filesets. You can visit your recent files or directories as a (snapshot) listing, using `C-x D R' or `C-x D r'. You can revert (using `g') or sort any Dired snapshot listing. You can also sort such a listing in various ways, but you need to use `C-M-L' (aka `C-M-S-l') to do so - you can't use the ordinary Dired sort commands, such as `s'. You're prompted for the sort order. The default sort order for such buffers is determined by option `diredp-default-sort-arbitrary-function'. When using a Dired snapshot listing other than one composed of recent files, be aware that any operation that reverts the buffer relists the same file names, and only those that still correspond to currently existing files. This means that: 1. If any of the files no longer exist then they will no longer be listed (which is likely what you would expect). 2. If any of the files has been renamed then it will no longer be listed (which is likely not what you would expect). This applies to the use of WDired to rename files: the renamed files are not listed when you return to Dired from WDired. It applies also to the use of `R' (`dired-do-rename'). (A renamed file is listed with its new name in any ordinary Dired buffer.) (With Emacs prior to version 28 you can't use WDired on a recent-files buffer at all, because such a buffer uses a `revert-buffer-function' that updates the file list to show the currently recent files, and older versions of WDired hard-code the function used to revert back to Dired mode when you exit WDired.) ___________________________