From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#18475: 24.4.50; Wdired: cannot use C-k to delete a dir name if -F switch used Date: Sun, 12 May 2019 13:36:04 +0100 Message-ID: <87ef537suj.fsf@tcd.ie> References: <56994c97-c501-4233-b029-dcb12c796441@default> <8736m4pavn.fsf@tcd.ie> <87muk740yk.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="72730"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 18475@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 12 14:37:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hPnj9-000IjE-0V for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 May 2019 14:37:15 +0200 Original-Received: from localhost ([127.0.0.1]:42827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPnj7-0004nQ-Nl for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 May 2019 08:37:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPniy-0004nA-9X for bug-gnu-emacs@gnu.org; Sun, 12 May 2019 08:37:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPnix-0000gW-9m for bug-gnu-emacs@gnu.org; Sun, 12 May 2019 08:37:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56770) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hPniw-0000gE-KL for bug-gnu-emacs@gnu.org; Sun, 12 May 2019 08:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hPniw-0005pA-FC for bug-gnu-emacs@gnu.org; Sun, 12 May 2019 08:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 May 2019 12:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18475 X-GNU-PR-Package: emacs Original-Received: via spool by 18475-submit@debbugs.gnu.org id=B18475.155766458022329 (code B ref 18475); Sun, 12 May 2019 12:37:02 +0000 Original-Received: (at 18475) by debbugs.gnu.org; 12 May 2019 12:36:20 +0000 Original-Received: from localhost ([127.0.0.1]:42081 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPniE-0005o3-KJ for submit@debbugs.gnu.org; Sun, 12 May 2019 08:36:19 -0400 Original-Received: from mail-ed1-f43.google.com ([209.85.208.43]:45869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPniC-0005nj-Nt for 18475@debbugs.gnu.org; Sun, 12 May 2019 08:36:17 -0400 Original-Received: by mail-ed1-f43.google.com with SMTP id g57so12973218edc.12 for <18475@debbugs.gnu.org>; Sun, 12 May 2019 05:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+/Xx6pfM+0BqwqWGRNVnhQXQc8Qbslf4rkbNExY3aX8=; b=HSxyx5DiF1ZQXj6T4ct6+newHgDlHsI4uB8nTCt1lHIdltfejf247KD9JTagpQZNKj 8toygA0a7hVcfi2hBkL/ysV6FdyvJzEMxqFRRuHqk/K/nTf8dvzPwjETtCgxUXQeR8GN X5Rv9IHiIdCjN6+W5S0u+J3nnHV4+uDyHc9pSAVs6kst/3J+bzMZzyXAqcx2gNwSBaHX qQXTa1GmzhPfh71ARhwoJDSPGWjgEY7NTDG8ReGsHAOsHzg0KyTAmoKIOgjpVN+fGS0x pYPkQL2Dw+YHRecUYmY3AF4KqUbIbnwgOExvA/U9DgK5kkRR4+208LKLVLRg+k8Tw8lx vvaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=+/Xx6pfM+0BqwqWGRNVnhQXQc8Qbslf4rkbNExY3aX8=; b=ahpBxa0au/HDVB9/rMmuVq7cZJvsmRZWRvNXxVU8VMwWH00R6AYhPJnrcm4oOzP/IY 6JrXMjdpo8AvbFWwtLd+UVTOb6jicaySckBpmXkWfJKVUbKOtsz3SZyBUxc2kP2mtlVd cuiQkwWz4DMWRL60MTO/hYdHcRr9O7kQAMjfONXwvdbbvmK/6sK8rCg/gEuLv8iI7BDR W0TbupFzpw92E4ZfqupOF1eFQw+9X60piguAme8ltekHf63tYQYu9KI1Y7w7JUCvrwT0 0n6Q7TBYwu6nELN+l7Mal+3A0Zdx9O2TZRIWRdilsFqrrNipzfuST+RVBORI5jHTaa1T 3A2w== X-Gm-Message-State: APjAAAV/RgPuxwetGkfwI6Ptl2UYFKhXeNILOcqu7Bfg+95N7M9cC7QG J9Ng6hUv03cy8GSFQyw7gAA9Ug== X-Google-Smtp-Source: APXvYqyaP1ZoJlY1qfSwy9PYN+gaVJTpW5iJofGahtsF06Io3JMVNw3TtSN3lDl5FHKNGsd9Cd3S7g== X-Received: by 2002:a17:906:b6c8:: with SMTP id ec8mr17500583ejb.89.1557664570774; Sun, 12 May 2019 05:36:10 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:8cad:ae29:555d:852d]) by smtp.gmail.com with ESMTPSA id a40sm3041860edd.1.2019.05.12.05.36.09 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 12 May 2019 05:36:09 -0700 (PDT) In-Reply-To: <87muk740yk.fsf@gmx.net> (Stephen Berman's message of "Tue, 30 Apr 2019 23:50:27 +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: 209.51.188.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:159128 Archived-At: Stephen Berman writes: > This happens not only with `/' but also with the other ls file indicator > characters appended when using the -F switch. Making C-k work as > expected for these cases is a small fix. However, the same issue also > arises with symlinks, whether or not -F is used, and it does not seem as > straightforward to deal with this case. The attached patch (against > master) tries to ensure the following behavior: > > - Typing `C-k' with point just before the first character of a file name > ending with an indicator character (using -F), or of link name, > deletes the file name/symlink in WDired, but it is restored but marked > for deletion on returning to Dired. The same also happens when just > deleting the link name in WDired. > > - Typing `C-k' with point on such a file or link name, but after the > first character, deletes the rest, resulting in renaming on returning > to Dired. > > - Deleting the indicator character is possible in WDired but a noop: the > character is restored on returning to Dired. (In the current code > without the patch, the indicator characters are read-only, but I had > to change that to make C-k work.) > > With symlinks: > > - The patch preserves the current behavior that an edit of the target > name (possible when wdired-allow-to-redirect-links is non-nil, as it > is by default) is saved on returning to Dired, and if the target name > is deleted, then the new target on returning to Dired is "/dev/null". > > - Editing (changing or deleting) the string " -> " between the link and > target names is possible in WDired but a noop: the symlink is > unaltered on returning to Dired. (In the current code without the > patch, " -> " is read-only, but I had to change that to make C-k work.) > > I've tested these cases, but it is quite possible that I overlooked some > variants or other cases, so I'd appreciate testing and feedback from > others. (Also, the code still needs more commenting and probably > cleaning up.) I can confirm your patch fixes the issue in the OP, but I haven't tested it extensively. Thanks for working on this, -- Basil