aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-02-03 09:42:56 +0000
committerRichard M. Stallman1997-02-03 09:42:56 +0000
commitf36012a6692d4b6e248a04f26de9a61c4b989eee (patch)
tree41bb23f7c2d7c847d7d27709ea5d9592051047e8
parentbf437d6d9522bd71766fbe57ba6bd17d48857ee0 (diff)
downloademacs-f36012a6692d4b6e248a04f26de9a61c4b989eee.tar.gz
emacs-f36012a6692d4b6e248a04f26de9a61c4b989eee.zip
(set-visited-file-name): New arg ALONG-WITH-FILE.
-rw-r--r--lisp/files.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 3d605384344..251177e64fb 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1457,7 +1457,7 @@ in order to initialize other data structure based on them.")
1457 (set var val)))) 1457 (set var val))))
1458 1458
1459 1459
1460(defun set-visited-file-name (filename &optional no-query) 1460(defun set-visited-file-name (filename &optional no-query along-with-file)
1461 "Change name of file visited in current buffer to FILENAME. 1461 "Change name of file visited in current buffer to FILENAME.
1462The next time the buffer is saved it will go in the newly specified file. 1462The next time the buffer is saved it will go in the newly specified file.
1463nil or empty string as argument means make buffer not be visiting any file. 1463nil or empty string as argument means make buffer not be visiting any file.
@@ -1465,7 +1465,10 @@ Remember to delete the initial contents of the minibuffer
1465if you wish to pass an empty string as the argument. 1465if you wish to pass an empty string as the argument.
1466 1466
1467The optional second argument NO-QUERY, if non-nil, inhibits asking for 1467The optional second argument NO-QUERY, if non-nil, inhibits asking for
1468confirmation in the case where another buffer is already visiting FILENAME." 1468confirmation in the case where another buffer is already visiting FILENAME.
1469
1470The optional third argument ALONG-WITH-FILE, if non-nil, means that
1471the old visited file has been renamed to the new name FILENAME."
1469 (interactive "FSet visited file name: ") 1472 (interactive "FSet visited file name: ")
1470 (if (buffer-base-buffer) 1473 (if (buffer-base-buffer)
1471 (error "An indirect buffer cannot visit a file")) 1474 (error "An indirect buffer cannot visit a file"))
@@ -1501,7 +1504,8 @@ confirmation in the case where another buffer is already visiting FILENAME."
1501 (or (string= new-name (buffer-name)) 1504 (or (string= new-name (buffer-name))
1502 (rename-buffer new-name t)))) 1505 (rename-buffer new-name t))))
1503 (setq buffer-backed-up nil) 1506 (setq buffer-backed-up nil)
1504 (clear-visited-file-modtime) 1507 (or along-with-file
1508 (clear-visited-file-modtime))
1505 ;; Abbreviate the file names of the buffer. 1509 ;; Abbreviate the file names of the buffer.
1506 (if truename 1510 (if truename
1507 (progn 1511 (progn
@@ -1546,8 +1550,9 @@ confirmation in the case where another buffer is already visiting FILENAME."
1546 (and oauto buffer-auto-save-file-name 1550 (and oauto buffer-auto-save-file-name
1547 (file-exists-p oauto) 1551 (file-exists-p oauto)
1548 (rename-file oauto buffer-auto-save-file-name t))) 1552 (rename-file oauto buffer-auto-save-file-name t)))
1549 (if buffer-file-name 1553 (and buffer-file-name
1550 (set-buffer-modified-p t))) 1554 (not along-with-file)
1555 (set-buffer-modified-p t)))
1551 1556
1552(defun write-file (filename &optional confirm) 1557(defun write-file (filename &optional confirm)
1553 "Write current buffer into file FILENAME. 1558 "Write current buffer into file FILENAME.