Skip to content

Commit

Permalink
README.md: Add 102 to add-hook to ensure that the session is load…
Browse files Browse the repository at this point in the history
…ed after everything else
  • Loading branch information
jamescherti committed Oct 9, 2024
1 parent 868b8b6 commit d829a8a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ To install the `easysession` from MELPA:
;; Make the current session name appear in the mode-line
(easysession-mode-line-misc-info t)
:init
(add-hook 'emacs-startup-hook #'easysession-load-including-geometry 98)
(add-hook 'emacs-startup-hook #'easysession-save-mode 99))
(add-hook 'emacs-startup-hook #'easysession-load-including-geometry 102)
(add-hook 'emacs-startup-hook #'easysession-save-mode 102))
```

Note that:
- `easysession-load-including-geometry` is not needed after Emacs is loaded if you do not want EasySession to move or resize the Emacs frame when switching sessions. Instead, use `easysession-switch-to` or `easysession-load` to switch to another session or reload the current session without resizing or moving the Emacs frames.
- `easysession-mode-line` determines whether the current session name appears in the mode line by adding EasySession to `mode-line-misc-info`. Alternatively, the `easysession-save-mode-lighter-show-session-name` can be set to `t` to make EasySession display the session name in the lighter.
- The `easysession-save-mode` ensures that the current session is automatically saved every `easysession-save-interval` seconds and when emacs quits.
- The `easysession-save-interval` variable determines the interval between automatic session saves. Setting it to nil disables timer-based autosaving, causing `easysession-save-mode` to save only when Emacs exits.
- I added `102` to `add-hook` to ensure that the session is loaded after everything else. Using `102` is particularly useful for those using [minimal-emacs.d](https://github.com/jamescherti/minimal-emacs.d), where some settings such as `file-name-handler-alist` are restored at depth `101` during `emacs-startup-hook`.

## Usage

Expand Down

0 comments on commit d829a8a

Please sign in to comment.