Commit 7b89d38e authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(set-visited-file-name): Query if there's already another

buffer visiting this file.
parent f50adf13
......@@ -1422,6 +1422,11 @@ if you wish to pass an empty string as the argument."
(setq truename (file-truename filename))
(if find-file-visit-truename
(setq filename truename))))
(let ((buffer (find-buffer-visiting filename)))
(and buffer (not (eq buffer (current-buffer)))
(not (y-or-n-p (message "A buffer is visiting %s; proceed? "
(error "Aborted")))
(or (equal filename buffer-file-name)
(and filename (lock-buffer filename))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment