summaryrefslogtreecommitdiff
path: root/devdocs/elisp/desktop-save-mode.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/desktop-save-mode.html
new repository
Diffstat (limited to 'devdocs/elisp/desktop-save-mode.html')
-rw-r--r--devdocs/elisp/desktop-save-mode.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/devdocs/elisp/desktop-save-mode.html b/devdocs/elisp/desktop-save-mode.html
new file mode 100644
index 00000000..b614f0bf
--- /dev/null
+++ b/devdocs/elisp/desktop-save-mode.html
@@ -0,0 +1,19 @@
+ <h3 class="section">Desktop Save Mode</h3> <p><em>Desktop Save Mode</em> is a feature to save the state of Emacs from one session to another. The user-level commands for using Desktop Save Mode are described in the GNU Emacs Manual (see <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html#Saving-Emacs-Sessions">Saving Emacs Sessions</a> in <cite>the GNU Emacs Manual</cite>). Modes whose buffers visit a file, don’t have to do anything to use this feature. </p> <p>For buffers not visiting a file to have their state saved, the major mode must bind the buffer local variable <code>desktop-save-buffer</code> to a non-<code>nil</code> value. </p> <dl> <dt id="desktop-save-buffer">Variable: <strong>desktop-save-buffer</strong>
+</dt> <dd>
+<p>If this buffer-local variable is non-<code>nil</code>, the buffer will have its state saved in the desktop file at desktop save. If the value is a function, it is called at desktop save with argument <var>desktop-dirname</var>, and its value is saved in the desktop file along with the state of the buffer for which it was called. When file names are returned as part of the auxiliary information, they should be formatted using the call </p> <div class="example"> <pre class="example">(desktop-file-name <var>file-name</var> <var>desktop-dirname</var>)
+</pre>
+</div> </dd>
+</dl> <p>For buffers not visiting a file to be restored, the major mode must define a function to do the job, and that function must be listed in the alist <code>desktop-buffer-mode-handlers</code>. </p> <dl> <dt id="desktop-buffer-mode-handlers">Variable: <strong>desktop-buffer-mode-handlers</strong>
+</dt> <dd>
+<p>Alist with elements </p> <div class="example"> <pre class="example">(<var>major-mode</var> . <var>restore-buffer-function</var>)
+</pre>
+</div> <p>The function <var>restore-buffer-function</var> will be called with argument list </p> <div class="example"> <pre class="example">(<var>buffer-file-name</var> <var>buffer-name</var> <var>desktop-buffer-misc</var>)
+</pre>
+</div> <p>and it should return the restored buffer. Here <var>desktop-buffer-misc</var> is the value returned by the function optionally bound to <code>desktop-save-buffer</code>. </p>
+</dd>
+</dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Desktop-Save-Mode.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Desktop-Save-Mode.html</a>
+ </p>
+</div>