Emacs的自动保存,怎么调整它的自动 保存时间和其字数
如我想20秒空闲、输入30个字就自动保存,应怎么做?
Emacs的自动保存,怎么调整它的自动 保存时间和其字数
- lwaterl
- 帖子: 379
- 注册时间: 2007-08-24 17:46
- lilydjwg
- 论坛版主
- 帖子: 4258
- 注册时间: 2009-04-11 23:46
- 系统: Arch Linux
- 联系:
Re: Emacs的自动保存,怎么调整它的自动 保存时间和其字数
要不你换 Vim?
- fanhe
- 帖子: 2357
- 注册时间: 2007-03-24 23:45
Re: Emacs的自动保存,怎么调整它的自动 保存时间和其字数
没事多看看文档
虽然emacs没有中文文档
虽然emacs没有中文文档
就是这两个变量, 设置变量值的方法好像是 setq, 自己搞下我忘了, emacs还没有时间折腾, 以后再搞Controlling Auto-Saving
-----------------------
Each time you visit a file, auto-saving is turned on for that file's
buffer if the variable `auto-save-default' is non-`nil' (but not in
batch mode; Note: Entering Emacs.). The default for this variable is
`t', so auto-saving is the usual practice for file-visiting buffers.
Auto-saving can be turned on or off for any existing buffer with the
command `M-x auto-save-mode'. Like other minor mode commands, `M-x
auto-save-mode' turns auto-saving on with a positive argument, off with
a zero or negative argument; with no argument, it toggles.
Emacs does auto-saving periodically based on counting how many
characters you have typed since the last time auto-saving was done.
The variable `auto-save-interval' specifies how many characters there
are between auto-saves. By default, it is 300.
Auto-saving also takes place when you stop typing for a while. The
variable `auto-save-timeout' says how many seconds Emacs should wait
before it does an auto save (and perhaps also a garbage collection).
(The actual time period is longer if the current buffer is long; this
is a heuristic which aims to keep out of your way when you are editing
long buffers in which auto-save takes an appreciable amount of time.)
Auto-saving during idle periods accomplishes two things: first, it
makes sure all your work is saved if you go away from the terminal for
a while; second, it may avoid some auto-saving while you are actually
typing.
Emacs also does auto-saving whenever it gets a fatal error. This
includes killing the Emacs job with a shell command such as `kill
%emacs', or disconnecting a phone line or network connection.
You can request an auto-save explicitly with the command `M-x
do-auto-save'.
代码: 全选
auto-save-interval
auto-save-timeout
- lwaterl
- 帖子: 379
- 注册时间: 2007-08-24 17:46
Re: Emacs的自动保存,怎么调整它的自动 保存时间和其字数
实在不习惯那个快捷键,呵呵要不你换 Vim?
嗯,我知道是这俩个,但用这个我只会用默认值。没事多看看文档
虽然emacs没有中文文档
……
还要承认,我英语烂的可以。
可惜了,要不还想试试。现在不用linux了,额,当时提问时好像用的是pcbsd+fvwm ,汗,就是瞎弄,现在没时间了。好多问题都是完全按说明做的,但就是不成功,ports上让我问作者,当时就汗颜了,哈哈
嗯auto-save-interval
auto-save-timeout