From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' Date: Sat, 21 Jul 2018 12:48:57 +0200 Message-ID: <874lgs984m.fsf@gmx.net> References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1532170090 8137 195.159.176.226 (21 Jul 2018 10:48:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2018 10:48:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 32173@debbugs.gnu.org, Enrico Scholz To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 21 12:48:06 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 1fgpQj-00021A-1X for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jul 2018 12:48:05 +0200 Original-Received: from localhost ([::1]:51531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgpSp-0005DK-Q4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jul 2018 06:50:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgpSi-0005D4-Cm for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 06:50:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgpSd-0005WQ-0p for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 06:50:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45231) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fgpSc-0005WJ-SV for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 06:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fgpSc-00063e-FG for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 06:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jul 2018 10:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32173 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32173-submit@debbugs.gnu.org id=B32173.153217014923216 (code B ref 32173); Sat, 21 Jul 2018 10:50:02 +0000 Original-Received: (at 32173) by debbugs.gnu.org; 21 Jul 2018 10:49:09 +0000 Original-Received: from localhost ([127.0.0.1]:50249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgpRl-00062O-8U for submit@debbugs.gnu.org; Sat, 21 Jul 2018 06:49:09 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:45537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgpRj-00062B-L4 for 32173@debbugs.gnu.org; Sat, 21 Jul 2018 06:49:08 -0400 Original-Received: from rosalinde ([178.1.59.215]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lkjuq-1gHG7r1Rfo-00aX8b; Sat, 21 Jul 2018 12:48:59 +0200 In-Reply-To: <83pnzhzo80.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jul 2018 22:44:31 +0300") X-Provags-ID: V03:K1:OyGiqdZfIvrdSiV1BuMEq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bugs.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:148768 Archived-At: On Fri, 20 Jul 2018 22:44:31 +0300 Eli Zaretskii wrote: >> From: Enrico Scholz >> 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