diff options
| author | Glenn Morris | 2014-03-04 23:41:48 -0800 |
|---|---|---|
| committer | Glenn Morris | 2014-03-04 23:41:48 -0800 |
| commit | 47b73b35c175c76c04da553046cf53f22ba3d2df (patch) | |
| tree | 543f51de2161bc0085163479b37344df35d0362c | |
| parent | 65cdacb51ba7324c19adb7c18581fc5cb1402c94 (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 47 | ||||
| -rw-r--r-- | etc/NEWS | 8 |
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 @@ | |||
| 1 | 2014-03-05 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * modes.texi (SMIE Customization): New section. | ||
| 4 | * elisp.texi (Top): Update detailed menu. | ||
| 5 | |||
| 1 | 2014-03-04 Martin Rudalics <rudalics@gmx.at> | 6 | 2014-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 | ||
| 907 | Documentation | 908 | Documentation |
| 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 | |||
| 3961 | first @code{"if"} of the sequence. | 3962 | first @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 | |||
| 3969 | If you are using a mode whose indentation is provided by SMIE, you can | ||
| 3970 | customize the indentation to suit your preferences. You can do this | ||
| 3971 | on a per-mode basis (using the option @code{smie-config}), or a | ||
| 3972 | per-file basis (using the function @code{smie-config-local} in a | ||
| 3973 | file-local variable specification). | ||
| 3974 | |||
| 3975 | @defopt smie-config | ||
| 3976 | This option lets you customize indentation on a per-mode basis. | ||
| 3977 | It is an alist with elements of the form @code{(@var{mode} . @var{rules})}. | ||
| 3978 | For the precise form of rules, see the variable's documentation; but | ||
| 3979 | you may find it easier to use the command @code{smie-config-guess}. | ||
| 3980 | @end defopt | ||
| 3981 | |||
| 3982 | @deffn Command smie-config-guess | ||
| 3983 | This command tries to work out appropriate settings to produce | ||
| 3984 | your preferred style of indentation. Simply call the command while | ||
| 3985 | visiting a file that is indented with your style. | ||
| 3986 | @end deffn | ||
| 3987 | |||
| 3988 | @deffn Command smie-config-save | ||
| 3989 | Call this command after using @code{smie-config-guess}, to save your | ||
| 3990 | settings for future sessions. | ||
| 3991 | @end deffn | ||
| 3992 | |||
| 3993 | @deffn Command smie-config-show-indent &optional move | ||
| 3994 | This command displays the rules that are used to indent the current | ||
| 3995 | line. | ||
| 3996 | @end deffn | ||
| 3997 | |||
| 3998 | @deffn Command smie-config-set-indent | ||
| 3999 | This command adds a local rule to adjust the indentation of the current line. | ||
| 4000 | @end deffn | ||
| 4001 | |||
| 4002 | @defun smie-config-local rules | ||
| 4003 | This function adds @var{rules} as indentation rules for the current buffer. | ||
| 4004 | These add to any mode-specific rules defined by the @code{smie-config} option. | ||
| 4005 | To specify custom indentation rules for a specific file, add an entry | ||
| 4006 | to 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 |
| @@ -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'. | ||
| 908 | The command `smie-config-guess' can help you derive the appropriate | 909 | The command `smie-config-guess' can help you derive the appropriate |
| 909 | indentation settings, if you provide it with an indented sample file. | 910 | indentation settings, if you provide it with an indented sample file. |
| 910 | Use `smie-config-save' to save the result. | 911 | Use `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 | ||
| 915 | the 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 | --- |