# HG changeset patch # User Richard M. Stallman # Date 825712172 0 # Node ID 3682b5e64ce3ac5835a23259133a4ae67e4500e3 # Parent 5b81926cc17f2859b2dc19f2836bd1915d5628eb (set-visited-file-name): Query if there's already another buffer visiting this file. diff -r 5b81926cc17f -r 3682b5e64ce3 lisp/files.el --- a/lisp/files.el Fri Mar 01 20:13:42 1996 +0000 +++ b/lisp/files.el Fri Mar 01 20:29:32 1996 +0000 @@ -1422,6 +1422,11 @@ (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? " + filename))) + (error "Aborted"))) (or (equal filename buffer-file-name) (progn (and filename (lock-buffer filename))