emacs recover file

If Emacs crashes, how can I recover the file I was editing?

By default, Emacs frequently saves the current buffer automatically into a temporary file called: #myfile#

myfile is the name of the file in the buffer. If you lose your connection or if Emacs itself crashes, you will probably be able to get back most of your work. To do so:

  1. Use Emacs to open the file you were working on when Emacs crashed. At the bottom of the screen, the following message will probably appear: Auto save file is newer; consider M-x recover-file
  2. This indicates that Emacs has an autosaved file that you can recover. To recover the file, enter: M-x recover-file
  3. At the bottom of the screen, something like the following will appear: Recover file: ~/myfile myfile is the name of the file you are working on.
  4. Press the Enter key. Then Emacs will split the screen. In the bottom screen you will see something like the following: -rw------- 1 jdoe iago 939 Apr 24 19:44 /home/u1/jdoe/#myfile# -rw------- 1 jdoe iago 551 Apr 24 19:33 /home/u1/jdoe/myfile At the bottom of the screen will be the following message: Recover auto save file /home/u1/jdoe/#myfile#? (yes or no)
  5. Enter yes  , and Emacs will read in the autosaved file.

Note: If you start Emacs without giving it a filename, you will be working in the temporary "scratch" buffer. In this case, to recover your work, try entering: M-x recover-session

Note: If you aren't sure how to enter these commands in Emacs, see In Emacs, how are keystrokes denoted?

At Indiana University, to get support for personal or departmental Linux or Unix systems, see At IU, how do I get support for Linux or Unix?

Also see:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值