From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#11795: 24.1.50; wdired: C-c C-c loses marks and positions of renamed files Date: Sat, 27 Oct 2012 12:18:34 +0300 Organization: JURTA Message-ID: <87a9v85l3p.fsf@mail.jurta.org> References: <87r4t1sk9o.fsf@web.de> <87sjdhily5@ch.ristopher.com> <06AF8E7E174A4F768ADB2B901755EA3C@us.oracle.com> <87sj95ad3l.fsf@mail.jurta.org> <87vce0xah6.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1351329773 2711 80.91.229.3 (27 Oct 2012 09:22:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Oct 2012 09:22:53 +0000 (UTC) Cc: 11795@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 27 11:23:01 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TS2bc-0001py-GB for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Oct 2012 11:23:00 +0200 Original-Received: from localhost ([::1]:52610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TS2bU-0001Po-Fl for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Oct 2012 05:22:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TS2bR-0001Pi-G5 for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2012 05:22:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TS2bQ-00044E-Id for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2012 05:22:49 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TS2bQ-00044A-Et for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2012 05:22:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TS2dZ-000753-UU for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2012 05:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Oct 2012 09:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11795 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11795-submit@debbugs.gnu.org id=B11795.135132988327193 (code B ref 11795); Sat, 27 Oct 2012 09:25:01 +0000 Original-Received: (at 11795) by debbugs.gnu.org; 27 Oct 2012 09:24:43 +0000 Original-Received: from localhost ([127.0.0.1]:35463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TS2dH-00074Y-9E for submit@debbugs.gnu.org; Sat, 27 Oct 2012 05:24:43 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:45204 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TS2dE-00074P-Ry for 11795@debbugs.gnu.org; Sat, 27 Oct 2012 05:24:41 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 752BF451CD51; Sat, 27 Oct 2012 02:22:25 -0700 (PDT) In-Reply-To: <87vce0xah6.fsf@web.de> (Michael Heerdegen's message of "Wed, 24 Oct 2012 15:31:33 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66101 Archived-At: > So, introducing an new option `wdired-keep-marker-rename' would IMHO make > sense. The default value could be t, at least that's what I think would > be most intuitive. I fixed this regression by adding `wdired-keep-marker-rename'. Thanks for the suggestion. When testing it, I noticed a random behavior of `wdired-do-renames' when the marker is customized to a character. The decision what character to put depends on the position of point. When point is at the top of the Dired buffer, it uses a customized marker character. When point is at the bottom, it restores an old marker character. The problem is that `dired-remove-file' doesn't remove file entries (and neither `dired-rename-file') because files already have new renamed names in the Dired buffer. Whereas `dired-add-entry' adds duplicated file entries. Fortunately, `revert-buffer' (called at the end of `wdired-finish-edit') sorts out this mess caused by `dired-add-entry'. But in `dired-revert' it uses `dired-remember-marks' and `dired-restore-positions' to restore markers. So when duplicated file entries were added by `dired-add-entry' at the top of the Dired buffer (in front of file entries edited by WDired), it uses a customized marker character. When duplicated file entries were added at the bottom, it restores an old marker character because `dired-restore-positions' in `dired-revert' gets markers from the first duplicated file entry. Do you have an idea how to fix this problem? One way would be instead of using `dired-add-file' to change markers in the remembered variable `wdired-old-marks' and just call `dired-mark-remembered' (before `revert-buffer' in `wdired-finish-edit') with the modified list of markers for renamed files.