How to restore Emacs' windows and buffers from the last session?
How to restore Emacs' windows and buffers from the last session?
The behavior I want is like in web browser that you can restore all the tabs from last session.
windows emacs
add a comment |
How to restore Emacs' windows and buffers from the last session?
The behavior I want is like in web browser that you can restore all the tabs from last session.
windows emacs
1
See the answer to this question.
– Tom
Jan 29 '12 at 6:51
add a comment |
How to restore Emacs' windows and buffers from the last session?
The behavior I want is like in web browser that you can restore all the tabs from last session.
windows emacs
How to restore Emacs' windows and buffers from the last session?
The behavior I want is like in web browser that you can restore all the tabs from last session.
windows emacs
windows emacs
asked Jan 29 '12 at 5:12
qazwsxqazwsx
3,085154771
3,085154771
1
See the answer to this question.
– Tom
Jan 29 '12 at 6:51
add a comment |
1
See the answer to this question.
– Tom
Jan 29 '12 at 6:51
1
1
See the answer to this question.
– Tom
Jan 29 '12 at 6:51
See the answer to this question.
– Tom
Jan 29 '12 at 6:51
add a comment |
3 Answers
3
active
oldest
votes
In addition to automatically restoring your last Emacs session state, you can also save any number of session states and restore them on demand in any other session, any number of times. IOW, you can easily switch among different desktops.
The easiest way to do this is to load library Bookmark+ and use key C-x r K
to save the current session state as a desktop bookmark. You can then restore any desktop bookmark in any session using key C-x j K
.
add a comment |
go to your .emacs file and type (desktop-save-mode 1) this will save all current buffers to a "desktop" file, it wont save the actual layout of your frames but you can look into "registers" for that.
add a comment |
Here's some code to do it. For the code to work, you need the "tapestry" Lisp library installed. If you use the VM mailer, you have the library installed already. Otherwise you can download it from here.
Put the following code in your .emacs file. When you want to restore your window and frame setup from your last Emacs session, type M-x load-my-tapestry RET
.
(require 'tapestry)
(defvar my-tapestry-file "~/.tapestry")
(defun load-my-tapestry ()
(interactive)
(let ((b (find-file-noselect my-tapestry-file)))
(sit-for 0)
(set-tapestry (read b))
(kill-buffer b)))
(defun save-my-tapestry ()
(interactive)
(let ((tap (tapestry)))
(with-temp-buffer
(let ((standard-output (current-buffer)))
(setcar tap (make-list (length (car tap)) nil))
(print tap)
(write-region (point-min) (point-max) my-tapestry-file)))))
(add-hook 'kill-emacs-hook 'save-my-tapestry)
When I doM-x load-my-tapestry RET
, I only got(New file) set-tapestry: End of file during parsing
in mini-buffer and nothing loaded in the Emacs window.
– qazwsx
Jan 29 '12 at 18:03
RunM-x save-my-tapestry
once and the process should be bootstrapped.
– Kyle Jones
Jan 29 '12 at 21:00
Did; then it gaveslet: Wrong type argument: listp, config
error in mini-buffer now.
– qazwsx
Jan 29 '12 at 21:44
Hmmm, there's noconfig
variable in my answer code or in tapestry.el. (setq debug-on-error t) and get a stacktrace. That should indicate where the error is happening.
– Kyle Jones
Jan 29 '12 at 21:59
Actually when I rerun it, I getset-tapestry: End of file during parsing
error again. I opened a Emacs session, opened two frames, and loaded two different files in each of them, thenM-x save-my-tapestry
, then close it. Reopen Emacs, then doM-x load-my-tapestry RET
, it gaveset-tapestry: End of file during parsing
.
– qazwsx
Jan 29 '12 at 22:05
|
show 3 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f383560%2fhow-to-restore-emacs-windows-and-buffers-from-the-last-session%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
In addition to automatically restoring your last Emacs session state, you can also save any number of session states and restore them on demand in any other session, any number of times. IOW, you can easily switch among different desktops.
The easiest way to do this is to load library Bookmark+ and use key C-x r K
to save the current session state as a desktop bookmark. You can then restore any desktop bookmark in any session using key C-x j K
.
add a comment |
In addition to automatically restoring your last Emacs session state, you can also save any number of session states and restore them on demand in any other session, any number of times. IOW, you can easily switch among different desktops.
The easiest way to do this is to load library Bookmark+ and use key C-x r K
to save the current session state as a desktop bookmark. You can then restore any desktop bookmark in any session using key C-x j K
.
add a comment |
In addition to automatically restoring your last Emacs session state, you can also save any number of session states and restore them on demand in any other session, any number of times. IOW, you can easily switch among different desktops.
The easiest way to do this is to load library Bookmark+ and use key C-x r K
to save the current session state as a desktop bookmark. You can then restore any desktop bookmark in any session using key C-x j K
.
In addition to automatically restoring your last Emacs session state, you can also save any number of session states and restore them on demand in any other session, any number of times. IOW, you can easily switch among different desktops.
The easiest way to do this is to load library Bookmark+ and use key C-x r K
to save the current session state as a desktop bookmark. You can then restore any desktop bookmark in any session using key C-x j K
.
edited Feb 12 at 10:57
Qohelet
1034
1034
answered Sep 1 '13 at 21:04
DrewDrew
1,850616
1,850616
add a comment |
add a comment |
go to your .emacs file and type (desktop-save-mode 1) this will save all current buffers to a "desktop" file, it wont save the actual layout of your frames but you can look into "registers" for that.
add a comment |
go to your .emacs file and type (desktop-save-mode 1) this will save all current buffers to a "desktop" file, it wont save the actual layout of your frames but you can look into "registers" for that.
add a comment |
go to your .emacs file and type (desktop-save-mode 1) this will save all current buffers to a "desktop" file, it wont save the actual layout of your frames but you can look into "registers" for that.
go to your .emacs file and type (desktop-save-mode 1) this will save all current buffers to a "desktop" file, it wont save the actual layout of your frames but you can look into "registers" for that.
answered Mar 1 '12 at 13:31
ShantanuShantanu
5821611
5821611
add a comment |
add a comment |
Here's some code to do it. For the code to work, you need the "tapestry" Lisp library installed. If you use the VM mailer, you have the library installed already. Otherwise you can download it from here.
Put the following code in your .emacs file. When you want to restore your window and frame setup from your last Emacs session, type M-x load-my-tapestry RET
.
(require 'tapestry)
(defvar my-tapestry-file "~/.tapestry")
(defun load-my-tapestry ()
(interactive)
(let ((b (find-file-noselect my-tapestry-file)))
(sit-for 0)
(set-tapestry (read b))
(kill-buffer b)))
(defun save-my-tapestry ()
(interactive)
(let ((tap (tapestry)))
(with-temp-buffer
(let ((standard-output (current-buffer)))
(setcar tap (make-list (length (car tap)) nil))
(print tap)
(write-region (point-min) (point-max) my-tapestry-file)))))
(add-hook 'kill-emacs-hook 'save-my-tapestry)
When I doM-x load-my-tapestry RET
, I only got(New file) set-tapestry: End of file during parsing
in mini-buffer and nothing loaded in the Emacs window.
– qazwsx
Jan 29 '12 at 18:03
RunM-x save-my-tapestry
once and the process should be bootstrapped.
– Kyle Jones
Jan 29 '12 at 21:00
Did; then it gaveslet: Wrong type argument: listp, config
error in mini-buffer now.
– qazwsx
Jan 29 '12 at 21:44
Hmmm, there's noconfig
variable in my answer code or in tapestry.el. (setq debug-on-error t) and get a stacktrace. That should indicate where the error is happening.
– Kyle Jones
Jan 29 '12 at 21:59
Actually when I rerun it, I getset-tapestry: End of file during parsing
error again. I opened a Emacs session, opened two frames, and loaded two different files in each of them, thenM-x save-my-tapestry
, then close it. Reopen Emacs, then doM-x load-my-tapestry RET
, it gaveset-tapestry: End of file during parsing
.
– qazwsx
Jan 29 '12 at 22:05
|
show 3 more comments
Here's some code to do it. For the code to work, you need the "tapestry" Lisp library installed. If you use the VM mailer, you have the library installed already. Otherwise you can download it from here.
Put the following code in your .emacs file. When you want to restore your window and frame setup from your last Emacs session, type M-x load-my-tapestry RET
.
(require 'tapestry)
(defvar my-tapestry-file "~/.tapestry")
(defun load-my-tapestry ()
(interactive)
(let ((b (find-file-noselect my-tapestry-file)))
(sit-for 0)
(set-tapestry (read b))
(kill-buffer b)))
(defun save-my-tapestry ()
(interactive)
(let ((tap (tapestry)))
(with-temp-buffer
(let ((standard-output (current-buffer)))
(setcar tap (make-list (length (car tap)) nil))
(print tap)
(write-region (point-min) (point-max) my-tapestry-file)))))
(add-hook 'kill-emacs-hook 'save-my-tapestry)
When I doM-x load-my-tapestry RET
, I only got(New file) set-tapestry: End of file during parsing
in mini-buffer and nothing loaded in the Emacs window.
– qazwsx
Jan 29 '12 at 18:03
RunM-x save-my-tapestry
once and the process should be bootstrapped.
– Kyle Jones
Jan 29 '12 at 21:00
Did; then it gaveslet: Wrong type argument: listp, config
error in mini-buffer now.
– qazwsx
Jan 29 '12 at 21:44
Hmmm, there's noconfig
variable in my answer code or in tapestry.el. (setq debug-on-error t) and get a stacktrace. That should indicate where the error is happening.
– Kyle Jones
Jan 29 '12 at 21:59
Actually when I rerun it, I getset-tapestry: End of file during parsing
error again. I opened a Emacs session, opened two frames, and loaded two different files in each of them, thenM-x save-my-tapestry
, then close it. Reopen Emacs, then doM-x load-my-tapestry RET
, it gaveset-tapestry: End of file during parsing
.
– qazwsx
Jan 29 '12 at 22:05
|
show 3 more comments
Here's some code to do it. For the code to work, you need the "tapestry" Lisp library installed. If you use the VM mailer, you have the library installed already. Otherwise you can download it from here.
Put the following code in your .emacs file. When you want to restore your window and frame setup from your last Emacs session, type M-x load-my-tapestry RET
.
(require 'tapestry)
(defvar my-tapestry-file "~/.tapestry")
(defun load-my-tapestry ()
(interactive)
(let ((b (find-file-noselect my-tapestry-file)))
(sit-for 0)
(set-tapestry (read b))
(kill-buffer b)))
(defun save-my-tapestry ()
(interactive)
(let ((tap (tapestry)))
(with-temp-buffer
(let ((standard-output (current-buffer)))
(setcar tap (make-list (length (car tap)) nil))
(print tap)
(write-region (point-min) (point-max) my-tapestry-file)))))
(add-hook 'kill-emacs-hook 'save-my-tapestry)
Here's some code to do it. For the code to work, you need the "tapestry" Lisp library installed. If you use the VM mailer, you have the library installed already. Otherwise you can download it from here.
Put the following code in your .emacs file. When you want to restore your window and frame setup from your last Emacs session, type M-x load-my-tapestry RET
.
(require 'tapestry)
(defvar my-tapestry-file "~/.tapestry")
(defun load-my-tapestry ()
(interactive)
(let ((b (find-file-noselect my-tapestry-file)))
(sit-for 0)
(set-tapestry (read b))
(kill-buffer b)))
(defun save-my-tapestry ()
(interactive)
(let ((tap (tapestry)))
(with-temp-buffer
(let ((standard-output (current-buffer)))
(setcar tap (make-list (length (car tap)) nil))
(print tap)
(write-region (point-min) (point-max) my-tapestry-file)))))
(add-hook 'kill-emacs-hook 'save-my-tapestry)
answered Jan 29 '12 at 8:57
Kyle JonesKyle Jones
5,58621729
5,58621729
When I doM-x load-my-tapestry RET
, I only got(New file) set-tapestry: End of file during parsing
in mini-buffer and nothing loaded in the Emacs window.
– qazwsx
Jan 29 '12 at 18:03
RunM-x save-my-tapestry
once and the process should be bootstrapped.
– Kyle Jones
Jan 29 '12 at 21:00
Did; then it gaveslet: Wrong type argument: listp, config
error in mini-buffer now.
– qazwsx
Jan 29 '12 at 21:44
Hmmm, there's noconfig
variable in my answer code or in tapestry.el. (setq debug-on-error t) and get a stacktrace. That should indicate where the error is happening.
– Kyle Jones
Jan 29 '12 at 21:59
Actually when I rerun it, I getset-tapestry: End of file during parsing
error again. I opened a Emacs session, opened two frames, and loaded two different files in each of them, thenM-x save-my-tapestry
, then close it. Reopen Emacs, then doM-x load-my-tapestry RET
, it gaveset-tapestry: End of file during parsing
.
– qazwsx
Jan 29 '12 at 22:05
|
show 3 more comments
When I doM-x load-my-tapestry RET
, I only got(New file) set-tapestry: End of file during parsing
in mini-buffer and nothing loaded in the Emacs window.
– qazwsx
Jan 29 '12 at 18:03
RunM-x save-my-tapestry
once and the process should be bootstrapped.
– Kyle Jones
Jan 29 '12 at 21:00
Did; then it gaveslet: Wrong type argument: listp, config
error in mini-buffer now.
– qazwsx
Jan 29 '12 at 21:44
Hmmm, there's noconfig
variable in my answer code or in tapestry.el. (setq debug-on-error t) and get a stacktrace. That should indicate where the error is happening.
– Kyle Jones
Jan 29 '12 at 21:59
Actually when I rerun it, I getset-tapestry: End of file during parsing
error again. I opened a Emacs session, opened two frames, and loaded two different files in each of them, thenM-x save-my-tapestry
, then close it. Reopen Emacs, then doM-x load-my-tapestry RET
, it gaveset-tapestry: End of file during parsing
.
– qazwsx
Jan 29 '12 at 22:05
When I do
M-x load-my-tapestry RET
, I only got (New file) set-tapestry: End of file during parsing
in mini-buffer and nothing loaded in the Emacs window.– qazwsx
Jan 29 '12 at 18:03
When I do
M-x load-my-tapestry RET
, I only got (New file) set-tapestry: End of file during parsing
in mini-buffer and nothing loaded in the Emacs window.– qazwsx
Jan 29 '12 at 18:03
Run
M-x save-my-tapestry
once and the process should be bootstrapped.– Kyle Jones
Jan 29 '12 at 21:00
Run
M-x save-my-tapestry
once and the process should be bootstrapped.– Kyle Jones
Jan 29 '12 at 21:00
Did; then it gaves
let: Wrong type argument: listp, config
error in mini-buffer now.– qazwsx
Jan 29 '12 at 21:44
Did; then it gaves
let: Wrong type argument: listp, config
error in mini-buffer now.– qazwsx
Jan 29 '12 at 21:44
Hmmm, there's no
config
variable in my answer code or in tapestry.el. (setq debug-on-error t) and get a stacktrace. That should indicate where the error is happening.– Kyle Jones
Jan 29 '12 at 21:59
Hmmm, there's no
config
variable in my answer code or in tapestry.el. (setq debug-on-error t) and get a stacktrace. That should indicate where the error is happening.– Kyle Jones
Jan 29 '12 at 21:59
Actually when I rerun it, I get
set-tapestry: End of file during parsing
error again. I opened a Emacs session, opened two frames, and loaded two different files in each of them, then M-x save-my-tapestry
, then close it. Reopen Emacs, then do M-x load-my-tapestry RET
, it gave set-tapestry: End of file during parsing
.– qazwsx
Jan 29 '12 at 22:05
Actually when I rerun it, I get
set-tapestry: End of file during parsing
error again. I opened a Emacs session, opened two frames, and loaded two different files in each of them, then M-x save-my-tapestry
, then close it. Reopen Emacs, then do M-x load-my-tapestry RET
, it gave set-tapestry: End of file during parsing
.– qazwsx
Jan 29 '12 at 22:05
|
show 3 more comments
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f383560%2fhow-to-restore-emacs-windows-and-buffers-from-the-last-session%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
See the answer to this question.
– Tom
Jan 29 '12 at 6:51