Emacs的自动保存,怎么调整它的自动 保存时间和其字数

Vim、Emacs配置和使用
回复
头像
lwaterl
帖子: 379
注册时间: 2007-08-24 17:46
送出感谢: 14 次
接收感谢: 2 次

Emacs的自动保存,怎么调整它的自动 保存时间和其字数

#1

帖子 lwaterl » 2011-06-14 7:38

Emacs的自动保存,怎么调整它的自动 保存时间和其字数

如我想20秒空闲、输入30个字就自动保存,应怎么做?
头像
lilydjwg
论坛版主
帖子: 4165
注册时间: 2009-04-11 23:46
系统: Arch Linux
送出感谢: 11 次
接收感谢: 127 次
联系:

Re: Emacs的自动保存,怎么调整它的自动 保存时间和其字数

#2

帖子 lilydjwg » 2011-06-14 12:59

要不你换 Vim?
头像
fanhe
帖子: 2357
注册时间: 2007-03-24 23:45
送出感谢: 0
接收感谢: 9 次

Re: Emacs的自动保存,怎么调整它的自动 保存时间和其字数

#3

帖子 fanhe » 2011-06-14 14:36

没事多看看文档
虽然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'.
就是这两个变量, 设置变量值的方法好像是 setq, 自己搞下我忘了, emacs还没有时间折腾, 以后再搞

代码: 全选

auto-save-interval
auto-save-timeout
头像
pocoyo
论坛版主
帖子: 25878
注册时间: 2008-03-25 15:49
来自: 谁知道?
送出感谢: 5 次
接收感谢: 9 次
联系:

Re: Emacs的自动保存,怎么调整它的自动 保存时间和其字数

#4

帖子 pocoyo » 2011-06-14 14:36

auto-save-interval
auto-save-timeout
头像
lwaterl
帖子: 379
注册时间: 2007-08-24 17:46
送出感谢: 14 次
接收感谢: 2 次

Re: Emacs的自动保存,怎么调整它的自动 保存时间和其字数

#5

帖子 lwaterl » 2012-01-12 14:54

要不你换 Vim?
实在不习惯那个快捷键,呵呵
没事多看看文档
虽然emacs没有中文文档
……
嗯,我知道是这俩个,但用这个我只会用默认值。
还要承认,我英语烂的可以。
可惜了,要不还想试试。现在不用linux了,额,当时提问时好像用的是pcbsd+fvwm ,汗,就是瞎弄,现在没时间了。好多问题都是完全按说明做的,但就是不成功,ports上让我问作者,当时就汗颜了,哈哈
auto-save-interval
auto-save-timeout
回复

回到 “Vim和Emacs”