summaryrefslogtreecommitdiff
path: root/lisp/wdired.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/wdired.el')
-rw-r--r--lisp/wdired.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 55df66a70e6..298d20a370d 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -193,7 +193,8 @@ program `dired-chmod-program', which must exist."
(define-key map [menu-bar wdired dashes]
'("--"))
(define-key map [menu-bar wdired wdired-abort-changes]
- '("Abort Changes" . wdired-abort-changes))
+ '(menu-item "Abort Changes" wdired-abort-changes
+ :help "Abort changes and return to dired mode"))
(define-key map [menu-bar wdired wdired-finish-edit]
'("Commit Changes" . wdired-finish-edit))
;; FIXME: Use the new remap trick.
@@ -211,6 +212,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 +244,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 +267,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 +352,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)