Reputation: 6200
I am new to emacs and have been referencing the tutorial frequently in the course of editing my file.
To go to the tutorial from within the file I am editing, I do: C-h t
.
After consulting the tutorial I am ready to close it to return to my file.
I do C-x C-c
.
But then I need to open my file once again, doing emacs <file>
to return to it.
I am looking for a faster way. Is there an emacs command which will close the tutorial, immediately returning me to the file from which I opened it?
Upvotes: 2
Views: 1031
Reputation: 16993
As @torazaburo mentions, if you really want close the tutorial, you can use C-x k
(AKA kill-buffer
) to close/kill the tutorial buffer. However, in this case you will first be asked if you want to save your position in the tutorial, and you will be asked if you want to pick up where you left off next time you do C-h t
. You may find this tedious depending on how frequently you switch.
Since you mention that you reference the tutorial frequently, in some cases it might be a better option to simply switch back and forth between the buffer you are editing and the tutorial, rather than opening and closing the tutorial.
One way to do this would be to use C-x b
(AKA switch-buffer
) where the last buffer you visited will be the default buffer to switch to, so you can use C-x b RET
to toggle between your tutorial buffer and the buffer you are editing without loosing your place in either.
Another similar option is to use C-x
followed by the right or left arrows to cycle between the buffers: C-x
and left to go from your tutorial buffer back to your edit buffer, and C-x
right to go back to the tutorial.
However, note that one downside to the methods I describe above is that, while switching away from the tutorial buffer and back to it will save your position for that session, it will not save it for future sessions. If you then use C-x C-c
to quit Emacs and open the tutorial again, you will have to find your place if you have not saved recently. C-x k
has the advantage of prompting you to save each time, but also has the disadvantage that it prompts you each time, i.e., if you are constantly switching back and forth, you may not want to answer yes or no each time. Choose the solution that works best for you.
Upvotes: 1