diff lisp/files.el @ 16971:c1b9bc4c525b

(set-visited-file-name): New arg ALONG-WITH-FILE.
author Richard M. Stallman <rms@gnu.org>
date Mon, 03 Feb 1997 09:42:56 +0000
parents 3626b6cd2ad1
children c7683cba14c7
line wrap: on
line diff
--- 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.