How to restore to the last edit scenario when starting Emacs again

Source: Internet
Author: User

Session. El

(Require 'session)
(Add-hook 'after-init-hook
'Session-Initialize)

The global variable when you left Emacs after using this extension
(Kill-ring, Command record ......), Local variables, registers, opened files, modified files, and last modified locations ,......
All are recorded.

After the session is loaded, there will be two more items in the menu: recently accessed files and recently modified files.
Desktop. El

(Load "desktop ")
(Desktop-load-default)
(Desktop-read)

If you want to save the last opened file record, you can use desktop. This is the built-in Emacs. You only need to add the above settings, and then M-x
Desktop-save. In the future, when Emacs is started, all
Buffer.

M-x Desktop-clear can delete the remembered content. You can use this method if you remember too many buffers. However, I suggest using
Ibuffer (see below)
To manage these buffers, because sometimes you will find that if you delete all the remembered buffers, you will need some time to open the files you frequently edit later!

If the session works with desktop, the next time you start Emacs, it will be the same as if you didn't close Emacs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.