diff options
| author | Basil L. Contovounesios | 2019-07-17 13:05:42 +0100 |
|---|---|---|
| committer | Basil L. Contovounesios | 2019-10-08 00:10:19 +0100 |
| commit | 373ffc59317cb96e253a0b0939b921e9172b44ff (patch) | |
| tree | 8fbe9721a18f5f5e21ccc7932528075f82d45bbb | |
| parent | 3f9ad4e725788dff5eaafc4678286c9386302a17 (diff) | |
| download | emacs-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.texi | 17 | ||||
| -rw-r--r-- | lisp/simple.el | 9 |
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 | |||
| 545 | loop handles this function specially. | 545 | loop 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 |
| 549 | This command inserts newlines into the current buffer before point. | 549 | This command inserts newlines into the current buffer before point. |
| 550 | If @var{number-of-newlines} is supplied, that many newline characters | 550 | If @var{number-of-newlines} is supplied, that many newline characters |
| 551 | are inserted. | 551 | are inserted. In an interactive call, @var{number-of-newlines} is the |
| 552 | numeric prefix argument. | ||
| 552 | 553 | ||
| 553 | @cindex newline and Auto Fill mode | 554 | @cindex newline and Auto Fill mode |
| 554 | This function calls @code{auto-fill-function} if the current column | 555 | This command calls @code{self-insert-command} to insert newlines, |
| 555 | number is greater than the value of @code{fill-column} and | 556 | which 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 |
| 558 | result in this case is to insert two newlines at different places: one | 559 | result in this case is to insert two newlines at different places: one |
| 559 | at point, and another earlier in the line. @code{newline} does not | 560 | at point, and another earlier in the line. @code{newline} does not |
| 560 | auto-fill if @var{number-of-newlines} is non-@code{nil}. | 561 | auto-fill if @var{number-of-newlines} is non-@code{nil}. |
| 561 | 562 | ||
| 563 | This command does not run the hook @code{post-self-insert-hook} unless | ||
| 564 | called interactively or @var{interactive} is non-@code{nil}. | ||
| 565 | |||
| 562 | This command indents to the left margin if that is not zero. | 566 | This command indents to the left margin if that is not zero. |
| 563 | @xref{Margins}. | 567 | @xref{Margins}. |
| 564 | 568 | ||
| 565 | The value returned is @code{nil}. In an interactive call, @var{count} | 569 | The value returned is @code{nil}. |
| 566 | is 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 | |||
| 500 | that it adds, and reindents the preceding line. To just insert | 500 | that it adds, and reindents the preceding line. To just insert |
| 501 | a newline, use \\[electric-indent-just-newline]. | 501 | a newline, use \\[electric-indent-just-newline]. |
| 502 | 502 | ||
| 503 | Calls `auto-fill-function' if the current column number is greater | 503 | If `auto-fill-mode' is enabled, this may cause automatic line |
| 504 | than the value of `fill-column' and ARG is nil. | 504 | breaking of the preceding line. A non-nil ARG inhibits this. |
| 505 | |||
| 505 | A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." | 506 | A 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 |