Document new treatment of 'comment-auto-fill-only-comments'

* doc/lispref/text.texi (Auto Filling): Add reference to Emacs
manual.  Add description of 'comment-auto-fill-only-comments'.
* etc/NEWS: Mention new treatment of
'comment-auto-fill-only-comments'.
This commit is contained in:
Martin Rudalics 2017-11-06 08:45:52 +01:00
parent ca2d94ba61
commit 93cd8415b2
2 changed files with 21 additions and 8 deletions

View file

@ -1886,10 +1886,10 @@ prefix or @code{nil}, meaning it has failed to determine a prefix.
@cindex filling, automatic @cindex filling, automatic
@cindex Auto Fill mode @cindex Auto Fill mode
@c FIXME: I don't think any of the variables below is a/an normal/abnormal hook. Auto Fill mode is a minor mode that fills lines automatically as text is
Auto Fill mode is a minor mode that fills lines automatically as text inserted. @xref{Auto Fill,,, emacs, The GNU Emacs Manual}. This
is inserted. This section describes the hook used by Auto Fill mode. section describes some variables used by Auto Fill mode. For a
For a description of functions that you can call explicitly to fill and description of functions that you can call explicitly to fill and
justify existing text, see @ref{Filling}. justify existing text, see @ref{Filling}.
Auto Fill mode also enables the functions that change the margins and Auto Fill mode also enables the functions that change the margins and
@ -1898,11 +1898,11 @@ justification style to refill portions of the text. @xref{Margins}.
@defvar auto-fill-function @defvar auto-fill-function
The value of this buffer-local variable should be a function (of no The value of this buffer-local variable should be a function (of no
arguments) to be called after self-inserting a character from the table arguments) to be called after self-inserting a character from the table
@code{auto-fill-chars}. It may be @code{nil}, in which case nothing @code{auto-fill-chars}, see below. It may be @code{nil}, in which case
special is done in that case. nothing special is done in that case.
The value of @code{auto-fill-function} is @code{do-auto-fill} when The value of @code{auto-fill-function} is @code{do-auto-fill} when Auto
Auto-Fill mode is enabled. That is a function whose sole purpose is to Fill mode is enabled. That is a function whose sole purpose is to
implement the usual strategy for breaking a line. implement the usual strategy for breaking a line.
@end defvar @end defvar
@ -1919,6 +1919,14 @@ self-inserted---space and newline in most language environments. They
have an entry @code{t} in the table. have an entry @code{t} in the table.
@end defvar @end defvar
@defopt comment-auto-fill-only-comments
This variable, if non-@code{nil}, means to fill lines automatically
within comments only. More precisley, this means that if a comment
syntax was defined for the current buffer, then self-inserting a
character outside of a comment will not call @code{auto-fill-function}.
@end defopt
@node Sorting @node Sorting
@section Sorting Text @section Sorting Text
@cindex sorting text @cindex sorting text

View file

@ -1272,6 +1272,11 @@ table implementation. This uses a new bytecode op 'switch', which
isn't compatible with previous Emacs versions. This functionality can isn't compatible with previous Emacs versions. This functionality can
be disabled by setting 'byte-compile-cond-use-jump-table' to nil. be disabled by setting 'byte-compile-cond-use-jump-table' to nil.
+++
** If 'comment-auto-fill-only-comments' is non-nil, 'auto-fill-function'
is now called only if either no comment syntax is defined for the
current buffer or the self-insertion takes place within a comment.
--- ---
** The alist 'ucs-names' is now a hash table. ** The alist 'ucs-names' is now a hash table.