blob: c0d289eeafb0d9de81cdda0059e52c248313f0a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<h4 class="subsubsection">Customizing Indentation</h4> <p>If you are using a mode whose indentation is provided by SMIE, you can customize the indentation to suit your preferences. You can do this on a per-mode basis (using the option <code>smie-config</code>), or a per-file basis (using the function <code>smie-config-local</code> in a file-local variable specification). </p> <dl> <dt id="smie-config">User Option: <strong>smie-config</strong>
</dt> <dd><p>This option lets you customize indentation on a per-mode basis. It is an alist with elements of the form <code>(<var>mode</var> . <var>rules</var>)</code>. For the precise form of rules, see the variable’s documentation; but you may find it easier to use the command <code>smie-config-guess</code>. </p></dd>
</dl> <dl> <dt id="smie-config-guess">Command: <strong>smie-config-guess</strong>
</dt> <dd><p>This command tries to work out appropriate settings to produce your preferred style of indentation. Simply call the command while visiting a file that is indented with your style. </p></dd>
</dl> <dl> <dt id="smie-config-save">Command: <strong>smie-config-save</strong>
</dt> <dd><p>Call this command after using <code>smie-config-guess</code>, to save your settings for future sessions. </p></dd>
</dl> <dl> <dt id="smie-config-show-indent">Command: <strong>smie-config-show-indent</strong> <em>&optional move</em>
</dt> <dd><p>This command displays the rules that are used to indent the current line. </p></dd>
</dl> <dl> <dt id="smie-config-set-indent">Command: <strong>smie-config-set-indent</strong>
</dt> <dd><p>This command adds a local rule to adjust the indentation of the current line. </p></dd>
</dl> <dl> <dt id="smie-config-local">Function: <strong>smie-config-local</strong> <em>rules</em>
</dt> <dd><p>This function adds <var>rules</var> as indentation rules for the current buffer. These add to any mode-specific rules defined by the <code>smie-config</code> option. To specify custom indentation rules for a specific file, add an entry to the file’s local variables of the form: <code>eval: (smie-config-local '(<var>rules</var>))</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/SMIE-Customization.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/SMIE-Customization.html</a>
</p>
</div>
|