From 423732e4fb5e4d08f60319290002e7817240fcb9 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 20 Aug 2008 22:41:45 +0000 Subject: [PATCH] (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. --- lisp/wdired.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/wdired.el b/lisp/wdired.el index e2d6a4b85b8..f2f863ef971 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -207,6 +207,7 @@ program `dired-chmod-program', which must exist." (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 @@ See `wdired-mode'." (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 @@ non-nil means return old filename." (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)) -- 2.39.5