Emacs: Restore Opened Files, Windows Config
desktop-save-mode. When on, it save and restore all previously opened files in last emacs session, and also previous windows configuration (size, position, etc.)
Put this in your emacs init file:
;; save/restore opened files and windows config (desktop-save-mode 1) ; 0 for off
Starting Emacs Without Opening Last Session's Files
To start emacs without opening last session's files, start it by:
This is useful because sometimes you have a corrupted desktop file.
Desktop File Path Location
By default, the temp file used by emacs to store your “desktop” status is at
The desktop file path is controlled by the variable desktop-dirname and desktop-base-file-name.
describe-variable, type “desktop-”, then press Tab, to see all desktop mode's variables.
customize-group type “desktop”, to set preferences.
[see Emacs: M-x customize Tutorial]
desktop-save-mode Changes in Emacs 24.4
In emacs 24.4: new variable desktop-save.
t, desktop are automatically saved when you quit.
In emacs 24.4: new variable desktop-auto-save-timeout. Default value is
30 (seconds). It specifies the time interval to periodically save “desktop”. Before, it saves only when you quit emacs.
In emacs 24.4: New variable desktop-restore-frames. Default value is t. When t, save and restore the frame and window configuration.
More options for restoring windows, see: desktop-restore-in-current-display, desktop-restore-reuses-frames, desktop-restore-forces-onscreen
describe-variable to see a variable's value and documentation.
Manage Windows Topic
- Emacs init file
- What's Major Mode
- What's Minor Mode
- M-x customize
- Organize Init File
- Byte Compile Elisp
- What's Hook
- Avoid Lambda in Hook
- Environment Variables in Emacs
- Check OS, Version, Host Name
- Check Defined/Loaded
- Define Keys
- Set Mouse Buttons
- Tabs, Space, Indentation Setup
- auto bracket pair
- Copy/Cut Line If No Selection
- Isearch space for - _
- Ido Completion
- Icomplete Completion
- Move Cursor by camelCase
- Stop Cursor Going into Minibuffer Prompt
- Sync Clipboard with Linux X11
- Default Major Mode
- Auto Backup Off
- Auto Save
- Restore Opened Files
- Save Cursor Position
- Dired Customization
- Open Recently Opened
- Open Last Closed File
- Show Line Numbers
- Show Cursor Position
- Visual Line Mode, Wrap Lines
- High Light Current Line
- Make Whitespaces Visible
- Set Default Window Size
- Font Setup
- Line Spacing
- Set Color Theme
- Highlight Paren
- Show lambda as λ
- Color CSS Hex Code