all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de
Subject: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename'
Date: Fri, 27 Jul 2018 10:09:25 +0300	[thread overview]
Message-ID: <83va91rw7u.fsf@gnu.org> (raw)
In-Reply-To: <878t64p3az.fsf@gmx.net> (message from Stephen Berman on Sun, 22 Jul 2018 01:38:44 +0200)

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: enrico.scholz@ensc.de,  32173@debbugs.gnu.org
> Date: Sun, 22 Jul 2018 01:38:44 +0200
> 
> > Btw, what happens in the non-interactive rename case, wrt the
> > dired-filename property?  If the renamed file is left with part of it
> > covered by that property, we may have a broader problem in wdired.el.
> 
> That's a good question (which didn't occur to me).  With
> wdired-use-interactive-rename nil (the default), a partially edited
> filename is indeed only partly covered by the dired-filename property,
> but as soon as you type C-c C-c or C-x C-s the change is saved and the
> buffer returns to dired-mode, which makes the whole file name
> propertized again.  So that's no problem.  However, there could be a
> problem before saving the change if some function looks for the
> dired-filename property -- and in fact, there is such a function:
> dired-isearch-filenames in dired-aux.el.  And indeed, you can use this
> in wdired-mode after editing file names but before saving the changes,
> and then the search will fail if the search string includes characters
> now lacking the dired-filename property.
> 
> The only way I could think of to avoid this is to restore the text
> property via after-change-functions, as in the patch below.  I'm not so
> confident that this is the best approach, but it seems to work, in that
> AFAICT it fixes the bug with non-nil wdired-use-interactive-rename and
> also handles the non-interactive case, allowing dired-isearch-filenames
> to function as expected.  Maybe there's a less heavy-handed way to get
> this, but none has occurred to me.
> 
> It was also necessary to move the invocation of
> wdired-change-to-dired-mode in wdired-finish-edit to after the
> invocation of wdired-do-renames, since calling it before meant the
> buffer was in dired-mode, which doesn't use the after change function,
> so typing C-g on being prompted to accept the change would have left a
> partially unpropertized file name.  (The invocation of
> wdired-change-to-dired-mode also has to be before the invocation of
> revert-buffer in wdired-finish-edit to avoid using wdired-revert, which
> changes to dired-mode and then back to wdired-mode.)
> 
> Finally, a consequence of moving wdired-change-to-dired-mode is that
> with typing C-g with non-nil wdired-use-interactive-rename leaves the
> buffer in wdired-mode, instead of returning to dired-mode as it
> currently does.  To keep the current behavior I wrapped an extra call to
> wdired-change-to-dired-mode in unwind-protect in
> wdired-search-and-rename.

Thanks.  I think we should install your original and safer patch on
the release branch, and this more thorough fix on master.  WDYT?





  parent reply	other threads:[~2018-07-27  7:09 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
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 [this message]
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=83va91rw7u.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=32173@debbugs.gnu.org \
    --cc=enrico.scholz@ensc.de \
    --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 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.