From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#50189: wdired chmod should not follow symlinks (Bug#11912 followup) Date: Sun, 11 Sep 2022 03:32:42 +0200 Message-ID: <87mtb6zoed.fsf@web.de> References: <55e059fe-c2ae-e8cb-20e2-30de656ce0a7@cs.ucla.edu> <87pmu1kapc.fsf@gnus.org> <87czc3oia5.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12332"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 50189@debbugs.gnu.org, Paul Eggert , Arthur Miller To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 11 03:34:10 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 1oXBrO-00030t-JN for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Sep 2022 03:34:10 +0200 Original-Received: from localhost ([::1]:46352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXBrM-0006wQ-PJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Sep 2022 21:34:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXBrG-0006wF-Hg for bug-gnu-emacs@gnu.org; Sat, 10 Sep 2022 21:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXBrG-0002Oi-8m for bug-gnu-emacs@gnu.org; Sat, 10 Sep 2022 21:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXBrF-0002vl-SD for bug-gnu-emacs@gnu.org; Sat, 10 Sep 2022 21:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2022 01:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50189 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 50189-submit@debbugs.gnu.org id=B50189.166285999011202 (code B ref 50189); Sun, 11 Sep 2022 01:34:01 +0000 Original-Received: (at 50189) by debbugs.gnu.org; 11 Sep 2022 01:33:10 +0000 Original-Received: from localhost ([127.0.0.1]:40530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXBqP-0002uc-KD for submit@debbugs.gnu.org; Sat, 10 Sep 2022 21:33:09 -0400 Original-Received: from mout.web.de ([212.227.17.11]:34219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXBqM-0002u6-Ma for 50189@debbugs.gnu.org; Sat, 10 Sep 2022 21:33:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1662859965; bh=g0mqUhmn24IhRkDASJi/f6pzlU25n4mCOPwGI1dwMpA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=GDFs1fDjaKA41Dlghh/vHhyT/7HvJXFrROwAPWREzTEz2liLF2FKz0ZKDu60q7HHC oIAXnOwGuZmvxgMvm9fBD/G48drVUiWv01tgcsVwJAEhtQC5xAnzwygpt1Y3lR8mgF kimjwCnnH9wquWRD/BcbVqGbZ5mKngoiecFPZsM8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([92.208.190.67]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MFJjP-1oZ3VE12Tp-00FSKb; Sun, 11 Sep 2022 03:32:45 +0200 In-Reply-To: <87czc3oia5.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 10 Sep 2022 08:28:02 +0200") X-Provags-ID: V03:K1:EMp7sBroHGaE6xuJ0nIgPF7WRvweDzQ2twtTWPPIE/U+Fkf+Urd GtWsY2WLcKXYnr3Ak8/wodWQgqMW/pifdWXeJB5SK9u0i3d87LAQEnNee+ndUB7Akv2JFS8 P4YO+cKLJYfQSZuDh+37WJpCqq6jCivbcTyS1W13F7SX/p9bG8hAOGCddhfjAH0M2eXouih Wdva3gOF/glg5C1ocNBTg== X-UI-Out-Filterresults: notjunk:1;V03:K0:HIl947FPAg8=:p5YOZ+nO9EqoR5sbThu9qq /6wQ/mq2RkLz0TrlYOQk32dGdUZ0E9feu/UW4t8bznd9GtREoVonVrvFtQC1Tt000CD0r5FOd iWX5wnJKQNZyK3Gp/WKvr14aWhoUTysybRri5eU2kX9Tj+8+20X34U5YOMaYBDLbacwzsNTcQ yCR7Gikhvl7U9oCZAyambpmulG4Wf2bxVsO7/j6ySn7g6G9/5LDq2DqBc7c79xy1YYQV1p1EM GhFFLtu6WDOKoKvnwIlEBJhVn6HscrEarkL/7bcX3LR4/idJiksbL9cmiu2Uh6MizfARP8zMa 5KR2igcNegqBQtlIbZQHQHknZnX6QIkyJi3Db3zlyHxtaZ36pFf8wHV6Ol2m9fD+k1krp8kaj qYR07nDOi+NtyS2yKBLRo48ydt5yApWYTvjqQZkxnmJC6aY2xEK/EtRNo7SZi6DlY2AKeTvGO GG22SHjhXeraujsEx8C/vrR9A1FWHME3JsS/ogSEWTb22bqysMRJAu+p717ZjmhAjXdZbKSrU iPPRFLeCuYanLl9UfYGFP6f1jcRy5cc5HkSVKJE6XRycRtGP+87tqVdw/3OAZpYaLX34Vpy2x nZIsc6QuLw6sp7I6XHDxmjFJih2MTUvNFpjhb8e9h2dNfB1L2wdrqBuCsTIwDSw6REI6O4beC FmRPUDA18vbroW3de4+X9+tTtcDtS31skVwjfE6ev54dUjMxgUILjCG6L42pW3wOWJ3k6snGh 8iDWJDd3cvKAmjy/K41dlPC3MGmAqy/d/5D0/Flid3BWPCwjON7JLES0rpyiuMRabXLJSjJN 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:242122 Archived-At: Lars Ingebrigtsen writes: > Lars Ingebrigtsen writes: > > > Yeah, editing the permissions doesn't seem to work for me in dired. If > > I start with > > > > -rw-r--r-- 1 larsi larsi 329K Aug 21 18:22 IMG_4478.JPG > > > > and press DEL after the final dash, it'll delete the dash and then say > > "Text is read only", leaving me with: > > > > -rw-r--r- 1 larsi larsi 329K Aug 21 18:22 IMG_4478.JPG > > > > And then I can't insert anything there, because it's now read-only. So > > something is wonky in the way wdired tries to make certain bits of the > > line read-only. > > Setting wdired-allow-to-change-permissions to t or `advanced' made this > work -- you can't really edit the permissions without that. That behavior not optimal and a bit confusing. As you might remember, text properties in wdired are now attached on the fly for better performance, implemented here: | 4dbc44550d * lisp/wdired.el: Apply text properties lazily | Arthur Miller 2021-03-27 [Arthur is CC'd] The problem in this case: the read-only property is attached in `before-change-functions'. But that doesn't prevent the change being performed. Try e.g. in *scratch*: #+begin_src emacs-lisp (add-hook 'before-change-functions (lambda (&rest _) (put-text-property (point-min) (point-max) 'read-only t)) nil t) #+end_src The first changes goes through although the text is already read-only, because it's still the same command or so (anyone thinking this is a bug?). I think we could make wdired explicitly check for and throw a "user-error" in this case so that the editing command is not performed (but only after the properties were attached). TIA, Michael.