From 91395839184a2d726650fe9170140a5009ff3837 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 28 Jul 2006 21:00:15 +0000 Subject: [PATCH] (wdired-change-to-wdired-mode, wdired-change-to-dired-mode): Throw error if buffer is not in Dired and Wdired mode, respectively. --- lisp/ChangeLog | 5 +++++ lisp/wdired.el | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8fd1f8a4255..70a83fc4345 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-07-28 Bill Atkins (tiny change) + + * wdired.el (wdired-change-to-wdired-mode, wdired-change-to-dired-mode): + Throw error if buffer is not in Dired and Wdired mode, respectively. + 2006-07-28 Chong Yidong * cus-edit.el (custom-no-edit): Revert 2006-07-27 change, so that diff --git a/lisp/wdired.el b/lisp/wdired.el index 1363181524c..bc70e0ddcfd 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -238,6 +238,8 @@ in disk. See `wdired-mode'." (interactive) + (or (eq major-mode 'dired-mode) + (error "Not a Dired buffer")) (set (make-local-variable 'wdired-old-content) (buffer-substring (point-min) (point-max))) (set (make-local-variable 'wdired-old-point) (point)) @@ -328,6 +330,8 @@ non-nil means return old filename." (defun wdired-change-to-dired-mode () "Change the mode back to dired." + (or (eq major-mode 'wdired-mode) + (error "Not a Wdired buffer")) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) '(read-only nil local-map nil))) -- 2.39.2