summaryrefslogtreecommitdiff
path: root/lisp/wdired.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2005-12-14 07:46:11 +0000
committerJuri Linkov <juri@jurta.org>2005-12-14 07:46:11 +0000
commitad25ebbbbce7b404df074cdc2843593a3908b03a (patch)
tree55bd0ec0108831f9863b1ecdce199712f9575e20 /lisp/wdired.el
parent5fff026521070bb7948d5e5f0e655e59fcb1d55b (diff)
downloademacs-ad25ebbbbce7b404df074cdc2843593a3908b03a.tar.gz
(wdired-old-point): New internal variable.
(wdired-change-to-wdired-mode): Set it buffer-locally. (wdired-abort-changes): Restore point after aborting changes.
Diffstat (limited to 'lisp/wdired.el')
-rw-r--r--lisp/wdired.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 55df66a70e6..56518691cad 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -211,6 +211,7 @@ program `dired-chmod-program', which must exist."
;; Local variables (put here to avoid compilation gripes)
(defvar wdired-col-perm) ;; Column where the permission bits start
(defvar wdired-old-content)
+(defvar wdired-old-point)
(defun wdired-mode ()
@@ -242,6 +243,7 @@ See `wdired-mode'."
(interactive)
(set (make-local-variable 'wdired-old-content)
(buffer-substring (point-min) (point-max)))
+ (set (make-local-variable 'wdired-old-point) (point))
(set (make-local-variable 'query-replace-skip-read-only) t)
(use-local-map wdired-mode-map)
(force-mode-line-update)
@@ -264,7 +266,8 @@ See `wdired-mode'."
(set-buffer-modified-p nil)
(setq buffer-undo-list nil)
(run-mode-hooks 'wdired-mode-hook)
- (message "%s" (substitute-command-keys "Press \\[wdired-finish-edit] when finished \
+ (message "%s" (substitute-command-keys
+ "Press \\[wdired-finish-edit] when finished \
or \\[wdired-abort-changes] to abort changes")))
@@ -348,7 +351,8 @@ non-nil means return old filename."
(interactive)
(let ((inhibit-read-only t))
(erase-buffer)
- (insert wdired-old-content))
+ (insert wdired-old-content)
+ (goto-char wdired-old-point))
(wdired-change-to-dired-mode)
(set-buffer-modified-p nil)
(setq buffer-undo-list nil)