This is equivalent to set-visited-file-name followed by C-x C-s, except that C-x C-w asks for confirmation if the file exists. If you wish to mark the buffer as visiting a different file and save it right away, use C-x C-w ( write-file). It also marks the buffer as modified so that C-x C-s in that buffer will save. set-visited-file-name does not save the buffer in the newly visited file it just alters the records inside Emacs in case you do save later. Then it marks the buffer as visiting that file name, and changes the buffer name correspondingly. It reads the new file name using the minibuffer. M-x set-visited-file-name alters the name of the file that the current buffer is visiting. (You could also undo all the changes by repeating the undo command C-x u until you have undone all the changes but reverting is easier.) (‘ ~’ is often used as a mathematical symbol for “not" thus M-~ is “not", metafied.) Alternatively, you can cancel all the changes made since the file was visited or saved, by reading the text from the file again. If you do this, none of the save commands will believe that the buffer needs to be saved. One thing you can do is type M-~ ( not-modified), which clears out the indication that the buffer is modified. Otherwise, each time you use C-x s or C-x C-c, you are liable to save this buffer by mistake. If you have changed a buffer but do not wish to save the changes, you should take some action to prevent it. You can customize the value of save-some-buffers-default-predicate to control which buffers Emacs will ask about.Ĭ-x C-c, the key sequence to exit Emacs, invokes save-some-buffers and therefore asks the same questions. C-h ĭisplay a help message about these options. This calls the command diff-buffer-with-file (see Comparing Files). d ĭiff the buffer against its corresponding file, so you can see what changes you would be saving. C-f Įxit save-some-buffers and visit the buffer that you are currently being asked about. When you exit View mode, you get back to save-some-buffers, which asks the question again. View the buffer that you are currently being asked about. Save this buffer, then exit save-some-buffers without even asking about other buffers. Terminate save-some-buffers without any more saving. Save this buffer and all the rest with no more questions. n DEL ĭon’t save this buffer, but ask about the rest of the buffers. Save this buffer and ask about the rest of the buffers. The possible responses are analogous to those of query-replace: y SPC The command C-x s ( save-some-buffers) offers to save any or all modified buffers. With a prefix argument, C-u C-x C-s, Emacs also marks the buffer to be backed up when the next save is done.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |