summaryrefslogtreecommitdiff
path: root/devdocs/elisp/smie-customization.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/smie-customization.html
new repository
Diffstat (limited to 'devdocs/elisp/smie-customization.html')
-rw-r--r--devdocs/elisp/smie-customization.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/devdocs/elisp/smie-customization.html b/devdocs/elisp/smie-customization.html
new file mode 100644
index 00000000..c0d289ee
--- /dev/null
+++ b/devdocs/elisp/smie-customization.html
@@ -0,0 +1,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>&amp;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 &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/SMIE-Customization.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/SMIE-Customization.html</a>
+ </p>
+</div>