aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorNoam Postavsky2017-06-14 00:08:15 -0400
committerNoam Postavsky2017-07-05 22:52:35 -0400
commite832febfb4089418e0152c805e24dee977a7590d (patch)
treee57e94068965c89352d735e48d827b6cba83db41 /doc
parent018600f896fbed768e583f6b8ee7fbae713367d1 (diff)
downloademacs-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.texi9
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
1146various major modes. The function is called with no arguments, but with 1146various major modes. The function is called with no arguments, but with
1147point at the beginning of the comment, or at the end of a line if a new 1147point at the beginning of the comment, or at the end of a line if a new
1148comment is to be inserted. It should return the column in which the 1148comment is to be inserted. It should return the column in which the
1149comment ought to start. For example, in Lisp mode, the indent hook 1149comment ought to start. For example, the default hook function bases
1150function bases its decision on how many semicolons begin an existing 1150its decision on how many comment characters begin an existing comment.
1151comment, and on the code in the preceding lines. 1151
1152Emacs also tries to align comments on adjacent lines. To override
1153this, the function may return a cons of two (possibly equal) integers
1154to indicate an acceptable range of indentation.
1152 1155
1153@node Documentation 1156@node Documentation
1154@section Documentation Lookup 1157@section Documentation Lookup