From unknown Mon Aug 18 11:16:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#32173 <32173@debbugs.gnu.org> To: bug#32173 <32173@debbugs.gnu.org> Subject: Status: 26.1; wdired: broken 'wdired-use-interactive-rename' Reply-To: bug#32173 <32173@debbugs.gnu.org> Date: Mon, 18 Aug 2025 18:16:40 +0000 retitle 32173 26.1; wdired: broken 'wdired-use-interactive-rename' reassign 32173 emacs submitter 32173 Enrico Scholz severity 32173 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 16 09:29:35 2018 Received: (at submit) by debbugs.gnu.org; 16 Jul 2018 13:29:35 +0000 Received: from localhost ([127.0.0.1]:42352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ff3ZH-0005QA-1k for submit@debbugs.gnu.org; Mon, 16 Jul 2018 09:29:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ff3ZC-0005Ps-Uy for submit@debbugs.gnu.org; Mon, 16 Jul 2018 09:29:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ff3Z5-0000KL-4g for submit@debbugs.gnu.org; Mon, 16 Jul 2018 09:29:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51403) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ff3Z4-0000Jy-QH for submit@debbugs.gnu.org; Mon, 16 Jul 2018 09:29:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ff3Z2-0005an-8o for bug-gnu-emacs@gnu.org; Mon, 16 Jul 2018 09:29:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ff3Yy-0000H4-Pn for bug-gnu-emacs@gnu.org; Mon, 16 Jul 2018 09:29:20 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:52216) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ff3Yx-0000G8-Nh for bug-gnu-emacs@gnu.org; Mon, 16 Jul 2018 09:29:16 -0400 Received: from mail.bigo.ensc.de ([217.251.93.44]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MZ9ey-1fKDHH2S7w-00L1N4; Mon, 16 Jul 2018 15:28:31 +0200 Received: from delenn.bigo.ensc.de (delenn.bigo.ensc.de [192.168.46.22]) by mail.bigo.ensc.de (8.14.4/8.14.4) with ESMTP id w6GDST6g016865; Mon, 16 Jul 2018 15:28:30 +0200 Received: from ensc by delenn.bigo.ensc.de with local (Exim 4.91) (envelope-from ) id 1ff3YD-0007Db-Aw; Mon, 16 Jul 2018 15:28:29 +0200 From: Enrico Scholz To: bug-gnu-emacs@gnu.org Subject: 26.1; wdired: broken 'wdired-use-interactive-rename' Date: Mon, 16 Jul 2018 15:28:29 +0200 Message-ID: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:ew3d/nwZrbHo7DplOiBExVvE4tc+K0ykmygMiOpHO9+Qz7rKNjh uTMHW+mJeY7wsI7AeuODSAUpwN6SMJOt/o1bX9u9fEgf9nC0lJC9prufXa7X1Qy0XaNQ7MG OpQJ/jhk7KsZMCNbVBVAebihYx+y497Yk/2NnfQJ03dn3/WAAqJmAUXhlGqmUuGOv5IWtcb A07kWwJmttDk1GOE6KJHg== X-UI-Out-Filterresults: notjunk:1;V01:K0:T8j1c1n+ZP4=:SBrhqlSu+2BUuYndKFToxE mOh+2sLgEjYtCUCvKtaATn02lMgSbqxUH2uaSd9N5RaF+S//YsREey0CgvuBAPBVtCCPjrT/4 pPor7fFUx/WEIN2E6hHK0uLxPgqn2rZeBdcCVPppVlGuytV61203qbF3/Hg5LAuRUhsY2CfVw kWN8V1SUfWAHjP5tOrEb1t8gVp/omzYgYCxTJ7GA9PpE2SS4WTo910LnPoCbsXQhvnn96AMNh jhPNzOFJldPDpqdTpsLvH2WUFsLcyHFVjVlNLtCAg9yM8SUj3BB4L+8t9jVxvSLZy+/jRweuk 6EM4IxiJQd+1Mg24hHQMKUo/cfZqX/+3Ls48/46OqoqN4L/KX79m4ZZxe7S2TQSsVdBTYxXP4 /YArupXWCo4Aj+v1gAn2t2tDqigsBMlND1wtdXBinivbGIa+khQk+AsayfMK2OFvVmWo7mqMR EzPleqCGTZzo+VCVm1hBcn4Yd3mFT+eKnwDUsTrJtW5UFFa/26a7aXEq39zQmEyo0J+/P4YiD 6u1jrDbvEG2wAPyuk0f1syuvtJBTeqkp5sy/DL4IBGbAsCQNghxQhFNuUd39CggH1Hf4IfBru +wR87r+0FPXIN11mnJer53+94OSX/bIaIwNo8T80BexcUEoZlWgd7k2/SG74F9cBITqxCysVm ruF6jWjqr+Hnhgl1EWA3LUn4SkA4HYa3LX3SHQw5N8cgG9g+UBQu7QlrusqYjAMI326Qpc5Ty rt/3RHOeP7l0kRhg X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hi, wdired seems to misbehave when 'wdired-use-interactive-rename' is active: 1. create scratch directory with a file mkdir /tmp/test cd /tmp/test touch foo.c 2. start emacs LC_ALL=C emacs -Q -nw 3. set option above M-: (setq wdired-use-interactive-rename t) 4. go into the folder C-x C-f /tmp/test emacs will show | /tmp/test: | total used in directory 0 available 4023272 | drwxrwxr-x. 2 ensc ensc 60 Jul 16 15:16 . | drwxrwxrwt. 18 root root 600 Jul 16 15:17 .. | -rw-rw-r--. 1 ensc ensc 0 Jul 16 14:58 foo.c 5. enter wdired mode C-x C-q 6. replace 'foo' with 'test'; e.g. test M-d 7. commit it C-c C-c ---> emacs asks | Move `c' to `test.c'? [Type yn!q or C-h] or | Move `.' to `test.c'? [Type yn!q or C-h] (seems to differ slightly when repeating step 6). Buffer content is malformed too (first two lines are merged, or whitespace between time and filename is removed). Confirming with 'y' will make the operation fail because the requested source file does not exist. Without the interactive rename, things seem to be fine. Enrico ---------------------------- In GNU Emacs 26.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 2.24.32) of 2018-05-31 built on koji-builder4.intern.sigma-chemnitz.de Windowing system distributor 'Fedora Project', version 11.0.11906000 Configured using: 'configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk --with-gpm=no --with-modules build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' LDFLAGS=-Wl,-z,relro PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 MODULES THREADS LCMS2 From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 18 12:23:24 2018 Received: (at 32173) by debbugs.gnu.org; 18 Jul 2018 16:23:24 +0000 Received: from localhost ([127.0.0.1]:47116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ffpEa-000325-84 for submit@debbugs.gnu.org; Wed, 18 Jul 2018 12:23:24 -0400 Received: from mout.gmx.net ([212.227.17.21]:57079) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ffpEX-00031q-Tz for 32173@debbugs.gnu.org; Wed, 18 Jul 2018 12:23:22 -0400 Received: from rosalinde ([178.6.211.58]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MGip3-1fsjNy0HvV-00DbQy; Wed, 18 Jul 2018 18:23:15 +0200 From: Stephen Berman To: Enrico Scholz Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> Date: Wed, 18 Jul 2018 18:23:13 +0200 In-Reply-To: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> (Enrico Scholz's message of "Mon, 16 Jul 2018 15:28:29 +0200") Message-ID: <87efg0343y.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:8NqmkbAio1TWgTf86NhpzjJX4MZvozi6v99GvTJhDAIGzYAcbHq N7qvTSoOIPEIq7z1GvQFEDioBzFCdAaE8/Xe48HCDh0ZZvFb23LOihvvH3K5GYE8nfFvz7k DEkDh8cNHSWRt9yFR2S2kkQ00arsaK7MlNg5HoHsZhs94hZeLM/FS3jRTkOqRvYLFbKxzKr QYpQW6JN8OWefgFCn2I4Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:yPcihcst5qI=:rQzob/LduqGbuWKiFPZQxn KN1lZH7qFRVlZtuJS7AkjTPM9iq/AAzVqPDFs4hLOV48rniE7IVmpoEKTtPsUfrvtLP+kF4ua eJvDZvsFHpBkwup6WoOAEhR+ENCpU4VfgWRb4BdRABHs92RqHGnjXShkMQcg1Dfkow6yY+NLz J8B+ATJ/m8oSbulhjZgLnbJn+8tVKpuixhZLknQ2FIYOE8A3eVW5RTVzSfYqaqfW3q1I4mUqF 8X+n9OIvvNkcRV/YCMJswL8TReZxUnHopPbDZ/p/zYHj1+U0GmcqxPwxtmnsHcjZoaDvNWdnF rkkD8TrPX5+GdXQ8hK8+F3aB/7E9YSv3Lr9RM/ZRBZ2nAFmHgQaORaG8TzOVF6rU49tDwg0OQ P50cAdcgYxizZGGZhLBeCqF1bPmgPTkXcOMoBnub0fyT6uYbfTwjcAKq6iNWCBWOO2QEBKgKV ac0K0kdpfFOrlkMImLJb6H2fsPNuRbhWayPCPkcg9UFZlfx15f/6M33w1uPy2dv+vsb5ho8uN DKzViALBAAOrr4lhB7jZn0XCkj+WwRD2veRiKgd2jlp51ttGPb7CHAN5sLeM6sF3R82tKoA8I 66aeCzjWH/jsxLqZDAQu/RS5jE8zi2fUIf4q3khfpHygopy+emKzkmfnDsA3/jnwl0YGd5L6Y xkwYUoSvDRFCu805gL81veRN2eur3/UAlbsQOpPi1Wpjdj4TCH2dH1b6fcRVS/dty737BXORD fZTZHrmuRW2omvSAZE7PdBATeCuYE2gF0QoFRS6bmr5m/wjC+tkLPcDZ9tJBFI+Piz2oAZBK2 DK+tVTm X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Mon, 16 Jul 2018 15:28:29 +0200 Enrico Scholz wrote: > Hi, > > wdired seems to misbehave when 'wdired-use-interactive-rename' is > active: > > 1. create scratch directory with a file > > mkdir /tmp/test > cd /tmp/test > touch foo.c > > 2. start emacs > > LC_ALL=C emacs -Q -nw > > 3. set option above > > M-: (setq wdired-use-interactive-rename t) > > 4. go into the folder > > C-x C-f /tmp/test > > emacs will show > > | /tmp/test: > | total used in directory 0 available 4023272 > | drwxrwxr-x. 2 ensc ensc 60 Jul 16 15:16 . > | drwxrwxrwt. 18 root root 600 Jul 16 15:17 .. > | -rw-rw-r--. 1 ensc ensc 0 Jul 16 14:58 foo.c > > 5. enter wdired mode > > C-x C-q > > 6. replace 'foo' with 'test'; e.g. > > test M-d > > 7. commit it > > C-c C-c > > > ---> emacs asks > > | Move `c' to `test.c'? [Type yn!q or C-h] > > or > > | Move `.' to `test.c'? [Type yn!q or C-h] > > (seems to differ slightly when repeating step 6). Buffer content is > malformed too (first two lines are merged, or whitespace between time > and filename is removed). > > > Confirming with 'y' will make the operation fail because the requested > source file does not exist. > > > Without the interactive rename, things seem to be fine. The bug is in wdired-search-and-rename (called when wdired-use-interactive-rename is non-nil) and is triggered by leaving part of the original file name unmodified (in the above case, the extension '.c' was not altered), which leaves the dired-filename text property, which dired-move-to-filename, called by wdired-search-and-rename, finds and moves point there, causing the subsequent search for the file name to fail. The patch below fixes this bug, according to my tests, but maybe I overlooked some corner cases. Can you try it and see if it works for you? Steve Berman diff --git a/lisp/wdired.el b/lisp/wdired.el index bb60e77776..968aac0149 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -543,19 +543,41 @@ wdired-search-and-rename (goto-char (point-max)) (forward-line -1) (let ((done nil) + (failed t) curr-filename) (while (and (not done) (not (bobp))) (setq curr-filename (wdired-get-filename nil t)) (if (equal curr-filename filename-ori) - (progn - (setq done t) - (let ((inhibit-read-only t)) - (dired-move-to-filename) - (search-forward (wdired-get-filename t) nil t) - (replace-match (file-name-nondirectory filename-ori) t t)) - (dired-do-create-files-regexp - (function dired-rename-file) - "Move" 1 ".*" filename-new nil t)) + (unwind-protect + (progn + (setq done t) + (let ((inhibit-read-only t)) + ;; If part of filename-ori is unmodified, + ;; dired-move-to-filename moves point there, which + ;; causes the search to fail (bug#32173). + ;; Removing the dired-filename text property + ;; prevents this (the text property is added again + ;; when renaming succeeds). + (remove-text-properties + (line-beginning-position) (line-end-position) + '(dired-filename nil)) + (dired-move-to-filename) + (search-forward (wdired-get-filename t) nil t) + (replace-match (file-name-nondirectory filename-ori) t t)) + (dired-do-create-files-regexp + (function dired-rename-file) + "Move" 1 ".*" filename-new nil t) + (setq failed nil)) + ;; If user quits before renaming succeeds, restore the + ;; dired-filename text property. + (when failed + (beginning-of-line) + (let ((beg (re-search-forward + directory-listing-before-filename-regexp + (line-end-position) t)) + (end (dired-move-to-end-of-filename)) + (inhibit-read-only t)) + (add-text-properties beg end '(dired-filename t))))) (forward-line -1)))))) ;; marks a list of files for deletion From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 20 15:44:45 2018 Received: (at 32173) by debbugs.gnu.org; 20 Jul 2018 19:44:45 +0000 Received: from localhost ([127.0.0.1]:49970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgbKX-0003fY-B3 for submit@debbugs.gnu.org; Fri, 20 Jul 2018 15:44:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgbKT-0003fJ-Hk for 32173@debbugs.gnu.org; Fri, 20 Jul 2018 15:44:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgbKK-0004xp-7P for 32173@debbugs.gnu.org; Fri, 20 Jul 2018 15:44:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgbKK-0004xh-3J; Fri, 20 Jul 2018 15:44:32 -0400 Received: from [176.228.60.248] (port=2552 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fgbKJ-0006ye-Hl; Fri, 20 Jul 2018 15:44:31 -0400 Date: Fri, 20 Jul 2018 22:44:31 +0300 Message-Id: <83pnzhzo80.fsf@gnu.org> From: Eli Zaretskii To: Enrico Scholz In-reply-to: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> (message from Enrico Scholz on Mon, 16 Jul 2018 15:28:29 +0200) Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Enrico Scholz > Date: Mon, 16 Jul 2018 15:28:29 +0200 > > wdired seems to misbehave when 'wdired-use-interactive-rename' is > active: > > 1. create scratch directory with a file > > mkdir /tmp/test > cd /tmp/test > touch foo.c > > 2. start emacs > > LC_ALL=C emacs -Q -nw > > 3. set option above > > M-: (setq wdired-use-interactive-rename t) > > 4. go into the folder > > C-x C-f /tmp/test > > emacs will show > > | /tmp/test: > | total used in directory 0 available 4023272 > | drwxrwxr-x. 2 ensc ensc 60 Jul 16 15:16 . > | drwxrwxrwt. 18 root root 600 Jul 16 15:17 .. > | -rw-rw-r--. 1 ensc ensc 0 Jul 16 14:58 foo.c > > 5. enter wdired mode > > C-x C-q > > 6. replace 'foo' with 'test'; e.g. > > test M-d > > 7. commit it > > C-c C-c > > > ---> emacs asks > > | Move `c' to `test.c'? [Type yn!q or C-h] > > or > > | Move `.' to `test.c'? [Type yn!q or C-h] > > (seems to differ slightly when repeating step 6). Buffer content is > malformed too (first two lines are merged, or whitespace between time > and filename is removed). 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 21 06:49:09 2018 Received: (at 32173) by debbugs.gnu.org; 21 Jul 2018 10:49:09 +0000 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 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 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 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> Date: Sat, 21 Jul 2018 12:48:57 +0200 In-Reply-To: <83pnzhzo80.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jul 2018 22:44:31 +0300") Message-ID: <874lgs984m.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:OyGiqdZfIvrdSiV1BuMEqaq+aU5IdjhKwTzEG2f0q/HvgCfeClM UXV76bra+DHbIn1aM1WzHBRSH537MbcWLqOcDlOQR/j7UpB8YUtqk/gjOjp7zEXriRIVB4k PuPvO3lVowicT8GVyk35YbuJhJ5KfPwOyvhsftFJiyvUEGR2fDTQZp22cP0oLjUREjZC1Ql M+HLlE5aq+Bz32DJKI9bg== X-UI-Out-Filterresults: notjunk:1;V01:K0:4nyIHdDXjdY=:uLhdrr4MHX3lY5qM9VBGXv Z4VDD5SJ0d8nhfw4h8cRxj06221govDC7m4K9RO5etEdly/MEXWEsaY7RuZzt5dh0OoV9anF+ GJVQP1+DFnvB0XPv05cWcAOXtYX+v8jfUHr9JgJ+tb6H4sT1EK6AH2L9lNA5+kHi5Se1ZAyfi DHmUmAWxuDZ9GhGy72k42jk3qS5LiFsjoYyS9IL/xPdAOjb7uG8TfFAipXsBGv3XfkQvf/YUp L/xv5ehkX+1tLTO87avBz7uYbG1lPist13hpWVFi+ozC8oydsLSqQvJBdD7nHp6YDd2BKVseu dEqOmGQruj2rU1w2Nz1K/HrXoLWpOKtJ2oHwNaDRabLGAdkDLM/24fSq6PgOqwN3Z8npwbitY m6GUSIptJ0XXEDh6qmzGksTFEGhMJEfhfmepW/yDzUFGmEc8kZX8EFhH2sfhsFkM9ojUZJ2sw QF1LT3JXX3OMkSssKVD7YB1W6TAMZofYqfwTdactKFxa8MZDsAm1J7zNRDrhn260dia5t7v8d 0UUCUvBZIJy468CypU5m8My0irOzAnKuiOKn4lbpO6J9u0OGqWH3FvhOg3fm6AxPZRLlcXUfs XrNw84mH6adCzyvrldE5wuDceTrGnQleKn0V+I5a1ay7w9S7zfESgj5fsqDbgN9HKxAyA+/Lw zz36ATJkj7lWESiMB91CwFHc1jNUwiN/uhp0oqKvo524Ezn/A9DupbIpugyL7U8j7xBHMCEfW cgPo0E4K8+0OOOWPUC4kN3rO4i/W45qNGR2vcjb7bEy5Qk5dnNghghz3r66QWtLWuPnG5mKhw /Jd1r7Y X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org, Enrico Scholz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 21 08:06:27 2018 Received: (at 32173) by debbugs.gnu.org; 21 Jul 2018 12:06:27 +0000 Received: from localhost ([127.0.0.1]:50274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgqeZ-0001Lw-DM for submit@debbugs.gnu.org; Sat, 21 Jul 2018 08:06:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60279) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgqeX-0001Lk-SI for 32173@debbugs.gnu.org; Sat, 21 Jul 2018 08:06:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgqeP-0000D9-K5 for 32173@debbugs.gnu.org; Sat, 21 Jul 2018 08:06:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgqeP-0000D3-Fj; Sat, 21 Jul 2018 08:06:17 -0400 Received: from [176.228.60.248] (port=3943 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fgqeO-0005Ub-VE; Sat, 21 Jul 2018 08:06:17 -0400 Date: Sat, 21 Jul 2018 15:06:19 +0300 Message-Id: <83va98yero.fsf@gnu.org> From: Eli Zaretskii To: Stephen Berman In-reply-to: <874lgs984m.fsf@gmx.net> (message from Stephen Berman on Sat, 21 Jul 2018 12:48:57 +0200) Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> <874lgs984m.fsf@gmx.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Stephen Berman > Cc: Enrico Scholz , 32173@debbugs.gnu.org > Date: Sat, 21 Jul 2018 12:48:57 +0200 > > 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. Right. But I think we had better did this more thoroughly, so I think your solution (which I somehow managed to miss) is better. Please wait for a few days and push to emacs-26 if no problems are reported with your patch. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 21 08:19:48 2018 Received: (at 32173) by debbugs.gnu.org; 21 Jul 2018 12:19:48 +0000 Received: from localhost ([127.0.0.1]:50284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgqrT-0001eP-RZ for submit@debbugs.gnu.org; Sat, 21 Jul 2018 08:19:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33911) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgqrR-0001eC-Hl for 32173@debbugs.gnu.org; Sat, 21 Jul 2018 08:19:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgqrL-0005VW-Cp for 32173@debbugs.gnu.org; Sat, 21 Jul 2018 08:19:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgqrG-0005UJ-BG; Sat, 21 Jul 2018 08:19:34 -0400 Received: from [176.228.60.248] (port=4747 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fgqrF-0007pB-Nq; Sat, 21 Jul 2018 08:19:34 -0400 Date: Sat, 21 Jul 2018 15:19:36 +0300 Message-Id: <83tvosye5j.fsf@gnu.org> From: Eli Zaretskii To: stephen.berman@gmx.net In-reply-to: <83va98yero.fsf@gnu.org> (message from Eli Zaretskii on Sat, 21 Jul 2018 15:06:19 +0300) Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> <874lgs984m.fsf@gmx.net> <83va98yero.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Sat, 21 Jul 2018 15:06:19 +0300 > From: Eli Zaretskii > Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de > > > 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. > > Right. But I think we had better did this more thoroughly, so I think > your solution (which I somehow managed to miss) is better. Please > wait for a few days and push to emacs-26 if no problems are reported > with your patch. 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 21 19:38:54 2018 Received: (at 32173) by debbugs.gnu.org; 21 Jul 2018 23:38:55 +0000 Received: from localhost ([127.0.0.1]:51457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fh1Sg-0004z4-2j for submit@debbugs.gnu.org; Sat, 21 Jul 2018 19:38:54 -0400 Received: from mout.gmx.net ([212.227.17.20]:38895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fh1Se-0004yq-Fl for 32173@debbugs.gnu.org; Sat, 21 Jul 2018 19:38:53 -0400 Received: from rosalinde ([178.1.59.215]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MLR30-1fgTUl39f8-000gYG; Sun, 22 Jul 2018 01:38:45 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> <874lgs984m.fsf@gmx.net> <83va98yero.fsf@gnu.org> Date: Sun, 22 Jul 2018 01:38:44 +0200 In-Reply-To: <83va98yero.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 Jul 2018 15:06:19 +0300") Message-ID: <878t64p3az.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:/BsZtr2qgLP10gFLKTJgEiSzQeVpSMwk12GCFz73hMrAGtG+5+L kDgBJWpIc3Af/L6lSD3dbgYJnLA+s1XPn0p0sUyos0JhtASQIcY+csJGbq6Te/eiSqXfTbR EzaDwSZqGIojqUNc7+/mzvAmK4SVkc2XZP/KpZaNMpGPiHq2vN3Q0UOpiHuE2w0K6g7mtd0 C1G3t4sq3kp8y2AZu2S0w== X-UI-Out-Filterresults: notjunk:1;V01:K0:VVwWp/s3vHU=:rYs1nY7gIaMZfoD/F2N+/y MnCl/F11+oxiirTISpQA1swgiZAUhl6W5iJUJr/D9fMh8P8YM+UrQR6z36gPv+RlpQWalu5kw 6Fwq4dLgumEeq7T8XlSeTgX5hcbb9ALYwUA0uCEOxbMC4SKzSslptj/4oSND4xjr5kfYk7Q3+ lrgleDeqqDtyAZubfK01cfD3LDy/IDOM+oODSVBgTgZtpwKsV16v9ATMrbc5CZRo6Kk6VCgIY vM1NPOIFBkRcxhrVU1rYtxH2xF0kN/s2CKtAvFlofY6fK81/3cf0FiHl2tzMtQ2gYp+Te+HTw n3iUp3h5P9Sca1+U2m79mtsbcyyOU8kMa0Gci7hARHevYsfhQCv5kTyW7DSBfdDi24euoYtK4 +/+iNXDPMQ9rlPsEWLOJcCwSii4s37crFXZByLF0vEU4iwbSE0j7AqupFq7c3e2NPeEtIjaFK BWV+6u7PO/MRf17XtbwbpUmxcU/cIvAaQ4HKSVtfyUYLN10Hr1pgmLgmPmsPneLoK9iqyussr 9GMk9licTKJUquWRiHbRJDu5jNLygpgX72lpfQgdmKNyQO47DTPpfCi6SPf4+0I1IQYDUoKhE k0V5iqq4/APRl2bcoim8wP4lmeOsw51A1asdlbPb2RNyjv5C1dDvVnPI2VA6bs6vo65Ef5b7e yo+ohrqhcDk5LYAYR+74fZI0KW+h56r9j6T/79X9bO1YxHgiVIBJl/fQq2PwL1zciNXXRD98O 0x3ohFbZ8eKpGqPAB4LAH71z9igdNzyfi3gp8OBiXwRK6gJMWwrB9VInN3MP1oqCCD2uZsNye aVJSpVf X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Sat, 21 Jul 2018 15:06:19 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: Enrico Scholz , 32173@debbugs.gnu.org >> Date: Sat, 21 Jul 2018 12:48:57 +0200 >> >> 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. > > Right. But I think we had better did this more thoroughly, so I think > your solution (which I somehow managed to miss) is better. Please > wait for a few days and push to emacs-26 if no problems are reported > with your patch. Thanks, but... On Sat, 21 Jul 2018 15:19:36 +0300 Eli Zaretskii wrote: > 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. Steve Berman diff --git a/lisp/wdired.el b/lisp/wdired.el index bb60e77776..63202bbed9 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -255,6 +255,7 @@ wdired-change-to-wdired-mode (setq buffer-read-only nil) (dired-unadvertise default-directory) (add-hook 'kill-buffer-hook 'wdired-check-kill-buffer nil t) + (add-hook 'after-change-functions 'wdired--restore-dired-filename-prop nil t) (setq major-mode 'wdired-mode) (setq mode-name "Editable Dired") (setq revert-buffer-function 'wdired-revert) @@ -363,6 +364,7 @@ wdired-change-to-dired-mode (setq mode-name "Dired") (dired-advertise) (remove-hook 'kill-buffer-hook 'wdired-check-kill-buffer t) + (remove-hook 'after-change-functions 'wdired--restore-dired-filename-prop t) (set (make-local-variable 'revert-buffer-function) 'dired-revert)) @@ -381,7 +383,6 @@ wdired-abort-changes (defun wdired-finish-edit () "Actually rename files based on your editing in the Dired buffer." (interactive) - (wdired-change-to-dired-mode) (let ((changes nil) (errors 0) files-deleted @@ -423,6 +424,7 @@ wdired-finish-edit (forward-line -1))) (when files-renamed (setq errors (+ errors (wdired-do-renames files-renamed)))) + (wdired-change-to-dired-mode) (if changes (progn ;; If we are displaying a single file (rather than the @@ -543,19 +545,23 @@ wdired-search-and-rename (goto-char (point-max)) (forward-line -1) (let ((done nil) + (failed t) curr-filename) (while (and (not done) (not (bobp))) (setq curr-filename (wdired-get-filename nil t)) (if (equal curr-filename filename-ori) - (progn - (setq done t) - (let ((inhibit-read-only t)) - (dired-move-to-filename) - (search-forward (wdired-get-filename t) nil t) - (replace-match (file-name-nondirectory filename-ori) t t)) - (dired-do-create-files-regexp - (function dired-rename-file) - "Move" 1 ".*" filename-new nil t)) + (unwind-protect + (progn + (setq done t) + (let ((inhibit-read-only t)) + (dired-move-to-filename) + (search-forward (wdired-get-filename t) nil t) + (replace-match (file-name-nondirectory filename-ori) t t)) + (dired-do-create-files-regexp + (function dired-rename-file) + "Move" 1 ".*" filename-new nil t) + (setq failed nil)) + (when failed (wdired-change-to-dired-mode))) (forward-line -1)))))) ;; marks a list of files for deletion @@ -586,6 +592,22 @@ wdired-check-kill-buffer (not (y-or-n-p "Buffer changed. Discard changes and kill buffer? "))) (error "Error"))) +;; Added to after-change-functions in wdired-change-to-wdired-mode to +;; ensure that, on editing a file name, new characters get the +;; dired-filename text property, which allows functions that look for +;; this property (e.g. dired-isearch-filenames) to work in wdired-mode +;; and also avoids an error with non-nil wdired-use-interactive-rename +;; (bug#32173). +(defun wdired--restore-dired-filename-prop (beg end _len) + (save-match-data + (save-excursion + (beginning-of-line) + (when (re-search-forward directory-listing-before-filename-regexp + (line-end-position) t) + (setq beg (point) + end (line-end-position)) + (put-text-property beg end 'dired-filename t))))) + (defun wdired-next-line (arg) "Move down lines then position at filename or the current column. See `wdired-use-dired-vertical-movement'. Optional prefix ARG From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 26 03:54:25 2018 Received: (at 32173) by debbugs.gnu.org; 26 Jul 2018 07:54:25 +0000 Received: from localhost ([127.0.0.1]:58127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fib6P-0002pw-HK for submit@debbugs.gnu.org; Thu, 26 Jul 2018 03:54:25 -0400 Received: from mout.gmx.net ([212.227.17.20]:51009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fib6L-0002pd-9N for 32173@debbugs.gnu.org; Thu, 26 Jul 2018 03:54:21 -0400 Received: from rosalinde ([188.101.28.113]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LlGoc-1gJZoI3eGU-00b7Jj; Thu, 26 Jul 2018 09:54:13 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> <874lgs984m.fsf@gmx.net> <83va98yero.fsf@gnu.org> <878t64p3az.fsf@gmx.net> Date: Thu, 26 Jul 2018 09:54:10 +0200 Message-ID: <87fu068mal.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:15MRfyXNEY/lF1R7fh7Z864UA2rMwt628J0n4rDhEN9DtsHFdFQ 5qhFrgsht2Ko6k412Ln/J2JoVukwJ6j71YD+BOUmN6Sz9aCqNEiBYOp+yqOKGNC6xbdre10 H5mTN6rPYkxDLnIbvbS47UtlcI5werqpX+POj8NCj/La9tNZHlMNmAgT42TtkWUNnfgYjhV GAt8eqX1RXQYX/FXyw0BQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:5hwK+xwu7Ug=:1r2vAWOkUaYBOOq/Uk9wEV aPEW0mB7PRZr/pvaYxuwfvU2X3zg9PC7tEGylLLU9of7M/fitI67IqLugryhG/EhkGq4VP7Ee uYyim7lsu3am/MUqF1gYYspeAhU5r1yiLiH7MD2M1SeXTdPIaiU3I9i1wRYoEu35XfTXhseeg RJa8bxcNk6EpTwuG/fIQ4BIQmzXEF8n0/PlMnszCDdBqA1fOE28CoN3W5B8nZzVv1WJXGpFPm 8PlW3nmnnaOOihikTwWCTjyluo1gP3e11CZsCZ4zsjr9Sy8cBrK4vOhenker31ONoQOMgGzsN JAhs9BBeMLTl2gM3ypJAn5P4K80Lyykg+JsMHLQZST1QxnMpxk3iSVsoKpShTXehT6vKqdKUF N/H0es5fNSRMefT0O9j15mSgbtr0+X7KcrBo8WThlkZy/3wFY7i9kgRC/k5+fMJ7M25WbAw0T orS/p/74nV7VC5Sgo/rygoVqXrivOfIbJRo2qbRZHTMMstOtzITgNBJxGt9aFr7Q8osTrt+SV GzYr4c0wQyiBdP4UL93pMQZ2H/joBHOyvgAanSDEYBYo0xgTctbbHpR/PQvbS+4ayrVc0gLur akEnRZEhcXf8oauCbRG3Lq7yutvkMm0dGewn6oqtAoFdM/lCI0frLJTGvJbGllK8LhguQehQq Jav9Wd0CCgR5PcnSpLk95GcXwJwGBNDggtWn1jXrJpYIiB4nJRTJmlHzBuCpf8ufFUgNZJTxE i0y3vBIt1fA6uBZiJMXxTuACKEk7Wzf+tEuqESJyRuYD5DSaKBzlIe1GrqjgXTuJ2q/6PGtC5 uf3szc+ X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Sun, 22 Jul 2018 01:38:44 +0200 Stephen Berman wrote: > On Sat, 21 Jul 2018 15:06:19 +0300 Eli Zaretskii wrote: > >>> From: Stephen Berman >>> Cc: Enrico Scholz , 32173@debbugs.gnu.org >>> Date: Sat, 21 Jul 2018 12:48:57 +0200 >>> >>> 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. >> >> Right. But I think we had better did this more thoroughly, so I think >> your solution (which I somehow managed to miss) is better. Please >> wait for a few days and push to emacs-26 if no problems are reported >> with your patch. > > Thanks, but... > > On Sat, 21 Jul 2018 15:19:36 +0300 Eli Zaretskii wrote: > >> 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. [...] Just pinging in case this has fallen under your radar. No sweat if you haven't had time to review it or are waiting for a reaction from the OP. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 26 13:23:44 2018 Received: (at 32173) by debbugs.gnu.org; 26 Jul 2018 17:23:44 +0000 Received: from localhost ([127.0.0.1]:59293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fijzM-0006C8-KV for submit@debbugs.gnu.org; Thu, 26 Jul 2018 13:23:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fijzK-0006Bv-6M for 32173@debbugs.gnu.org; Thu, 26 Jul 2018 13:23:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fijzA-0001VY-4Q for 32173@debbugs.gnu.org; Thu, 26 Jul 2018 13:23:37 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fijz9-0001VR-W4; Thu, 26 Jul 2018 13:23:32 -0400 Received: from [176.228.60.248] (port=4041 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fijz9-000652-Cx; Thu, 26 Jul 2018 13:23:31 -0400 Date: Thu, 26 Jul 2018 20:23:30 +0300 Message-Id: <83lg9xud0t.fsf@gnu.org> From: Eli Zaretskii To: Stephen Berman In-reply-to: <87fu068mal.fsf@gmx.net> (message from Stephen Berman on Thu, 26 Jul 2018 09:54:10 +0200) Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> <874lgs984m.fsf@gmx.net> <83va98yero.fsf@gnu.org> <878t64p3az.fsf@gmx.net> <87fu068mal.fsf@gmx.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Stephen Berman > Cc: enrico.scholz@ensc.de, 32173@debbugs.gnu.org > Date: Thu, 26 Jul 2018 09:54:10 +0200 > > Just pinging in case this has fallen under your radar. Don't worry, it didn't. It's been a busy week... From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 27 03:09:37 2018 Received: (at 32173) by debbugs.gnu.org; 27 Jul 2018 07:09:37 +0000 Received: from localhost ([127.0.0.1]:59495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fiwsb-0000iI-Ao for submit@debbugs.gnu.org; Fri, 27 Jul 2018 03:09:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fiwsZ-0000i6-GQ for 32173@debbugs.gnu.org; Fri, 27 Jul 2018 03:09:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fiwsQ-0008SO-Et for 32173@debbugs.gnu.org; Fri, 27 Jul 2018 03:09:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fiwsQ-0008SB-AB; Fri, 27 Jul 2018 03:09:26 -0400 Received: from [176.228.60.248] (port=3127 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fiwsP-0004dn-HO; Fri, 27 Jul 2018 03:09:26 -0400 Date: Fri, 27 Jul 2018 10:09:25 +0300 Message-Id: <83va91rw7u.fsf@gnu.org> From: Eli Zaretskii To: Stephen Berman In-reply-to: <878t64p3az.fsf@gmx.net> (message from Stephen Berman on Sun, 22 Jul 2018 01:38:44 +0200) Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> <874lgs984m.fsf@gmx.net> <83va98yero.fsf@gnu.org> <878t64p3az.fsf@gmx.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Stephen Berman > 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? From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 27 14:15:51 2018 Received: (at 32173) by debbugs.gnu.org; 27 Jul 2018 18:15:51 +0000 Received: from localhost ([127.0.0.1]:60579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fj7HL-0004F1-Gn for submit@debbugs.gnu.org; Fri, 27 Jul 2018 14:15:51 -0400 Received: from mout.gmx.net ([212.227.17.22]:57587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fj7HJ-0004En-1k for 32173@debbugs.gnu.org; Fri, 27 Jul 2018 14:15:49 -0400 Received: from rosalinde ([188.101.19.39]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MBrCt-1fsA6E2TeJ-00ArLn; Fri, 27 Jul 2018 20:15:41 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> <874lgs984m.fsf@gmx.net> <83va98yero.fsf@gnu.org> <878t64p3az.fsf@gmx.net> <83va91rw7u.fsf@gnu.org> Date: Fri, 27 Jul 2018 20:15:38 +0200 In-Reply-To: <83va91rw7u.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 27 Jul 2018 10:09:25 +0300") Message-ID: <87zhycmto5.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:1NyUqpQdve51XtcQ0fRZAhfzeVzATsTD+Si7uv5tvGA+yUCkNnm nalA/f/NRDf6jARmEO562YDI/r+soABZg/VBtbGrVeE3GAr0b0l1MCAtl8E2H8f/wEZGN8Q Fbz2UG52IAPuCxMsP/esiQSjPZepwx7vstpE5ns1oR+fUL5brXRvpMxfZUM7T1wrhXFv9XA TWIrtk6fhOj4G9BzbnkkA== X-UI-Out-Filterresults: notjunk:1;V01:K0:Os3V+AX7i4I=:+LBnrja1NZGRWf3Xhp4wlq tFN18OJPo1xzIOUrHazgbYM1KOrfCIRK1m4dDCXC2yp7utvWjau1L7tfShyVlDT8ZLRvOZXN5 yQqueq8mAU04v767LvlgczIpHNLyi52WP+qzzxQ7OZOU1uWoqgW8s5IsMjcag2N+Y7xOMZO9f sJTfyvgJgmbfmzK/6wVpGuoSUnDOSjXgvXIgEDgYTlltG7aB/hynj4XCrrEDyyZnIdPfBA9oU F29geHsccoBBKLXh5e4VEjvoPHbEzYE1k3SxygX89OBwI0mKzqFtBPqhfO2kzg30XSZ8XNMgd 3i+UpxxkO9oWS/nEMN9sFfCieOc54j97zdaqr2avll7PO1gA7gOGp/nOUYocRaaG+uni/IM5f yjemTHbwmUtERt8BYh5IIwtQZBqHTGBNgJyZwLxt8GisYT0RSPFfresT4BdpkrxgjpuFyXa4P +zHLCVf4KckN3+2l3QJjlEqcaeBKZFn/lhm9F268yMePn5Io1S80/yAQuLzvgh7Spazu57nFj Vkl3p7ocNrDC2jYQ1ix5o8tGflszsahYl4qzPuwpjKY2zvi107se17EkzFsj47uWTzIF4haNy QBuNmRhihGpYDSEp2RyY9IBgqMznEVxj3w9aif/xKdVrVCTfoT72Myhw92JHnJxcpEgK3H52L Cw4ROOi7IDXLRcGzzNoPHvbp/14JOOlvd5pfMSgLzts0BzTzs4oZPCHkdmgixCxLrmmm+9p+Y JfvzuSv6pM2FVtftCJASrHr+PAvRvOK7KI2creFgF7TESiReKz/+haHampv2R11aeRypL3zEl KDhueCQ X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Fri, 27 Jul 2018 10:09:25 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> 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. [...] > Thanks. I think we should install your original and safer patch on > the release branch, and this more thorough fix on master. WDYT? Sounds reasonable. Should we give the OP a bit longer to react or should I just go ahead and commit the fixes (in any case, I may not be able to until tomorrow or Sunday)? I also wrote three tests, two for the bug with non-nil wdired-use-interactive-rename, one where the edit is finished and one where it's aborted, and one test for unfinished edits (it might be nice to have a variant of the latter that uses dired-isearch-filenames, but I don't see any straightforward way to emulate isearch in the test environment). The first two tests are suitable for both fixes, but the third test only succeeds with the fix intended for master, so I use the :expected-result keyword in the test definition. But should I install the test file on each branch as part of the commit with the respective fix (which won't be merged from release to master), or should I make a separate commit of the test file just to the release branch and let it be merged to master? Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 27 16:59:29 2018 Received: (at 32173) by debbugs.gnu.org; 27 Jul 2018 20:59:29 +0000 Received: from localhost ([127.0.0.1]:60612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fj9ph-0007zu-C9 for submit@debbugs.gnu.org; Fri, 27 Jul 2018 16:59:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fj9pf-0007zh-ME for 32173@debbugs.gnu.org; Fri, 27 Jul 2018 16:59:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fj9pX-0008DH-Bh for 32173@debbugs.gnu.org; Fri, 27 Jul 2018 16:59:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fj9pX-0008D5-7C; Fri, 27 Jul 2018 16:59:19 -0400 Received: from [176.228.60.248] (port=2440 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fj9pW-0008TC-L9; Fri, 27 Jul 2018 16:59:19 -0400 Date: Fri, 27 Jul 2018 23:59:19 +0300 Message-Id: <8336w4s8d4.fsf@gnu.org> From: Eli Zaretskii To: Stephen Berman In-reply-to: <87zhycmto5.fsf@gmx.net> (message from Stephen Berman on Fri, 27 Jul 2018 20:15:38 +0200) Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> <874lgs984m.fsf@gmx.net> <83va98yero.fsf@gnu.org> <878t64p3az.fsf@gmx.net> <83va91rw7u.fsf@gnu.org> <87zhycmto5.fsf@gmx.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Stephen Berman > Cc: enrico.scholz@ensc.de, 32173@debbugs.gnu.org > Date: Fri, 27 Jul 2018 20:15:38 +0200 > > > Thanks. I think we should install your original and safer patch on > > the release branch, and this more thorough fix on master. WDYT? > > Sounds reasonable. Should we give the OP a bit longer to react or > should I just go ahead and commit the fixes (in any case, I may not be > able to until tomorrow or Sunday)? I think by then we will have waited long enough. > I also wrote three tests, two for the bug with non-nil > wdired-use-interactive-rename, one where the edit is finished and one > where it's aborted, and one test for unfinished edits (it might be nice > to have a variant of the latter that uses dired-isearch-filenames, but I > don't see any straightforward way to emulate isearch in the test > environment). The first two tests are suitable for both fixes, but the > third test only succeeds with the fix intended for master, so I use the > :expected-result keyword in the test definition. But should I install > the test file on each branch as part of the commit with the respective > fix (which won't be merged from release to master), or should I make a > separate commit of the test file just to the release branch and let it > be merged to master? You can commit the tests to the emacs-26 branch and let it be merged. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 28 19:21:36 2018 Received: (at 32173) by debbugs.gnu.org; 28 Jul 2018 23:21:36 +0000 Received: from localhost ([127.0.0.1]:33150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjYWm-0003r6-Dn for submit@debbugs.gnu.org; Sat, 28 Jul 2018 19:21:36 -0400 Received: from mout.gmx.net ([212.227.17.20]:60615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjYWk-0003qt-GP for 32173@debbugs.gnu.org; Sat, 28 Jul 2018 19:21:35 -0400 Received: from rosalinde ([188.109.196.87]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MXqV1-1fVxq42liZ-00Wmu4; Sun, 29 Jul 2018 01:21:27 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> <874lgs984m.fsf@gmx.net> <83va98yero.fsf@gnu.org> <878t64p3az.fsf@gmx.net> <83va91rw7u.fsf@gnu.org> <87zhycmto5.fsf@gmx.net> <8336w4s8d4.fsf@gnu.org> Date: Sun, 29 Jul 2018 01:21:25 +0200 In-Reply-To: <8336w4s8d4.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 27 Jul 2018 23:59:19 +0300") Message-ID: <87fu0354lm.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:0MhY1CrkhWvzdU+hzYSTCvrOjaCU34Q1nS7aBYTVg0wa/R+lJum mLGFhBYENDOzNA5CdLjKEbLi686oOMhhX3wNtrl7zMb5xfMbCWWocFi/ETqVmQWUb8DPN5u Mj0insjgIK51PSGvWJxnONS19MWnpWfgeNzZKs4KGxiKoDOyZ08xtsQOEd9EXr5cizh4lsj zCTEffyMEq++FI73GPjTQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:8vPFmSZBs3M=:n+Km1fYJZ5oi1RktF+m0KS 9kiHmFNtIWVc7MxYsswG32msliQg0cW4dpfv3AL2m5n+VrLyXdBCYYcTzFl0tHAxUcRMZBQSB s9p488i6r9YnMRbt/11TTk1gwPsu5Vw1JBy6VAPfREH13xNuH/41dLESUlXeMtHQP90Y4n0zS 1U2EZC/RaIlEhYhUFdgtJCG9JC4AMm43pEkwm5rAMXYIUUtzXpAYp/Xw6Yj9s4jJChJ6NJlAT kxcv26KwSJER7lLPPuT76gOOsWFwHvD6EPUyjL6XNB4HcSJjPjKkteqf1py7ZOm9dlkCvxwY/ FmI0InabkRX89tXeYfffAtVvvDp0C3rw6gK1zw4DYnbDvQSedHzmpBI1x0g1D8x4el7O2iEGR +8XBk8ZgUnm0PAkVZCFBy0lImHkqUPCiqvrKTtK8QLbwsQJyem+BcWgC8Iv+lHP9eVyOqc3nf Ale6oun4343CVDOeC9n9Xj8HIphLaMGLY8+k3lMYXUkcc0hoKWi6ui13APU7tjDvzKz9byroU 9Q9kqrKg84VG4NbKNgrUP25Y672qGwPJWQ6TtmdpJbMW03oQVb8lCY+KslHakVM0v52I7jD2B LC6s6AEXCcKyXcyZuOUGppIGPIfmih6j4KH6JIBF0prlmmrVSd7Vpimvy/6mwilg1s9ge0Dro szt3KKXdNUVo4Q58IhGRL44HXyte/mwiG02yuDeGX9kwTGQE3Daa/lDQtvqiDwJ5soXie7Aho jWrbyG+jTFvdM8t3/8tCPFy5WSyXM60MScQGCTtq67huZt4Gl7mR6sEhdp5Z9FbfFJ+QkW5S4 7jVqJcr X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32173 Cc: 32173@debbugs.gnu.org, enrico.scholz@ensc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Fri, 27 Jul 2018 23:59:19 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: enrico.scholz@ensc.de, 32173@debbugs.gnu.org >> Date: Fri, 27 Jul 2018 20:15:38 +0200 >> >> > Thanks. I think we should install your original and safer patch on >> > the release branch, and this more thorough fix on master. WDYT? >> >> Sounds reasonable. Should we give the OP a bit longer to react or >> should I just go ahead and commit the fixes (in any case, I may not be >> able to until tomorrow or Sunday)? > > I think by then we will have waited long enough. > >> I also wrote three tests, two for the bug with non-nil >> wdired-use-interactive-rename, one where the edit is finished and one >> where it's aborted, and one test for unfinished edits (it might be nice >> to have a variant of the latter that uses dired-isearch-filenames, but I >> don't see any straightforward way to emulate isearch in the test >> environment). The first two tests are suitable for both fixes, but the >> third test only succeeds with the fix intended for master, so I use the >> :expected-result keyword in the test definition. But should I install >> the test file on each branch as part of the commit with the respective >> fix (which won't be merged from release to master), or should I make a >> separate commit of the test file just to the release branch and let it >> be merged to master? > > You can commit the tests to the emacs-26 branch and let it be merged. > > Thanks. I committed the fixes and the tests. I'll wait another couple of days to see if the OP responds, and then close the bug. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 08 06:04:37 2018 Received: (at 32173-done) by debbugs.gnu.org; 8 Aug 2018 10:04:37 +0000 Received: from localhost ([127.0.0.1]:44203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fnLKX-000241-90 for submit@debbugs.gnu.org; Wed, 08 Aug 2018 06:04:37 -0400 Received: from mout.gmx.net ([212.227.17.22]:35865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fnLKV-00023m-U1 for 32173-done@debbugs.gnu.org; Wed, 08 Aug 2018 06:04:36 -0400 Received: from rosalinde ([178.1.120.74]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LxMgg-1fxeJ42h5e-016t4V; Wed, 08 Aug 2018 12:04:28 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#32173: 26.1; wdired: broken 'wdired-use-interactive-rename' References: <87zhyrfgxu.fsf@delenn.bigo.ensc.de> <83pnzhzo80.fsf@gnu.org> <874lgs984m.fsf@gmx.net> <83va98yero.fsf@gnu.org> <878t64p3az.fsf@gmx.net> <83va91rw7u.fsf@gnu.org> <87zhycmto5.fsf@gmx.net> <8336w4s8d4.fsf@gnu.org> <87fu0354lm.fsf@gmx.net> Date: Wed, 08 Aug 2018 12:04:26 +0200 In-Reply-To: <87fu0354lm.fsf@gmx.net> (Stephen Berman's message of "Sun, 29 Jul 2018 01:21:25 +0200") Message-ID: <87pnytdvit.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:LDw7Tco5GHTTt/YvhFfvBoFB0cJocTTIKILJU/G+pYyXt/MA6xe xg8Dm5jv/Qb0vc22s+NHvgr0mViMn8C2R/tqyHc1z6ID2n++zqcn1q9jv4IbtlhMH7s+qFl Sk7mFtLYUWjOxh0nTmBEFZBJdTVOfZeTeZB/JJw43r8TzrSCIbqdUqPsml+xF1ZyCpZrF/I BN2pu0yBmqtSfUn6cjROg== X-UI-Out-Filterresults: notjunk:1;V01:K0:PjeX0PZR3G8=:6990lFsG0NLSP9csRsybts 7T1VKOlSGXEdmCcr+KcK/ma7vO4cLz8qaxuL6nrJyNx33eDaxmdEutbVQGBrcmgdAZMCiiId3 novhyRLOKIJ72McwJDmvTty8Q/9lZAkMS2a7/81j/maRkhG/HHj4zUxUeF/IVNFhCuSvZ3dKN CRjzmuLpeLORpbOgG/MJQZ0RIusqqoF9fqbXg8xfHCynpEo3/qpgEnKsigDt1JsJg2i2siHCn vOkbAEJ/Ypk5SxUaj5J2LUNLcVTcDkJ/RWWjQdlIKhL7AItGdmJuEsqRHaZJWjUp+Tknf8EDR 4MCxYOaEQlVcYxGDXPSdJugm/GeyEJjGEayjiZaPyjs/jiG/nUC4i82xfdsD2nZtz/3LgmSTS QGPIL+QIl26oI0B9Uc3wFD3KHU1hUEYnB4gkWHKTubWABVu1oQ4p+M5FZsTuzmDlfMTJ8PAB9 ucGdUsCFHfF4rhU1vccK48bkGazArYNpcslHeu8sc6f5qkqLrLN1C7/0RIeHI23WneeCuYL2T G73SLfhDphyIrV86Ap1pUaDcGbW+th+w8f/+f+oGj8oEXa6oAk2U90uGkYc0A4cgiNtiMXg/V LtIO3fLLs1C0fQ6w6lCmhZ4dBvjuqb87rIhAa0cqvkWdOcCO9NWQZ6oxYAhwt9wCB3oC5rWMr O/BuWn4grJnsHQSpPaQDrj00YkPQKQ7SFex9iJqFZQB8AWiBL18mAdn2JPbnWmfxKH/0TLB7Z CnOx90rIKwA7mqkU2NNDobKhc4Xir3I7nKR2y4q+qq4Hw6O1E+z1WTX8GmhX/Pu6ygFN7yugV IvRTDEt X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 32173-done Cc: 32173-done@debbugs.gnu.org, enrico.scholz@ensc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) On Sun, 29 Jul 2018 01:21:25 +0200 Stephen Berman wrote: > On Fri, 27 Jul 2018 23:59:19 +0300 Eli Zaretskii wrote: > >>> From: Stephen Berman >>> Cc: enrico.scholz@ensc.de, 32173@debbugs.gnu.org >>> Date: Fri, 27 Jul 2018 20:15:38 +0200 >>> >>> > Thanks. I think we should install your original and safer patch on >>> > the release branch, and this more thorough fix on master. WDYT? >>> >>> Sounds reasonable. Should we give the OP a bit longer to react or >>> should I just go ahead and commit the fixes (in any case, I may not be >>> able to until tomorrow or Sunday)? >> >> I think by then we will have waited long enough. >> >>> I also wrote three tests, two for the bug with non-nil >>> wdired-use-interactive-rename, one where the edit is finished and one >>> where it's aborted, and one test for unfinished edits (it might be nice >>> to have a variant of the latter that uses dired-isearch-filenames, but I >>> don't see any straightforward way to emulate isearch in the test >>> environment). The first two tests are suitable for both fixes, but the >>> third test only succeeds with the fix intended for master, so I use the >>> :expected-result keyword in the test definition. But should I install >>> the test file on each branch as part of the commit with the respective >>> fix (which won't be merged from release to master), or should I make a >>> separate commit of the test file just to the release branch and let it >>> be merged to master? >> >> You can commit the tests to the emacs-26 branch and let it be merged. >> >> Thanks. > > I committed the fixes and the tests. I'll wait another couple of days > to see if the OP responds, and then close the bug. Done (better later than never). Steve Berman From unknown Mon Aug 18 11:16:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 05 Sep 2018 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator