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: Sv: Partial wdired (edit just filename at the point) Date: Fri, 19 Mar 2021 20:40:47 +0000 Message-ID: References: , Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_PAXPR09MB4992D5441A7EAED45F95504896689PAXPR09MB4992eurp_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17497"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 19 21:42:21 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 1lNLwr-0004TS-3n for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Mar 2021 21:42:21 +0100 Original-Received: from localhost ([::1]:36548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNLwq-0006rZ-42 for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Mar 2021 16:42:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNLvW-00068I-3V for emacs-devel@gnu.org; Fri, 19 Mar 2021 16:41:00 -0400 Original-Received: from mail-vi1eur06olkn2076.outbound.protection.outlook.com ([40.92.17.76]:2528 helo=EUR06-VI1-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 1lNLvQ-0000KW-0l for emacs-devel@gnu.org; Fri, 19 Mar 2021 16:40:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m0fsFNGolisuMCuUCVEyYH9FDcYlzeULazhLZBmrNhgsnpUlxgKqBNea4kUXoPdWjCJ8OmS7/kYSNebZega1OxYjKnNEXwa7EWF3SWvW331DpKzZIxfhtaD4MFIpc7NtCkWGBmiMT1Wku/rq0OV13tP6hNONGGC8mL4lR/ANjICTcPGiELL9qF8Poabg5X/1vJoAdjkjgPDvaKBlWykFaR6QyqsZPbJ7rmpg2TE6JudFul8Nz0Sd7C4QRXvc7qrxih6Jf/UXZR9feqO94hKFOsfUPcOIjGEwlgfMBzNefTkhd7GeLByk/bBeMzgk/Jw+voRoEGqEp0Uh4RqSqwxO0w== 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=qDjATGxIMf+Tf/Kx/uDaJduZiBm17VHXpcuFZLn8ZhA=; b=P650rCvgjBZrfobB++2YNpUNPHgNKC+MX53tzvwwSun9+ZiurCAVEypZcT5PKoBOlcoTDUJbVpWFELappy9aTKQHbnOmtJLrzYQaK1YqtRk6v43zl0Pt+BNSDyuupLQ+1eearmHAvWpVR2NcxFX5uRRLisbaEkHfFqMibbZrCvT+qzjnPrbQD9oDdEsUnKYjBX5j9wce64K3Z1L9R0TitiG17krKekxAGIbi4975+hBA341BePV0yL/9H27Xu8h6qE7N6slEaHEn1SFvuvghjFiCn2EKj81d4NhKVkbba7JUZg1EehfM6CNMtfn7bbk7ksHzShvE0D7trtH/l1cxTg== 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=qDjATGxIMf+Tf/Kx/uDaJduZiBm17VHXpcuFZLn8ZhA=; b=Eu9pq/tL5QeJ0tDwd1UddxTLOVdaEi+QU7W09uoXocgYhoEviIHcuwRFNv3AX9bSOf2cOM9Uh1GPVFfJg0mcnRwKpI0z4Ees2O8zCvO61+LUEJfeLodVT7vW5ty34fsZlawZTJa721EcNh8U+FE1DQLqZcjcBHQI/2MobJhBNgj1YpsDg6P6u1xE88OvVkKU6aLHazvCkm9Ioub7cvECLyzHD/zWD9H+OXFB+DWZY3g5bpH5pVjMDUEXRLd1DOMBPoO9imEQJxmKdpFoDClu6GKnctH8hoFBG188X+/A3pNu+YMHIlot+XQ2IzYIZthMk7EPIlQwuDSBUdZO9IvGgw== Original-Received: from VI1EUR06FT006.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::51) by VI1EUR06HT050.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::264) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Fri, 19 Mar 2021 20:40:48 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc37::49) by VI1EUR06FT006.mail.protection.outlook.com (2a01:111:e400:fc37::103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Fri, 19 Mar 2021 20:40:47 +0000 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.3955.024; Fri, 19 Mar 2021 20:40:47 +0000 Thread-Topic: Partial wdired (edit just filename at the point) Thread-Index: AQHXGpFtGHa56l/yskKJgxO4VfpsQKqLggXxgAA63JA= In-Reply-To: Accept-Language: sv-SE, en-US Content-Language: sv-SE x-incomingtopheadermarker: OriginalChecksum:44E99777F3816F5BBEA7628E2064273085233940F3BAEA718452BCC72A3E2A28; UpperCasedChecksum:C83746D360DC01C65440F13D41BC5532F169C43ED6484EB9D666750DADE1453F; SizeAsReceived:7664; Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [UsBMu95/scPk4A+D+ksVJyA5FH8TQ7bE] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: e7e4c9bb-2e61-48bf-1e62-08d8eb1746ef x-ms-traffictypediagnostic: VI1EUR06HT050: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TUDtu5rDqMkAkdTV7agS/SnRbkaslATpq5u54dVzKbYArHLky/otQsybQ5UOYNLabUrff314rE9Kj9r5gtOwCzAdbIlnYVFt2PUOYqVg3rxirRGaTgqPo+rn1lV5sb0eP1rZNpR0mUlWNQm5I2fqfq7vdu4FtOVMHJJOMegwmwHlO2W0UIiJFDUTXgtfltG3HmBovH/XhwCC5IxrrS5odNykGWyvHWFhuRhxVK5MyQrHzBpmRdJvMhsOPI2x3qdpybndlCXlwcPT60ljfBhnGmS5dydSUwtVXvDcjQkt790cYAXjIN9HDRw56kD+U+fLn53RW0pmZtIEQzlq7yxcaMO6Sha/30jxZIfbKnXVvvdHDu3TTZbgX/PNh/C4NXw5RJFFX8VKeaImmzaLXM/gXA== x-ms-exchange-antispam-messagedata: 64ZwuR6RRDEnKKpTZpMk3hEi1mt4arF6M8+5IuIlq2/dSzW2zNO9BSKqP2n+3CXoEN/qdNHkQ7hcTGY95dt73mKecqnM9aeb9FXRYnw+6QITGvEhEEWul9O7jaladPsqhtzuzyY55APZbQvHI83V9A== x-ms-exchange-transport-forked: True X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: VI1EUR06FT006.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: e7e4c9bb-2e61-48bf-1e62-08d8eb1746ef X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2021 20:40:47.9029 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR06HT050 Received-SPF: pass client-ip=40.92.17.76; envelope-from=arthur.miller@live.com; helo=EUR06-VI1-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, HTML_MESSAGE=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:266617 Archived-At: --_000_PAXPR09MB4992D5441A7EAED45F95504896689PAXPR09MB4992eurp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Yes, of course, I had `wdired-allow-to-change-permissions' set to t; it is = the pre-requisita. It works fine when `wdired-allow-to-change-permissions' is set to 'advanced= . Than the read only property of permissions part is set to nil. But in ordinary case the read-o= nly property does not seem to be modified by the preprocessing routine. Instead preprocessing jus= t marks where permission part starts and ends. and it seems like actuall manipulation is = done elsewhere in code below. Thanks for clarifying steps involved; I understand now, I didn't really und= erstood them :-). Ok, originally permissions flags are preprocessed before change to wdired i= s finalized. So something somewhere in wdired setup is checking for permission bits? I think. ________________________________ Fr=E5n: Stefan Monnier Skickat: den 19 mars 2021 17:18 Till: Arthur Miller Kopia: emacs-devel@gnu.org =C4mne: Re: Partial wdired (edit just filename at the point) > Indeed, I was only concentrated on "interactive" editing, didn't thought > so much of other elisp functions. That's the advantage of `before-change-functions`: you just don't need to think about all the many different cases. > Jere is a sketch with region, however, I am not able to get > editing permissions correctly. I am not really sure what is going on. I assume you tried with `(setq wdired-allow-to-change-permissions t)`. I think I see what's going on: - I go to the permissions of a "fresh" line (one that hasn't yet been processed by `wdired--before-change-fn`). - I hit `x` with the intention to toggle the execute bit. - Because it's "fresh" there's no keymap set so the key lookup decides I want to run `self-insert-command` rather than `wdired-set-bit`. - Then we see another problem: the "read-only" test is performed before running the `before-change-functions` so the insertion of `x` is allowed even though we will end up placing a `read-only` property over that text just before the `x` is actually inserted. I see other problems linked to this ordering problem: - Go to the "non-editable" part of a "fresh" line. - Hit `C-y` - The yank is happily accepted. - Worse: the text we yanked doesn't have the `read-only` property so you can keep modifying it (tho the rest of line now is marked `read-only`). Hmm.... Stefan --_000_PAXPR09MB4992D5441A7EAED45F95504896689PAXPR09MB4992eurp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Yes, of course, I had `wdir= ed-allow-to-change-permissions' set to t; it is the pre-requi= sita.

