From: Stephen Berman <stephen.berman@gmx.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32173@debbugs.gnu.org, Enrico Scholz <enrico.scholz@ensc.de>
Subject: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename'
Date: Sat, 21 Jul 2018 12:48:57 +0200 [thread overview]
Message-ID: <874lgs984m.fsf@gmx.net> (raw)
In-Reply-To: <83pnzhzo80.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jul 2018 22:44:31 +0300")
On Fri, 20 Jul 2018 22:44:31 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Enrico Scholz <enrico.scholz@ensc.de>
>> Date: Mon, 16 Jul 2018 15:28:29 +0200
>>
>> wdired seems to misbehave when 'wdired-use-interactive-rename' is
>> active:
[...]
> It looks like the code expects you to delete the entire original name
> and then type the new name from scratch, it doesn't expect to see part
> of the old file name unaltered.
>
> Does the patch below give good result?
>
> diff --git a/lisp/wdired.el b/lisp/wdired.el
> index bb60e77..13005cb 100644
> --- a/lisp/wdired.el
> +++ b/lisp/wdired.el
> @@ -550,7 +550,11 @@ wdired-search-and-rename
> (progn
> (setq done t)
> (let ((inhibit-read-only t))
> - (dired-move-to-filename)
> + ;; Can't use dired-move-to-filename, because editing
> + ;; the file names could have left the 'dired-filename'
> + ;; property only on part of the file name.
> + (re-search-forward directory-listing-before-filename-regexp
> + (line-end-position) t)
> (search-forward (wdired-get-filename t) nil t)
> (replace-match (file-name-nondirectory filename-ori) t t))
> (dired-do-create-files-regexp
AFAICT this patch avoids the bug and is simpler than the fix I proposed
(https://lists.gnu.org/archive/html/bug-gnu-emacs/2018-07/msg00602.html).
But with the above patch, if the user types C-g when prompted to make
the replacement, the file name is left partly or wholely without the
dired-filename text property. I'm not sure if that's a problem, that's
why in my patch I restored the property. I note the current buggy code
has the same issue.
Steve Berman
next prev parent reply other threads:[~2018-07-21 10:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 13:28 bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' Enrico Scholz
2018-07-18 16:23 ` Stephen Berman
2018-07-20 19:44 ` Eli Zaretskii
2018-07-21 10:48 ` Stephen Berman [this message]
2018-07-21 12:06 ` Eli Zaretskii
2018-07-21 12:19 ` Eli Zaretskii
2018-07-21 23:38 ` Stephen Berman
2018-07-26 7:54 ` Stephen Berman
2018-07-26 17:23 ` Eli Zaretskii
2018-07-27 7:09 ` Eli Zaretskii
2018-07-27 18:15 ` Stephen Berman
2018-07-27 20:59 ` Eli Zaretskii
2018-07-28 23:21 ` Stephen Berman
2018-08-08 10:04 ` Stephen Berman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874lgs984m.fsf@gmx.net \
--to=stephen.berman@gmx.net \
--cc=32173@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=enrico.scholz@ensc.de \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.