开发者

Remember all opened files with split windows and their positions in Emacs

It took really a lot of time to get used to Emacs, but everything I want to have from normal editor like Coda, is just impossible without additional scripts.

I want to restore everything like it was before.

Split windows, their position, opened files/shells/debugger. Everything back to as it was. Coda can do this, Eclipse can do this, anything can do this.

When I need any normal feature for Emacs it always needs tons of scripts to have it. I thought I really would die with pyflakes, c开发者_StackOverflow中文版ode-color, shrink-windows bindings and 20 other scripts which I even don't remember... Why are so many elementary things not integrated already???

Any good books for beginners?


Take a look under "Options" > "Customize Emacs".

It sounds like you want to enable two features:

  • "Save Place" which saves the location in each file the next time you load it.
  • "Desktop" which saves all the files you currently have loaded.

Or if you feel like editing your .emacs file:

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  '(desktop-enable t nil (desktop))
  '(save-place t nil (saveplace)))


I have this working. Emacs always starts back up exactly as I left it, unless it crashes...:

http://www.gentei.org/~yuuji/software/windows.el

This will save all window spits and open buffers:

http://www.emacswiki.org/emacs/SavePlace

Thise will save your place in files. Here roughly how to set it up:

(require 'windows)
(require 'recentf)

;; -- Load the saved windows automatically on boot
(add-hook 'window-setup-hook 'resume-windows)

;; -- Save place in file
(setq-default save-place t)

;; --  Use this command to quit and save your setup
(define-key ctl-x-map "C" 'see-you-again)

;; -- Set up window saving!! Place at end of .emacs file
(win:startup-with-window)


I found Conveniently save and restore frame configurations, and it might be doing what you are looking for.


Not sure whether it is nearing to what you want, but give it a try: http://www.emacswiki.org/emacs/LayoutRestore


Emacs 24.4 snapshots since June 2013 have added frame restoration to the bundled session manager desktop.el. This includes restoring desktop position and opened windows of all frames. I have tried this feature myself using a January 2014 snapshot and it works pretty well, though a few minor bugs remain. These may have already been fixed in more recent snapshots.

Note that some buffers cannot easily be restored even in theory, such as debuggers (gdb, pdb, etc.) and any others buffer that depends on an external process.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