blob: d7683901f2383b60e981674a71340c3f76737808 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
;;; init-session.el --- Session management -*- lexical-binding: t; -*-
;; Copyright (C) 2026 Richard Qin
;; SPDX-License-Identifier: GPL-3.0-or-later
;; Author: Richard Qin
;; This file is not part of GNU Emacs.
;;; Commentary:
;; Preserve command history, recently opened files,
;; and cursor positions between Emacs sessions.
;;; Code:
;; ------------------------------------------------------------
;; Command history
;; ------------------------------------------------------------
(require 'savehist)
(setq savehist-file
(expand-file-name
"var/savehist"
user-emacs-directory))
(savehist-mode 1)
;; ------------------------------------------------------------
;; Cursor positions
;; ------------------------------------------------------------
(require 'saveplace)
(setq save-place-file
(expand-file-name
"var/places"
user-emacs-directory))
(save-place-mode 1)
;; ------------------------------------------------------------
;; Recent files
;; ------------------------------------------------------------
(require 'recentf)
(setq recentf-save-file
(expand-file-name
"var/recentf"
user-emacs-directory))
(setq recentf-max-saved-items 200)
(recentf-mode 1)
(provide 'init-session)
;;; init-session.el ends here
|