diff options
author | Noam Postavsky <npostavs@gmail.com> | 2017-06-14 00:08:15 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2017-07-05 22:52:35 -0400 |
commit | e832febfb4089418e0152c805e24dee977a7590d (patch) | |
tree | e57e94068965c89352d735e48d827b6cba83db41 /doc/emacs/programs.texi | |
parent | 018600f896fbed768e583f6b8ee7fbae713367d1 (diff) | |
download | emacs-e832febfb4089418e0152c805e24dee977a7590d.tar.gz emacs-e832febfb4089418e0152c805e24dee977a7590d.tar.bz2 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/emacs/programs.texi')
-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 various major modes. The function is called with no arguments, but with point at the beginning of the comment, or at the end of a line if a new comment is to be inserted. It should return the column in which the -comment ought to start. For example, in Lisp mode, the indent hook -function bases its decision on how many semicolons begin an existing -comment, and on the code in the preceding lines. +comment ought to start. For example, the default hook function bases +its decision on how many comment characters begin an existing comment. + +Emacs also tries to align comments on adjacent lines. To override +this, the function may return a cons of two (possibly equal) integers +to indicate an acceptable range of indentation. @node Documentation @section Documentation Lookup |