From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#32673: 27.0.50; wdired: broken 'wdired--restore-dired-filename-prop' Date: Wed, 12 Sep 2018 02:32:09 +0300 Organization: LINKOV.NET Message-ID: <87sh2fpq4m.fsf@mail.linkov.net> References: <87lg8byluo.fsf@mail.linkov.net> <875zzbu1or.fsf@gmx.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536709009 31973 195.159.176.226 (11 Sep 2018 23:36:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2018 23:36:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 32673@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 12 01:36:45 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzsD6-0008EN-FX for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Sep 2018 01:36:44 +0200 Original-Received: from localhost ([::1]:59987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzsFC-00064t-Mo for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2018 19:38:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzsEN-0005P7-5n for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 19:38:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzsEM-0006yR-Ap for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 19:38:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33176) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzsEM-0006yJ-6k for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 19:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fzsEM-0004Ph-20 for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 19:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Sep 2018 23:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32673 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32673-submit@debbugs.gnu.org id=B32673.153670906216937 (code B ref 32673); Tue, 11 Sep 2018 23:38:02 +0000 Original-Received: (at 32673) by debbugs.gnu.org; 11 Sep 2018 23:37:42 +0000 Original-Received: from localhost ([127.0.0.1]:37434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzsE2-0004P7-5u for submit@debbugs.gnu.org; Tue, 11 Sep 2018 19:37:42 -0400 Original-Received: from pop.dreamhost.com ([64.90.62.162]:46832 helo=pdx1-sub0-mail-a38.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzsE0-0004Ox-5y for 32673@debbugs.gnu.org; Tue, 11 Sep 2018 19:37:40 -0400 Original-Received: from pdx1-sub0-mail-a38.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a38.g.dreamhost.com (Postfix) with ESMTP id 0C2E57F267; Tue, 11 Sep 2018 16:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=uqm7PPokhFMIM5hRo1DEFbjpmbo=; b= xp1O7tr/ZfdCLWM0oeWdbeHWEDFlLBb8MP2B9jQV0dCc67oYZAW4rug47ckINdZq xTwbDYIsjr2oBJR0jiSpLo27aE9r7r4LjBi+CKiOCDYoMBA1haeyIsDNL3x3FiP/ f/fkRSp7sxO7IL3r4tIGJ9mOWO5j+ar+nMB0+4NUuwA= Original-Received: from localhost.linkov.net (m91-129-104-147.cust.tele2.ee [91.129.104.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a38.g.dreamhost.com (Postfix) with ESMTPSA id 5EFD97F25F; Tue, 11 Sep 2018 16:37:36 -0700 (PDT) In-Reply-To: <875zzbu1or.fsf@gmx.net> (Stephen Berman's message of "Wed, 12 Sep 2018 00:08:52 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150231 Archived-At: > The immediate cause of this is that wdired--restore-dired-filename-prop, > which is on after-change-functions, calls dired-get-filename without > making sure that the file name is not the empty string. But it turns > out that using dired-get-filename in that function also doesn't work > with symlinks as I had thought (and tested, but evidently not enough): > after enabling wdired-mode but before making a change, (file-symlink-p > (dired-get-filename)) on a symlink returns the name of the target, but > as soon as a change is made, that sexp returns nil, which causes a > text-read-only signal. The patch below replaces this sexp and according > to my tests avoids the error which breaks delete-selection-mode and also > most text-read-only signals (one remains: when deleting the whole link > name; I haven't been able to figure out how to avoid that). The patch > should get more testing (in particular, is looking for the `l' flag a > reliable way to identify a symlink?), and an ERT test would also be > good, but I probably can't do either for the next few weeks, because > I'll be travelling. I can install the patch before I leave, since it > seems at least better than the status quo, or maybe someone else can > take a look and either confirm that it is good enough or else come up > with a better fix. Thanks, since your patch fixes the reported problem, there is no reason to postpone installing it. Regarding improving the handling of symlinks, maybe you can use some code from dired-move-to-end-of-filename, especially handling dired-ls-F-marks-symlinks.