From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: 18475@debbugs.gnu.org
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 [thread overview]
Message-ID: <87ef537suj.fsf@tcd.ie> (raw)
In-Reply-To: <87muk740yk.fsf@gmx.net> (Stephen Berman's message of "Tue, 30 Apr 2019 23:50:27 +0200")
Stephen Berman <stephen.berman@gmx.net> 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
next prev parent reply other threads:[~2019-05-12 12:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-14 18:01 bug#18475: 24.4.50; Wdired: cannot use C-k to delete a dir name if -F switch used Drew Adams
2019-04-27 0:09 ` Basil L. Contovounesios
2019-04-28 8:13 ` Stephen Berman
2019-04-28 13:07 ` Basil L. Contovounesios
2019-04-30 21:50 ` Stephen Berman
2019-05-12 12:36 ` Basil L. Contovounesios [this message]
2020-08-25 10:11 ` Lars Ingebrigtsen
2020-08-26 10:11 ` Stephen Berman
2020-10-11 4:06 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ef537suj.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=18475@debbugs.gnu.org \
--cc=stephen.berman@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).