# HG changeset patch # User Richard M. Stallman # Date 854962976 0 # Node ID c1b9bc4c525bff2a0814451cc3342c783faa8649 # Parent d2c5d2988a0ab0694c845053b3ba842fa13f7141 (set-visited-file-name): New arg ALONG-WITH-FILE. diff -r d2c5d2988a0a -r c1b9bc4c525b lisp/files.el --- a/lisp/files.el Mon Feb 03 06:55:50 1997 +0000 +++ b/lisp/files.el Mon Feb 03 09:42:56 1997 +0000 @@ -1457,7 +1457,7 @@ (set var val)))) -(defun set-visited-file-name (filename &optional no-query) +(defun set-visited-file-name (filename &optional no-query along-with-file) "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. @@ -1465,7 +1465,10 @@ 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 another buffer is already visiting FILENAME." +confirmation in the case where another buffer is already visiting FILENAME. + +The optional third argument ALONG-WITH-FILE, if non-nil, means that +the old visited file has been renamed to the new name FILENAME." (interactive "FSet visited file name: ") (if (buffer-base-buffer) (error "An indirect buffer cannot visit a file")) @@ -1501,7 +1504,8 @@ (or (string= new-name (buffer-name)) (rename-buffer new-name t)))) (setq buffer-backed-up nil) - (clear-visited-file-modtime) + (or along-with-file + (clear-visited-file-modtime)) ;; Abbreviate the file names of the buffer. (if truename (progn @@ -1546,8 +1550,9 @@ (and oauto buffer-auto-save-file-name (file-exists-p oauto) (rename-file oauto buffer-auto-save-file-name t))) - (if buffer-file-name - (set-buffer-modified-p t))) + (and buffer-file-name + (not along-with-file) + (set-buffer-modified-p t))) (defun write-file (filename &optional confirm) "Write current buffer into file FILENAME.