Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
f8f67141
Commit
f8f67141
authored
Jul 29, 2007
by
Juri Linkov
Browse files
(wdired-exit): New function.
(wdired-mode-map): Bind C-x C-q to wdired-exit.
parent
a0247dcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
lisp/wdired.el
lisp/wdired.el
+17
-0
No files found.
lisp/wdired.el
View file @
f8f67141
...
...
@@ -175,6 +175,7 @@ program `dired-chmod-program', which must exist."
(
define-key
map
"\C-c\C-c"
'wdired-finish-edit
)
(
define-key
map
"\C-c\C-k"
'wdired-abort-changes
)
(
define-key
map
"\C-c\C-["
'wdired-abort-changes
)
(
define-key
map
"\C-x\C-q"
'wdired-exit
)
(
define-key
map
"\C-m"
'ignore
)
(
define-key
map
"\C-j"
'ignore
)
(
define-key
map
"\C-o"
'ignore
)
...
...
@@ -423,6 +424,22 @@ non-nil means return old filename."
(set-buffer-modified-p nil)
(setq buffer-undo-list nil))
(defun wdired-exit ()
"
Exit
wdired
and
return
to
dired
mode.
Just
return
to
dired
mode
if
there
are
no
changes.
Otherwise,
ask
a
yes-or-no
question
whether
to
save
or
cancel
changes,
and
proceed
depending
on
the
answer.
"
(interactive)
(if (buffer-modified-p)
(if (y-or-n-p (format "
Buffer
%s
modified
; save changes? "
(
current-buffer
)))
(
wdired-finish-edit
)
(
wdired-abort-changes
))
(
wdired-change-to-dired-mode
)
(
set-buffer-modified-p
nil
)
(
setq
buffer-undo-list
nil
)
(
message
"(No changes need to be saved)"
)
))
;; Rename a file, searching it in a modified dired buffer, in order
;; to be able to use `dired-do-create-files-regexp' and get its
;; "benefits".
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment