aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBasil L. Contovounesios2019-07-17 13:05:42 +0100
committerBasil L. Contovounesios2019-10-08 00:10:19 +0100
commit373ffc59317cb96e253a0b0939b921e9172b44ff (patch)
tree8fbe9721a18f5f5e21ccc7932528075f82d45bbb
parent3f9ad4e725788dff5eaafc4678286c9386302a17 (diff)
downloademacs-373ffc59317cb96e253a0b0939b921e9172b44ff.tar.gz
emacs-373ffc59317cb96e253a0b0939b921e9172b44ff.zip
Clarify docs on newline and auto-fill-mode
* doc/lispref/text.texi (Commands for Insertion): * lisp/simple.el (newline): Do not mention conditions specific to 'do-auto-fill' under documentation of 'newline' (bug#36702).
-rw-r--r--doc/lispref/text.texi17
-rw-r--r--lisp/simple.el9
2 files changed, 15 insertions, 11 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 8d78a9b24ff..ef1d8ebc571 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -545,25 +545,28 @@ Do not try substituting your own definition of
545loop handles this function specially. 545loop handles this function specially.
546@end deffn 546@end deffn
547 547
548@deffn Command newline &optional number-of-newlines 548@deffn Command newline &optional number-of-newlines interactive
549This command inserts newlines into the current buffer before point. 549This command inserts newlines into the current buffer before point.
550If @var{number-of-newlines} is supplied, that many newline characters 550If @var{number-of-newlines} is supplied, that many newline characters
551are inserted. 551are inserted. In an interactive call, @var{number-of-newlines} is the
552numeric prefix argument.
552 553
553@cindex newline and Auto Fill mode 554@cindex newline and Auto Fill mode
554This function calls @code{auto-fill-function} if the current column 555This command calls @code{self-insert-command} to insert newlines,
555number is greater than the value of @code{fill-column} and 556which may subsequently break the preceding line by calling
556@var{number-of-newlines} is @code{nil}. Typically what 557@code{auto-fill-function} (@pxref{Auto Filling}). Typically what
557@code{auto-fill-function} does is insert a newline; thus, the overall 558@code{auto-fill-function} does is insert a newline; thus, the overall
558result in this case is to insert two newlines at different places: one 559result in this case is to insert two newlines at different places: one
559at point, and another earlier in the line. @code{newline} does not 560at point, and another earlier in the line. @code{newline} does not
560auto-fill if @var{number-of-newlines} is non-@code{nil}. 561auto-fill if @var{number-of-newlines} is non-@code{nil}.
561 562
563This command does not run the hook @code{post-self-insert-hook} unless
564called interactively or @var{interactive} is non-@code{nil}.
565
562This command indents to the left margin if that is not zero. 566This command indents to the left margin if that is not zero.
563@xref{Margins}. 567@xref{Margins}.
564 568
565The value returned is @code{nil}. In an interactive call, @var{count} 569The value returned is @code{nil}.
566is the numeric prefix argument.
567@end deffn 570@end deffn
568 571
569@defvar overwrite-mode 572@defvar overwrite-mode
diff --git a/lisp/simple.el b/lisp/simple.el
index ecd7eb797e8..b5205dd7648 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -500,17 +500,18 @@ If `electric-indent-mode' is enabled, this indents the final new line
500that it adds, and reindents the preceding line. To just insert 500that it adds, and reindents the preceding line. To just insert
501a newline, use \\[electric-indent-just-newline]. 501a newline, use \\[electric-indent-just-newline].
502 502
503Calls `auto-fill-function' if the current column number is greater 503If `auto-fill-mode' is enabled, this may cause automatic line
504than the value of `fill-column' and ARG is nil. 504breaking of the preceding line. A non-nil ARG inhibits this.
505
505A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." 506A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
506 (interactive "*P\np") 507 (interactive "*P\np")
507 (barf-if-buffer-read-only) 508 (barf-if-buffer-read-only)
508 ;; Call self-insert so that auto-fill, abbrev expansion etc. happens. 509 ;; Call self-insert so that auto-fill, abbrev expansion etc. happen.
509 ;; Set last-command-event to tell self-insert what to insert. 510 ;; Set last-command-event to tell self-insert what to insert.
510 (let* ((was-page-start (and (bolp) (looking-at page-delimiter))) 511 (let* ((was-page-start (and (bolp) (looking-at page-delimiter)))
511 (beforepos (point)) 512 (beforepos (point))
512 (last-command-event ?\n) 513 (last-command-event ?\n)
513 ;; Don't auto-fill if we have a numeric argument. 514 ;; Don't auto-fill if we have a prefix argument.
514 (auto-fill-function (if arg nil auto-fill-function)) 515 (auto-fill-function (if arg nil auto-fill-function))
515 (arg (prefix-numeric-value arg)) 516 (arg (prefix-numeric-value arg))
516 (postproc 517 (postproc