我通常同时处理 3-4 个不同的项目。所以我试图弄清楚如何让emacs从我打开emacs的文件夹中加载桌面,并在我退出该emacs实例时保存到该文件。
我看到的所有文档都描述了如何让 emacs 从默认位置自动打开和保存(这使得多个桌面成为不可能),或者手动加载桌面并将其保存到特定目录(我现在正在这样做)。
谢谢!
最佳答案
把它放到你的 .emacs 中:
(setq your-own-path default-directory)
(if (file-exists-p
(concat your-own-path ".emacs.desktop"))
(desktop-read your-own-path))
(add-hook 'kill-emacs-hook
`(lambda ()
(desktop-save ,your-own-path t)))
更新:v. 2,按需忽略。
(setq your-own-path default-directory)
(if (file-exists-p
(concat your-own-path ".emacs.desktop"))
(if (y-or-n-p "Read .emacs.desktop and add hook?")
(progn
(desktop-read your-own-path)
(add-hook 'kill-emacs-hook
`(lambda ()
(desktop-save ,your-own-path t))))))
关于emacs - 如何让emacs从初始目录自动加载和保存桌面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24921390/