From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: possible bug in wdired and patch Date: Mon, 12 Feb 2007 12:35:57 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1171280200 30353 80.91.229.12 (12 Feb 2007 11:36:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Feb 2007 11:36:40 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 12 12:36:29 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HGZTu-0006Sd-N9 for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2007 12:36:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGZTu-0002zp-1n for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2007 06:36:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HGZTZ-0002wJ-6U for emacs-devel@gnu.org; Mon, 12 Feb 2007 06:36:05 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HGZTX-0002vZ-Ke for emacs-devel@gnu.org; Mon, 12 Feb 2007 06:36:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGZTX-0002vT-AH for emacs-devel@gnu.org; Mon, 12 Feb 2007 06:36:03 -0500 Original-Received: from mxfep03.bredband.com ([195.54.107.76]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HGZTW-0001Du-O1 for emacs-devel@gnu.org; Mon, 12 Feb 2007 06:36:03 -0500 Original-Received: from ironport2.bredband.com ([195.54.107.84] [195.54.107.84]) by mxfep03.bredband.com with ESMTP id <20070212113558.FRAB2708.mxfep03.bredband.com@ironport2.bredband.com> for ; Mon, 12 Feb 2007 12:35:58 +0100 Original-Received: from ua-83-227-131-3.cust.bredbandsbolaget.se (HELO kurono.home) ([83.227.131.3]) by ironport2.bredband.com with ESMTP; 12 Feb 2007 12:35:58 +0100 User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux) X-detected-kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:66283 Archived-At: --=-=-= I have been using this patch against wdired 1.9.2 for some time, and only just remembered. (this is not the version in emacs, but its very similar) The problem is that when you revert the wdired buffer to dired mode, the original command line that was used to make the dired buffer isnt used. This means wdired does the wrong thing when reverting to a dired buffer made with "find" for instance. The patch adresses this. The second part of the patch is for creating parent directories if there arent any. This is a new feature I suppose, and it isnt necessary for the bugfix. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=wdired.diff --- wdired.el.1 2007-02-12 12:16:30.000000000 +0100 +++ wdired.el 2007-02-12 12:20:15.000000000 +0100 @@ -362,6 +362,10 @@ (add-hook 'kill-buffer-hook 'wdired-check-kill-buffer nil t) (setq major-mode 'wdired-mode) (setq mode-name "Edit filenames") + + ;JAVE + (setq wdired-old-revert-buffer-function revert-buffer-function) + (setq revert-buffer-function 'wdired-revert) ;; I temp disable undo for performance: since I'm going to clear the ;; undo list, it can save more than a 9% of time with big @@ -461,7 +465,7 @@ (setq mode-name "Dired") (dired-advertise) (remove-hook 'kill-buffer-hook 'wdired-check-kill-buffer t) - (setq revert-buffer-function 'dired-revert)) + (setq revert-buffer-function wdired-old-revert-buffer-function )) (defun wdired-abort-changes () @@ -518,6 +522,7 @@ (wdired-search-and-rename file-ori file-new) (condition-case err (let ((dired-backup-overwrite nil)) + (wdired-create-parentdirs file-new) (dired-rename-file file-ori file-new overwrite)) (error @@ -545,6 +550,13 @@ (set-buffer-modified-p nil) (setq buffer-undo-list nil)) +;;JAVE create parent directories of filename if the parents doesnt exist +(defun wdired-create-parentdirs (file-new) + (message "create dir for file %s" file-new) + (make-directory (file-name-directory file-new) t) +) + + ;; Renames a file, searching it in a modified dired buffer, in order ;; to be able to use `dired-do-create-files-regexp' and get its ;; "benefits" --=-=-= -- Joakim Verona --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--