# HG changeset patch # User Richard M. Stallman # Date 836077856 0 # Node ID 6ec32e968edbcdfa9a41fedc1f141543d566bf76 # Parent 409a68abc61ce2ff523113eb111a5ea7e642e07e (set-visited-file-name): New optional arg NO-QUERY. diff -r 409a68abc61c -r 6ec32e968edb lisp/files.el --- a/lisp/files.el Sat Jun 29 07:09:25 1996 +0000 +++ b/lisp/files.el Sat Jun 29 19:50:56 1996 +0000 @@ -1415,12 +1415,15 @@ (set var val)))) -(defun set-visited-file-name (filename) +(defun set-visited-file-name (filename &optional no-query) "Change name of file visited in current buffer to FILENAME. The next time the buffer is saved it will go in the newly specified file. nil or empty string as argument means make buffer not be visiting any file. Remember to delete the initial contents of the minibuffer -if you wish to pass an empty string as the argument." +if you wish to pass an empty string as the argument. + +The optional second argument NO-QUERY, if non-nil, inhibits asking for +confirmation in the case where the file FILENAME already exists." (interactive "FSet visited file name: ") (if (buffer-base-buffer) (error "An indirect buffer cannot visit a file")) @@ -1437,6 +1440,7 @@ (setq filename truename)))) (let ((buffer (and filename (find-buffer-visiting filename)))) (and buffer (not (eq buffer (current-buffer))) + (not no-query) (not (y-or-n-p (message "A buffer is visiting %s; proceed? " filename))) (error "Aborted")))