From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#36702: 27.0.50; newline: don't auto-fill regardless of auto-fill-mode Date: Wed, 17 Jul 2019 13:21:04 +0100 Message-ID: <87ims0hmxb.fsf@tcd.ie> References: <87ef2pj5uh.fsf@tcd.ie> <2cc4b8db-7df9-290d-08dd-044504f9c46f@easy-emacs.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="83149"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 36702@debbugs.gnu.org To: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 17 14:22:09 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hniwi-000LWE-VQ for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Jul 2019 14:22:09 +0200 Original-Received: from localhost ([::1]:56642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hniwh-000797-FN for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Jul 2019 08:22:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57600) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hniwe-00078Q-4O for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 08:22:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hniwc-00081g-RJ for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 08:22:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42823) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hniwc-00081J-9B for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 08:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hniwc-0007qI-2h for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 08:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jul 2019 12:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36702 X-GNU-PR-Package: emacs Original-Received: via spool by 36702-submit@debbugs.gnu.org id=B36702.156336607730096 (code B ref 36702); Wed, 17 Jul 2019 12:22:02 +0000 Original-Received: (at 36702) by debbugs.gnu.org; 17 Jul 2019 12:21:17 +0000 Original-Received: from localhost ([127.0.0.1]:51644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnivs-0007pH-L6 for submit@debbugs.gnu.org; Wed, 17 Jul 2019 08:21:17 -0400 Original-Received: from mail-wr1-f68.google.com ([209.85.221.68]:39611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnivp-0007ou-Dr for 36702@debbugs.gnu.org; Wed, 17 Jul 2019 08:21:15 -0400 Original-Received: by mail-wr1-f68.google.com with SMTP id x4so24560392wrt.6 for <36702@debbugs.gnu.org>; Wed, 17 Jul 2019 05:21:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=72dIW1b2mmbFAqHrlHn/RYAVDyVjlGoX/tZtX5MbtNE=; b=ZfO6w0ETwBPrNnzPKBi0bF7mMRQg7QkGdIsq24MMmiLIVqgXUUlbqabczw9+4Qb0MF YZd4mTJlHrcq5i/cFJqiBaX6DycdZxrz3eg6xzcOsg/nVzi4WnbaYFjpo6WCWKLe66oe NXu4M0AAEpKpSndY+xTX4a/qisZ3bghX3CAVwpKtjspQkkIE7GvRW82Q/DH2old4nW4S /Voyc9XvQPua1U/0++/a8knY3JvtDk6TFd/8uTKZGHV5TnxN1KgtLRq38hh9/yMDfIF9 xFSkUFCVEHCtir72VASv30gTN/b2CrajH3gPifB6X6jlhnDNYrdlySx5OlPYe7yo7+1b /lcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=72dIW1b2mmbFAqHrlHn/RYAVDyVjlGoX/tZtX5MbtNE=; b=crXnucSvKlWxN05jKopR7ee5q0tNG1oW/PGUkdxEqAkboJPq4jTd6lYg7W03PWItf8 j7jUJyG4OLQ+WcF6558XbYXmlOyUQRwAhfypdk2UkboE65ddG5n2Mk6HbayVY+rITeBj ADGAAkT1c00H2EpU8hqveNPHizWcDDTPTis70AKfOsjzTe+PkHBtcGwH3uGr63PkLzfI wzV6odEyZMiH6Y83tpIfk60LCAsK2r8AL4O2wolNLzZ2FZQ97CwCN+icYjCuiHdmww7Y DO2n2yTkZVPDMGpIPiQ0V5JsmILvQfLZuHwW+2veaB7a1kbqniAD0mEp3Mi1TsEMCnCM aWnw== X-Gm-Message-State: APjAAAUVaGSlW6L/uU/kQP2msjnUK3FmKENq16u9od7FhUGVpx2hJmJV 6bmuzDasjeDnAepWygSyPrcfew== X-Google-Smtp-Source: APXvYqw93n6I5TsQ2Yjef31HQmzfNM2k8W3wqJ2WNIERLOZDjxt7T82psmhuZjyesGE+aVagF9Igfw== X-Received: by 2002:adf:9f0e:: with SMTP id l14mr39956643wrf.23.1563366067557; Wed, 17 Jul 2019 05:21:07 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:1f68:7ff5:120d:64e]) by smtp.gmail.com with ESMTPSA id n14sm40647021wra.75.2019.07.17.05.21.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 05:21:06 -0700 (PDT) In-Reply-To: <2cc4b8db-7df9-290d-08dd-044504f9c46f@easy-emacs.de> ("Andreas =?UTF-8?Q?R=C3=B6hler?="'s message of "Wed, 17 Jul 2019 13:02:16 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163238 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable severity 36702 minor found 36702 26.2.90 tags 36702 + patch quit Andreas R=C3=B6hler writes: > On 17.07.19 12:47, Basil L. Contovounesios wrote: > >> The docstring of newline says: >> >> Calls `auto-fill-function' if the current column number is greater >> than the value of `fill-column' and ARG is nil. > > Did you try the test-function delivered? Yes. > It inserts a newline in an empty buffer. > > May that condition being matched then? Ah, are you referring to the condition that the current column number be greater than fill-column? This condition is enforced by the default value of normal-auto-fill-function when auto-fill-mode is enabled, namely do-auto-fill. A different auto-fill-function mightn't enforce it. In general, there are multiple conditions guarding calls to auto-fill-function (see e.g. internal-auto-fill and internal_self_insert), and I'm not sure the docstring of newline is the right place to discuss these things. How's the following clarification for emacs-26 instead? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Clarify-docs-on-newline-and-auto-fill-mode.patch >From 2ed60518cb5d29c0d8c7cc944740c0fecb1713ef Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 17 Jul 2019 13:05:42 +0100 Subject: [PATCH] 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). --- doc/lispref/text.texi | 17 ++++++++++------- lisp/simple.el | 9 +++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index f44659c622..dad6fa2280 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -542,25 +542,28 @@ Commands for Insertion loop handles this function specially. @end deffn -@deffn Command newline &optional number-of-newlines +@deffn Command newline &optional number-of-newlines interactive This command inserts newlines into the current buffer before point. If @var{number-of-newlines} is supplied, that many newline characters -are inserted. +are inserted. In an interactive call, @var{number-of-newlines} is the +numeric prefix argument. @cindex newline and Auto Fill mode -This function calls @code{auto-fill-function} if the current column -number is greater than the value of @code{fill-column} and -@var{number-of-newlines} is @code{nil}. Typically what +This command calls @code{self-insert-command} to insert newlines, +which may subsequently break the preceding line by calling +@code{auto-fill-function} (@pxref{Auto Filling}). Typically what @code{auto-fill-function} does is insert a newline; thus, the overall result in this case is to insert two newlines at different places: one at point, and another earlier in the line. @code{newline} does not auto-fill if @var{number-of-newlines} is non-@code{nil}. +This command does not run the hook @code{post-self-insert-hook} unless +called interactively or @var{interactive} is non-@code{nil}. + This command indents to the left margin if that is not zero. @xref{Margins}. -The value returned is @code{nil}. In an interactive call, @var{count} -is the numeric prefix argument. +The value returned is @code{nil}. @end deffn @defvar overwrite-mode diff --git a/lisp/simple.el b/lisp/simple.el index a0f2da7152..d524d3f0ce 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -427,17 +427,18 @@ newline that it adds, and reindents the preceding line. To just insert a newline, use \\[electric-indent-just-newline]. -Calls `auto-fill-function' if the current column number is greater -than the value of `fill-column' and ARG is nil. +If `auto-fill-mode' is enabled, this may cause automatic line +breaking of the preceding line. A non-nil ARG inhibits this. + A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." (interactive "*P\np") (barf-if-buffer-read-only) - ;; Call self-insert so that auto-fill, abbrev expansion etc. happens. + ;; Call self-insert so that auto-fill, abbrev expansion etc. happen. ;; Set last-command-event to tell self-insert what to insert. (let* ((was-page-start (and (bolp) (looking-at page-delimiter))) (beforepos (point)) (last-command-event ?\n) - ;; Don't auto-fill if we have a numeric argument. + ;; Don't auto-fill if we have a prefix argument. (auto-fill-function (if arg nil auto-fill-function)) (arg (prefix-numeric-value arg)) (postproc -- 2.20.1 --=-=-= Content-Type: text/plain Thanks, -- Basil --=-=-=--