diff options
| author | Noam Postavsky | 2017-06-14 00:08:15 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-07-05 22:52:35 -0400 |
| commit | e832febfb4089418e0152c805e24dee977a7590d (patch) | |
| tree | e57e94068965c89352d735e48d827b6cba83db41 /doc | |
| parent | 018600f896fbed768e583f6b8ee7fbae713367d1 (diff) | |
| download | emacs-e832febfb4089418e0152c805e24dee977a7590d.tar.gz emacs-e832febfb4089418e0152c805e24dee977a7590d.zip | |
Allow comment-indent-functions to specify exact indentation (Bug#385)
* lisp/newcomment.el (comment-choose-indent): Interpret a cons of two
integers as indicating a range of acceptable indentation.
(comment-indent): Don't apply `comment-inline-offset',
`comment-choose-indent' already does that.
(comment-indent-function):
* doc/emacs/programs.texi (Options for Comments): Document new
acceptable return values.
* etc/NEWS: Announce it.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/programs.texi | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 222d1c2a4de..27ac0eb6400 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -1146,9 +1146,12 @@ comment or for aligning an existing comment. It is set differently by | |||
| 1146 | various major modes. The function is called with no arguments, but with | 1146 | various major modes. The function is called with no arguments, but with |
| 1147 | point at the beginning of the comment, or at the end of a line if a new | 1147 | point at the beginning of the comment, or at the end of a line if a new |
| 1148 | comment is to be inserted. It should return the column in which the | 1148 | comment is to be inserted. It should return the column in which the |
| 1149 | comment ought to start. For example, in Lisp mode, the indent hook | 1149 | comment ought to start. For example, the default hook function bases |
| 1150 | function bases its decision on how many semicolons begin an existing | 1150 | its decision on how many comment characters begin an existing comment. |
| 1151 | comment, and on the code in the preceding lines. | 1151 | |
| 1152 | Emacs also tries to align comments on adjacent lines. To override | ||
| 1153 | this, the function may return a cons of two (possibly equal) integers | ||
| 1154 | to indicate an acceptable range of indentation. | ||
| 1152 | 1155 | ||
| 1153 | @node Documentation | 1156 | @node Documentation |
| 1154 | @section Documentation Lookup | 1157 | @section Documentation Lookup |