1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<h3 class="section">Saving Abbrevs in Files</h3> <p>A file of saved abbrev definitions is actually a file of Lisp code. The abbrevs are saved in the form of a Lisp program to define the same abbrev tables with the same contents. Therefore, you can load the file with <code>load</code> (see <a href="how-programs-do-loading">How Programs Do Loading</a>). However, the function <code>quietly-read-abbrev-file</code> is provided as a more convenient interface. Emacs automatically calls this function at startup. </p> <p>User-level facilities such as <code>save-some-buffers</code> can save abbrevs in a file automatically, under the control of variables described here. </p> <dl> <dt id="abbrev-file-name">User Option: <strong>abbrev-file-name</strong>
</dt> <dd><p>This is the default file name for reading and saving abbrevs. By default, Emacs will look for <samp>~/.emacs.d/abbrev_defs</samp>, and, if not found, for <samp>~/.abbrev_defs</samp>; if neither file exists, Emacs will create <samp>~/.emacs.d/abbrev_defs</samp>. </p></dd>
</dl> <dl> <dt id="quietly-read-abbrev-file">Function: <strong>quietly-read-abbrev-file</strong> <em>&optional filename</em>
</dt> <dd>
<p>This function reads abbrev definitions from a file named <var>filename</var>, previously written with <code>write-abbrev-file</code>. If <var>filename</var> is omitted or <code>nil</code>, the file specified in <code>abbrev-file-name</code> is used. </p> <p>As the name implies, this function does not display any messages. </p>
</dd>
</dl> <dl> <dt id="save-abbrevs">User Option: <strong>save-abbrevs</strong>
</dt> <dd><p>A non-<code>nil</code> value for <code>save-abbrevs</code> means that Emacs should offer to save abbrevs (if any have changed) when files are saved. If the value is <code>silently</code>, Emacs saves the abbrevs without asking the user. <code>abbrev-file-name</code> specifies the file to save the abbrevs in. The default value is <code>t</code>. </p></dd>
</dl> <dl> <dt id="abbrevs-changed">Variable: <strong>abbrevs-changed</strong>
</dt> <dd><p>This variable is set non-<code>nil</code> by defining or altering any abbrevs (except system abbrevs). This serves as a flag for various Emacs commands to offer to save your abbrevs. </p></dd>
</dl> <dl> <dt id="write-abbrev-file">Command: <strong>write-abbrev-file</strong> <em>&optional filename</em>
</dt> <dd><p>Save all abbrev definitions (except system abbrevs), for all abbrev tables listed in <code>abbrev-table-name-list</code>, in the file <var>filename</var>, in the form of a Lisp program that when loaded will define the same abbrevs. Tables that do not have any abbrevs to save are omitted. If <var>filename</var> is <code>nil</code> or omitted, <code>abbrev-file-name</code> is used. This function returns <code>nil</code>. </p></dd>
</dl><div class="_attribution">
<p class="_attribution-p">
Copyright © 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/Abbrev-Files.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Abbrev-Files.html</a>
</p>
</div>
|