Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12479
  • 博文数量: 14
  • 博客积分: 560
  • 博客等级: 中士
  • 技术积分: 150
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-17 16:40
文章分类
文章存档

2010年(14)

我的朋友
最近访客

分类: LINUX

2010-09-21 13:54:57

1.8. Saving Files
1.8. 保存文件

To save the file you are editing, type C-x C-s. Emacs writes the file. To let you know that the file was saved, it puts the message Wrote filename in the minibuffer. If you haven't made any changes to the file, Emacs puts the message No changes need to be saved in the minibuffer. You can also get to this option by pressing the diskette on the toolbar or choosing Save (current buffer) from the File menu.
    要保存正在编辑的文件,按C-x C-s。Emacs将修改写入到文件。文件保存后,Emacs会在迷你缓冲区显示信息“wrote **文件”。如果文件没有做任何改动,会在迷你缓冲区显示“No Changes need to be saved.”你也可以通过点击工具栏的磁盘图标或者在文件菜单中选择保存(当前缓冲区)来对文件进行保存。

If you decide to save something you've typed in the *scratch* buffer by typing C-x C-s, Emacs asks you for a filename. After you give it a filename, Emacs changes the mode line accordingly.
    如果你要用C-x C-s保存在“scratch”缓冲区中输入的内容,Emacs提示你输入文件名。输入文件名后,Emacs按照文件信息更新模式行。

A related command is write-file (C-x C-w). It is the Emacs equivalent of the Save As option found on many applications' File menus. The write-file command asks you to type a new filename in the minibuffer. However, if you just press Enter instead of typing a new filename, write-file saves the file with its old name—just as C-x C-s would have done. (It does ask if you want to replace the current file with the one in this buffer, however.)
    一个相关的指令是写入文件(C-x C-w)。这是与其他应用程序等价的文件菜单中的另存为功能。写入文件指令要求你在迷你缓冲区输入一个新文件名。如果你什么也没输入就按了一个回车键,那么Emacs会将文件保存到原文件名对应的文件内,与C-x C-s功能一样。(它会询问是否用当前缓冲区替换本地文件?)

The write-file command is useful for editing files that you do not have permission to change. Use the find-file command to get the file you want into a buffer, and then use write-file to create your own private version, with a different name or path. This maneuver allows you to copy the file to one that you own and can change. Of course, the original file is not affected.
    写入文件指令对你没有权限编辑的文件很有用。用查找文件命令打开你想要的文件,然后使用写入文件指令来创建你自己的不同文件名或路径的私有版本的文件。这个策略可以使你复制一个文件到你自己可修改的文件中。当然,原文件不会受到任何影响。

阅读(341) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~