mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-25 07:28:20 +00:00
Give better error message in dired-toggle-read-only on nonexisting dirs
* lisp/dired.el (dired-toggle-read-only): Refuse to edit non-existent directories (bug#23276).
This commit is contained in:
parent
0beb8fd663
commit
82fa112e8a
@ -2533,6 +2533,8 @@ If the current buffer can be edited with Wdired, (i.e. the major
|
||||
mode is `dired-mode'), call `wdired-change-to-wdired-mode'.
|
||||
Otherwise, toggle `read-only-mode'."
|
||||
(interactive)
|
||||
(unless (file-exists-p default-directory)
|
||||
(user-error "The current directory no longer exists"))
|
||||
(when (and (not (file-writable-p default-directory))
|
||||
(not (y-or-n-p
|
||||
"Directory isn't writable; edit anyway? ")))
|
||||
|
Loading…
Reference in New Issue
Block a user