From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christopher Schmidt Newsgroups: gmane.emacs.bugs Subject: bug#11795: 24.1.50; wdired: C-c C-c loses marks and positions of renamed files Date: Wed, 27 Jun 2012 15:47:18 +0100 (BST) Message-ID: <871ul0bymm@ch.ristopher.com> References: <87r4t1sk9o.fsf@web.de> <87sjdhily5@ch.ristopher.com> <06AF8E7E174A4F768ADB2B901755EA3C@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1340808493 17954 80.91.229.3 (27 Jun 2012 14:48:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jun 2012 14:48:13 +0000 (UTC) To: 11795@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 27 16:48:10 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 1SjtXM-00067z-1B for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Jun 2012 16:48:08 +0200 Original-Received: from localhost ([::1]:45120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjtXM-0007w6-1d for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Jun 2012 10:48:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjtXF-0007lB-4K for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:48:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SjtXA-0000Lb-6l for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:48:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjtXA-0000LO-0r for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:47:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Sjtb8-0000EM-34 for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christopher Schmidt Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Jun 2012 14:52: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: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1340808717876 (code B ref -1); Wed, 27 Jun 2012 14:52:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jun 2012 14:51:57 +0000 Original-Received: from localhost ([127.0.0.1]:60468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sjtb2-0000E5-QE for submit@debbugs.gnu.org; Wed, 27 Jun 2012 10:51:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42246) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sjtb0-0000Dy-OL for submit@debbugs.gnu.org; Wed, 27 Jun 2012 10:51:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SjtWs-0000Fj-3N for submit@debbugs.gnu.org; Wed, 27 Jun 2012 10:47:47 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:53341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjtWr-0000Fc-Te for submit@debbugs.gnu.org; Wed, 27 Jun 2012 10:47:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjtWn-0007DC-6u for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:47:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SjtWd-0000BS-5E for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:47:32 -0400 Original-Received: from ristopher.com ([146.185.21.93]:40302 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjtWc-0000Al-O0 for bug-gnu-emacs@gnu.org; Wed, 27 Jun 2012 10:47:23 -0400 Original-Received: by saturn.ch.ristopher.com (Postfix, from userid 0) id D447620B28; Wed, 27 Jun 2012 15:47:18 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ch.ristopher.com; s=mail; t=1340808438; bh=zhOzo6ueR3uSasU481VMisIXafMFOjpZt/z4ufiV1mU=; h=From:To:Subject:In-Reply-To:References:Message-ID:MIME-Version: Content-Type:Date; b=YVifjev6pReW9nX59maf1jZrqKeoB/IOW2rFSmovSpL7AVwXLYAVFq23XoXykk9B0 YDLqphwnbYJURKeBeaiPIGVXj8UCCaza/5iekylGglM1qReXEVwmvX373DnOd76MEv ZyFVyOPcQhe+iY6erspRTS249pPckEWwsF1dnE8w= In-Reply-To: <06AF8E7E174A4F768ADB2B901755EA3C@us.oracle.com> (Drew Adams's message of "Wed, 27 Jun 2012 07:20:13 -0700") Mail-Followup-To: bug-gnu-emacs@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:61328 Archived-At: --=-=-= Content-Type: text/plain "Drew Adams" writes: >> This patch for wdired.el fixes the problem here (GNU Emacs 24.1.1). > > But shouldn't Wdired respect the user's setting of option > `dired-keep-marker-rename'? IOW, shouldn't users be able to control > whether exiting wdired removes marks? Right. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=wdired-finish-edit-remember-marks.diff diff --git a/wdired.el b/wdired-fixed.el index fe5b4ef..c5956c5 100644 --- a/wdired.el +++ b/wdired-fixed.el @@ -351,6 +351,7 @@ non-nil means return old filename." (wdired-change-to-dired-mode) (let ((changes nil) (errors 0) + (marks (dired-remember-marks (point-min) (point-max))) files-deleted files-renamed some-file-names-unchanged @@ -376,6 +377,12 @@ non-nil means return old filename." (setq changes t) (if (not file-new) ;empty filename! (push file-old files-deleted) + (when dired-keep-marker-rename + (push (cons (substitute-in-file-name file-new) + (if (integerp dired-keep-marker-rename) + dired-keep-marker-rename + (cdr (assoc file-old marks)))) + marks)) (push (cons file-old (substitute-in-file-name file-new)) files-renamed)))) (forward-line -1))) @@ -393,7 +400,9 @@ non-nil means return old filename." (= (length files-renamed) 1)) (setq dired-directory (cdr (car files-renamed)))) ;; Re-sort the buffer. - (revert-buffer)) + (revert-buffer) + (let ((inhibit-read-only t)) + (dired-mark-remembered marks))) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) '(old-name nil end-name nil old-link nil --=-=-= Content-Type: text/plain Christopher --=-=-=--