From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Lazy wdired preprocessing Date: Fri, 26 Mar 2021 13:15:12 +0100 Message-ID: References: <87wntuzv7m.fsf@web.de> <87h7kyh9w7.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1664"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 26 13:17:36 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lPlPD-0000DQ-G1 for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Mar 2021 13:17:35 +0100 Original-Received: from localhost ([::1]:45248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPlPA-0002QQ-6s for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Mar 2021 08:17:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlN4-0001on-Qj for emacs-devel@gnu.org; Fri, 26 Mar 2021 08:15:22 -0400 Original-Received: from mail-am7eur06olkn2056.outbound.protection.outlook.com ([40.92.16.56]:56039 helo=EUR06-AM7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlMz-0000zV-5U for emacs-devel@gnu.org; Fri, 26 Mar 2021 08:15:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SURArHUAWUaeORS+OgL0mP08k58w63QGNAowc4SF2NWsQv4RrgALPXgj0pORjwKtrbszOXL1cvSQvEl9QFklh1UNvc6QCgUOvYb7xYGFnKYFseBJ6qB4scBIM1+fzSwkFZRUIHUAbT1iZ/VI0rlGo1Gyv2Dl9eWYVpW7Ogo3019VE+lDsOVVWv1NCwmidW3nQhs2J/haTYCgMAbBgSFYjtp/j2AsKAsBgjFTMt2uw21c6AAwvmrhEe9Ejy6zL049J/cVZdL2bFr7bD0Rm0E0Tnndc9i1jyL5/BV4Q+CxD6Pi2ExmcbFWNLjwosi26V0XNcfxxnKDUFWLTbTVIrGO3w== 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-SenderADCheck; bh=kx2nzt5BNT3iwI1XuqNrmDa4F8a42gWbPXecCuXaC/g=; b=YY45bie//AOlSCC2khAqcja6bidQWjmU6dhd8wUp4EFRmJcCVXxlmKzAKwRNLQV8ifsDeyVDgzGEU0z+T23kAt9N9vv6RKB84UEFjLIjl9OqR/th7T4MlruYMbf4R/O6F94jEmJCtYy+d4RLQ5uWpvRF+e2WKTA5aO7J0Fbnj42Gkz1uT0eeddemzoGpSen9K353mxmxlIWQFbax7fpQxLKcvXBFPEHVihWPqfuhhoAJXDlc3O2/qxs4dpEqbwGg66EILOpxIn/22sVEWkb6NEPzCnOOPMbe+x/oAtqozBN67euqy4tvNSD2ie7TUGWA/aaPj7gYUwZGuQF6XTJbCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kx2nzt5BNT3iwI1XuqNrmDa4F8a42gWbPXecCuXaC/g=; b=aULnhSXhUi1sPRS4ljgxzgEaDOYRC8HxKhsk+5zTeNgRTjd835m0eAsMhU9Wf4jdEiZAoCHvs46qRcs51nAFi68ZkKFPFo7L5xM/uNidaWTyxzG0C9f6oG2Cfbq2q/9Ai1peaUhvN+YDdJYriDvLwUahBuCq3jH5wakQuthPCONjPNGHqGVpZq7VkQwSHZ9300GqVpY8+uBmD1JT76vXYktT5ClQeUsF3HcyO/BOEuVus7ZhGGdN3eej7PQn9oDTBa3kiFAQjaqTTrzyB0KQerHE6qgkW6tem23ofnCkRZtmLw1dGXHOFmgViCCrLcNFMDLXGx0U/jUPdQPFnudl3g== Original-Received: from VI1EUR06FT024.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::53) by VI1EUR06HT216.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::440) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.29; Fri, 26 Mar 2021 12:15:13 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc37::4a) by VI1EUR06FT024.mail.protection.outlook.com (2a01:111:e400:fc37::491) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Fri, 26 Mar 2021 12:15:13 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:71B6CABBFE83268ED1D606C91D8CA7A9982D86DC1B703755DCB82ADFB7DAE743; UpperCasedChecksum:89861BA324DA2297A2C057E941C87B0765808AEB1A99E19F9536A3BA80A42CEF; SizeAsReceived:7574; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b%6]) with mapi id 15.20.3977.025; Fri, 26 Mar 2021 12:15:13 +0000 In-Reply-To: <87h7kyh9w7.fsf@web.de> (Michael Heerdegen's message of "Fri, 26 Mar 2021 04:27:36 +0100") X-TMN: [Fqngv5IBsz4WH1KYR3nmElHr2gxZURv6] X-ClientProxiedBy: AS8PR04CA0090.eurprd04.prod.outlook.com (2603:10a6:20b:313::35) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87wntukt67.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AS8PR04CA0090.eurprd04.prod.outlook.com (2603:10a6:20b:313::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Fri, 26 Mar 2021 12:15:13 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: df76db2d-9a70-4ac4-4d59-08d8f050cee2 X-MS-TrafficTypeDiagnostic: VI1EUR06HT216: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FEb8JivJHPztfK7w2oFL1JfmDhcLCDoTC6Cvh1cBO17Kp6WP+7rxQ9vv1p0rUtlrytFGmv1ar0J7ROOPf70Ae2rWGvynHhVnNtVzSowjPw2CSfWnDEqGq6ah4j1awqmev2hcdBbBntos52RN7bWV6iZ3/FcUhAA0MyEYB+lE82NlOjTxlOpNY3FW/cWzUjmPGJJFrcTx8QJAw7Z1UZV9HC7x/oFgNWxb8RzBQnbT+oBiuCep5h2Jy+YDZYfhs+r5AXhKHvSn+k5kIVUr1/MAkGRXaswjg16di3CP2RDd1EZZyG0DYDmJOjOWCut99bh5Dt6i/dZqL2ZZ/fGoenZysCb13lcFvgBuPXZfrNCmiVgvUyFLM2QIjNFCj5AGfoIY3nC0gVIiN1W+9WesKgHpTA== X-MS-Exchange-AntiSpam-MessageData: TP1cCO/hRSO3Kb+godTfOVVszBy7Z7OOHuMcKdViV1mV5m07XdZNs4Sz8YrZdeeQ0JKJs8YuIh72m49Rj38ul+mts+idCnyBtWGEwTTMxzFtJIlnZuySu0dLxr+4cls3AMHOhZzYWIOHG0Jo7htwrg== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: df76db2d-9a70-4ac4-4d59-08d8f050cee2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2021 12:15:13.6134 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR06FT024.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR06HT216 Received-SPF: pass client-ip=40.92.16.56; envelope-from=arthur.miller@live.com; helo=EUR06-AM7-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267065 Archived-At: Michael Heerdegen writes: > Arthur Miller writes: > >> This was re-implementation of parts of wdired to make it more efficient >> and faster to enter the wdired mode. > > Ok, thanks for the elaboration. Didn't try it yet, but I welcome this > change. So far I have one question: > > + ;; find one column with permissions and set permision text boundaries > + (save-excursion > + (goto-char (point-min)) > + (unless (re-search-forward dired-re-perms nil t 1) > + (wdired-abort-changes) > + (error "No files to be renamed - Exiting to Dired mode.")) > + (goto-char (match-beginning 0)) > + (setq-local wdired-perm-beg (current-column)) > + (goto-char (match-end 0)) > + (setq-local wdired-perm-end (current-column))) > > Did you check that this works when `dired-hide-details-mode' is enabled? Yes, it works. I that option always on, and display details only when I need them. > I ask because AFAIK `current-column' doesn't count invisible characters. > [It might be better to just count characters from the line's beginning, > but I see that the existing code also uses `current-column'.] As optimization, I pre-calculate start and end of permission part of text in `wdired-change-to-widred-mode, so I don't need to do this when processing every line, but I could do this later on, I don't think it would be a problem. When details are hidden, one can not enter the permission part of text, so the `current-column wont be called either. I use it only to check that point is in permission part of text, so when permissions are hidden user won't enter it and `current-column will not be called. I had version where I calculated column on my own, but I thought it is better to use something that already is there than to add more code :).