changeset 97579:8192d80c0508

(wdired-old-auto-revert-mode): New var. (wdired-change-to-wdired-mode): Turn off auto-revert-mode. (wdired-change-to-dired-mode): Turn auto-revert-mode on if it used to be on.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 20 Aug 2008 22:41:45 +0000
parents 9c944e3e2fc4
children 876b21ddd885
files lisp/wdired.el
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/wdired.el	Wed Aug 20 22:41:28 2008 +0000
+++ b/lisp/wdired.el	Wed Aug 20 22:41:45 2008 +0000
@@ -207,6 +207,7 @@
 (defvar wdired-col-perm) ;; Column where the permission bits start
 (defvar wdired-old-content)
 (defvar wdired-old-point)
+(defvar wdired-old-auto-revert-mode nil)
 
 
 (defun wdired-mode ()
@@ -242,6 +243,10 @@
        (buffer-substring (point-min) (point-max)))
   (set (make-local-variable 'wdired-old-point) (point))
   (set (make-local-variable 'query-replace-skip-read-only) t)
+  (when (and (boundp 'auto-revert-mode)
+	     auto-revert-mode)
+    (set (make-local-variable 'wdired-old-auto-revert-mode) t)
+    (auto-revert-mode 0))
   (use-local-map wdired-mode-map)
   (force-mode-line-update)
   (setq buffer-read-only nil)
@@ -349,6 +354,11 @@
   (setq mode-name "Dired")
   (dired-advertise)
   (remove-hook 'kill-buffer-hook 'wdired-check-kill-buffer t)
+  (when wdired-old-auto-revert-mode
+    (kill-local-variable 'wdired-old-auto-revert-mode)
+    (and (boundp 'auto-revert-mode)
+	 (null auto-revert-mode)
+	 (auto-revert-mode 1)))
   (set (make-local-variable 'revert-buffer-function) 'dired-revert))