aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-03-04 23:41:48 -0800
committerGlenn Morris2014-03-04 23:41:48 -0800
commit47b73b35c175c76c04da553046cf53f22ba3d2df (patch)
tree543f51de2161bc0085163479b37344df35d0362c
parent65cdacb51ba7324c19adb7c18581fc5cb1402c94 (diff)
downloademacs-47b73b35c175c76c04da553046cf53f22ba3d2df.tar.gz
emacs-47b73b35c175c76c04da553046cf53f22ba3d2df.zip
Try to document some smie changes
* doc/lispref/modes.texi (SMIE Customization): New section. * doc/lispref/elisp.texi (Top): Update detailed menu. * etc/NEWS: Related edits.
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/elisp.texi1
-rw-r--r--doc/lispref/modes.texi47
-rw-r--r--etc/NEWS8
4 files changed, 60 insertions, 1 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index d50ba585c31..1a76554dd55 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12014-03-05 Glenn Morris <rgm@gnu.org>
2
3 * modes.texi (SMIE Customization): New section.
4 * elisp.texi (Top): Update detailed menu.
5
12014-03-04 Martin Rudalics <rudalics@gmx.at> 62014-03-04 Martin Rudalics <rudalics@gmx.at>
2 7
3 * windows.texi (Windows and Frames): Add some missing &optional 8 * windows.texi (Windows and Frames): Add some missing &optional
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index a0f447f94f4..8442c3dbcfe 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -903,6 +903,7 @@ Simple Minded Indentation Engine
903* SMIE Indentation:: Specifying indentation rules. 903* SMIE Indentation:: Specifying indentation rules.
904* SMIE Indentation Helpers:: Helper functions for indentation rules. 904* SMIE Indentation Helpers:: Helper functions for indentation rules.
905* SMIE Indentation Example:: Sample indentation rules. 905* SMIE Indentation Example:: Sample indentation rules.
906* SMIE Customization:: Customizing indentation.
906 907
907Documentation 908Documentation
908 909
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index e12d00a5b59..30b0f758c27 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -3383,6 +3383,7 @@ resorting to some special tricks (@pxref{SMIE Tricks}).
3383* SMIE Indentation:: Specifying indentation rules. 3383* SMIE Indentation:: Specifying indentation rules.
3384* SMIE Indentation Helpers:: Helper functions for indentation rules. 3384* SMIE Indentation Helpers:: Helper functions for indentation rules.
3385* SMIE Indentation Example:: Sample indentation rules. 3385* SMIE Indentation Example:: Sample indentation rules.
3386* SMIE Customization:: Customizing indentation.
3386@end menu 3387@end menu
3387 3388
3388@node SMIE setup 3389@node SMIE setup
@@ -3961,6 +3962,52 @@ the previous @code{"else"}, rather than going all the way back to the
3961first @code{"if"} of the sequence. 3962first @code{"if"} of the sequence.
3962@end itemize 3963@end itemize
3963 3964
3965@c In some sense this belongs more in the Emacs manual.
3966@node SMIE Customization
3967@subsubsection Customizing Indentation
3968
3969If you are using a mode whose indentation is provided by SMIE, you can
3970customize the indentation to suit your preferences. You can do this
3971on a per-mode basis (using the option @code{smie-config}), or a
3972per-file basis (using the function @code{smie-config-local} in a
3973file-local variable specification).
3974
3975@defopt smie-config
3976This option lets you customize indentation on a per-mode basis.
3977It is an alist with elements of the form @code{(@var{mode} . @var{rules})}.
3978For the precise form of rules, see the variable's documentation; but
3979you may find it easier to use the command @code{smie-config-guess}.
3980@end defopt
3981
3982@deffn Command smie-config-guess
3983This command tries to work out appropriate settings to produce
3984your preferred style of indentation. Simply call the command while
3985visiting a file that is indented with your style.
3986@end deffn
3987
3988@deffn Command smie-config-save
3989Call this command after using @code{smie-config-guess}, to save your
3990settings for future sessions.
3991@end deffn
3992
3993@deffn Command smie-config-show-indent &optional move
3994This command displays the rules that are used to indent the current
3995line.
3996@end deffn
3997
3998@deffn Command smie-config-set-indent
3999This command adds a local rule to adjust the indentation of the current line.
4000@end deffn
4001
4002@defun smie-config-local rules
4003This function adds @var{rules} as indentation rules for the current buffer.
4004These add to any mode-specific rules defined by the @code{smie-config} option.
4005To specify custom indentation rules for a specific file, add an entry
4006to the file's local variables of the form:
4007@code{eval: (smie-config-local '(@var{rules}))}.
4008@end defun
4009
4010
3964@node Desktop Save Mode 4011@node Desktop Save Mode
3965@section Desktop Save Mode 4012@section Desktop Save Mode
3966@cindex desktop save mode 4013@cindex desktop save mode
diff --git a/etc/NEWS b/etc/NEWS
index 24b3f16556a..52fc2769cf7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -904,11 +904,17 @@ All non-ancient Bash versions support this option.
904 904
905** SMIE 905** SMIE
906 906
907*** You can customize the indentation of modes that use SMIE via `smie-config'. 907+++
908*** You can customize the SMIE indentation of a mode via `smie-config'.
908The command `smie-config-guess' can help you derive the appropriate 909The command `smie-config-guess' can help you derive the appropriate
909indentation settings, if you provide it with an indented sample file. 910indentation settings, if you provide it with an indented sample file.
910Use `smie-config-save' to save the result. 911Use `smie-config-save' to save the result.
911 912
913+++
914*** You can customize the SMIE indentation of a file by adding an entry to
915the file's local variables of the form: `eval: (smie-config-local '(RULES)'.
916
917+++
912*** New commands `smie-config-show-indent' and `smie-config-set-indent'. 918*** New commands `smie-config-show-indent' and `smie-config-set-indent'.
913 919
914--- 920---