It works fine when `wdired-= allow-to-change-permissions' is set to 'advanced. Than the re= ad only
property of permissions part is set to nil. But in ordinary case the read-o= nly property does not
seem to be modified by the preprocessing routine. Instead preprocessing jus= t marks where
permission part starts and ends. and it seems like actuall manipulation is = done elsewhere in code
below.

Thanks for clarifying steps involved; I understand now, I didn't really und= erstood them :-).

Ok, originally permissions flags are preprocessed before c= hange to wdired is finalized. So something somewhere in
wdired setup is checking for permission bits? I think.

Fr=E5n: Stefan Monnier <= monnier@iro.umontreal.ca>
Skickat: den 19 mars 2021 17:18
Till: Arthur Miller <arthur.miller@live.com>
Kopia: emacs-devel@gnu.org <emacs-devel@gnu.org>
=C4mne: Re: Partial wdired (edit just filename at the point)
 
> Indeed, I was only concentrated on "inte= ractive" editing, didn't thought
> so much of other elisp functions.

That's the advantage of `before-change-functions`: you just don't need
to think about all the many different cases.

> Jere is a sketch with region, however, I am not able to get
> editing permissions correctly. I am not really sure what is going on.<= br>
I assume you tried with `(setq wdired-allow-to-change-permissions t)`.
I think I see what's going on:

- I go to the permissions of a "fresh" line (one that hasn't yet = been
  processed by `wdired--before-change-fn`).
- I hit `x` with the intention to toggle the execute bit.
- Because it's "fresh" there's no keymap set so the key lookup de= cides
  I want to run `self-insert-command` rather than `wdired-set-bit`. - Then we see another problem: the "read-only" test is performed = before
  running the `before-change-functions` so the insertion of `x` is
  allowed even though we will end up placing a `read-only` property ov= er
  that text just before the `x` is actually inserted.

I see other problems linked to this ordering problem:

- Go to the "non-editable" part of a "fresh" line.
- Hit `C-y`
- The yank is happily accepted.
- Worse: the text we yanked doesn't have the `read-only` property so you   can keep modifying it (tho the rest of line now is marked `read-only= `).

Hmm....


        Stefan

--_000_PAXPR09MB4992D5441A7EAED45F95504896689PAXPR09MB4992eurp_--