From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eNFkJBDrq2GOJAAAgWs5BA (envelope-from ) for ; Sat, 04 Dec 2021 23:26:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wMzpHxDrq2HxMgAAbx9fmQ (envelope-from ) for ; Sat, 04 Dec 2021 22:26:24 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 157AACC19 for ; Sat, 4 Dec 2021 23:26:24 +0100 (CET) Received: from localhost ([::1]:54514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtdU7-0001up-5R for larch@yhetil.org; Sat, 04 Dec 2021 17:26:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtdTh-0001uS-6J for emacs-orgmode@gnu.org; Sat, 04 Dec 2021 17:25:57 -0500 Received: from [2607:f8b0:4864:20::102f] (port=34721 helo=mail-pj1-x102f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtdTf-0001IQ-5f for emacs-orgmode@gnu.org; Sat, 04 Dec 2021 17:25:56 -0500 Received: by mail-pj1-x102f.google.com with SMTP id j5-20020a17090a318500b001a6c749e697so7209775pjb.1 for ; Sat, 04 Dec 2021 14:25:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=u836ptPfc5yfCW8J1jhtBnFbTM1zlqCF2r9Mgw7aW78=; b=khfxuFkFaPy1vfn1yVqf6+D0CckAx3IgIW4Z0QAihRN1k9NIOv9paEg9ydyKiqntv9 5ieb/okPqB9XqD1WzI92EdzC82P+QqSzFAZP+JMMvSBDtSWIAwyiq1RqO2VSavYACWED /f/+fBRSB+LcAJhrfSk33K+VcBfEbp2HjWUkM76EgVTgtKbm/Kj7gnGGlWlRv6sKnpU0 GtipjTpKuo2LHm7LDfjyiAYrdcseV47s8+6cbURMQKoKwWYfIPSkDReyLHqKBjcljRCB 4GMkrccSA0AH9pIvs/Yy1LcG1rj/+uRkoq3xCx+1PasU0MdVYVbn+TXkrrm1lrmBRAUU IKtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=u836ptPfc5yfCW8J1jhtBnFbTM1zlqCF2r9Mgw7aW78=; b=RHlXr/sk1xEDGFrXmdWtZK+Jlwi/+yJzcSYhu8bbHOl9HGWSPrb+cc1Lvd73scJiSQ 1qBtjzOP0J7RLQdIYZDQLTsg5zTamh4NOeeUwPAIaGPVVIHFh0L/aPNvBrbzodvDeQII hZnUn/j//zS+74ct8WIIjixo3W33hfJHQaqwKUE77VoVXWGLqqK/bpFGaMla5kR2gG5d Va9BjJUhZ68WZ90ltFYswhiloWvW6I7QzLKdMBgxCINDT3KEy6aMg0GwV4dd16BHBn81 G/izvdS5fUZhIiaW1/VF94F8x0s+gjSiHZo4iXUJma0llhoO8d4WFKELo2J8nBNrw4NR tdSA== X-Gm-Message-State: AOAM533lHvg/WtaNlH2c6rbvsQXNWR0C+5JHf0mkFVFGKWy3H+gam8wK 3tCQhTzH0qFoHksEPHtzQ3vN5IQecAg= X-Google-Smtp-Source: ABdhPJxRX2MJk1j8CaE1yy3BH+QKvY2glMyPB0A8mx9LUTxc0nzcBL6IM/ibSDyHtbWrW1WdfvGLIw== X-Received: by 2002:a17:90a:e7c2:: with SMTP id kb2mr25202700pjb.200.1638656753610; Sat, 04 Dec 2021 14:25:53 -0800 (PST) Received: from dingbat (2001-44b8-31f2-bb00-ae68-ae3c-97fa-f661.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:ae68:ae3c:97fa:f661]) by smtp.gmail.com with ESMTPSA id 130sm7300393pfu.13.2021.12.04.14.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 14:25:53 -0800 (PST) References: <87lf18fue9.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me> <87v90cpcdx.fsf@yandex.com> <87ilwcf31l.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me> <87pmqjkai3.fsf@gmail.com> <87fsrffknl.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me> <87czmijtrp.fsf@gmail.com> <87o861o9sh.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me> <87h7btpfbt.fsf@gmail.com> <87zgpli5nc.fsf@gmail.com> User-agent: mu4e 1.7.5; emacs 28.0.90 From: Tim Cross To: Kaushal Modi Subject: Re: [PATCH] Fix org-comment-line-break-function Date: Sun, 05 Dec 2021 09:23:18 +1100 In-reply-to: Message-ID: <871r2suhw2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Lawrence , Marco Wahl , emacs-org list , Nicolas Goaziou Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638656784; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=u836ptPfc5yfCW8J1jhtBnFbTM1zlqCF2r9Mgw7aW78=; b=VK2LV2Xc7Iac+FqJB709AZGF4hES/T37wd4Ww/hQ0zWbVvoI0rOTlnkrkJEAmGR0O0JkM4 evzNnrV0x+y1LlbLpEJu9RlO86OcIzPg16pKvoJtAg4czS49nK5Ry6W+ShElSjUC74pezm 2t3TKjz6Nz3gXp7WsXJIEO7xijr3lybk+7ohT+OnwZYlqb2co+igG/3YOBx50Gv7pR+8mn vpfaqIRABy9aBzytYpCToSfy3DVNjrbcgJGzzgtjFam4T0ZB+itSlugL6z0LYMPmkRxJ/b Fmr4D7sjnNYsJq+3DDKHu40ZALo+iPU2hunDpKNhRCzZ1sphPX7Al8iGUq93Hg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638656784; a=rsa-sha256; cv=none; b=ATYwar7mvPtI5Qv3xYloJF0n42GPKh3wlhmvZmA8MhbYSUsDh0a4ITdHkSHJnKdMGkSDtG 77/aTvlKmQEJTVcKjiApbCrdQF97ow1ONCM9JLNdnSdCErmWUxD57KM9MYaL6MtxwmZbGW 7ywXMVO7yrTGAlm/NhiQBUPZWEdhsb6mcYzhszxaOXN0FkVDOblYTzXHy5KRK5QfbeiNdd 1orJwF+WDD7E+veik8C+IAUv0T5xJNTPZ8BhfhejYA0Mt/0HHj5cA6NIcBdcXHP4gdNQII Hl5tJTJy5P32Kt/rkf9PSTEUL/QWu16Z1VEumuwk2O47cm63S+GNaFecDiFBwg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=khfxuFkF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=khfxuFkF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 157AACC19 X-Spam-Score: -0.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: wBZprRMkTvXv Given that Nicholas cannot remember the reason for the original function and suspects it was meant to be an internal only function, I think this patch is probably the best way forward and should be applied. Kaushal Modi writes: > On Tue, Nov 30, 2021 at 6:29 PM Tim Cross wrote: > > It would be good to get Nicholas' input here as I think he wrote the > original function back in 2012. > > Just to see what happens, I tried this: > > M-: (setq-local comment-line-break-function #'comment-indent-new-line) > > .. and then M-j started working perfectly! It worked fine both: in Org comment lines and out of comment lines. > > I see that comment-indent-new-line was added to emacs in newcomment.el back in 2000. So I don't know why > org-comment-line-break-function was added. May be Nicolas can comment more on that. > > So would this patch work? > > ===== > > From 1a9187b82ed8d4e8d54ddd369a44d34295281fc3 Mon Sep 17 00:00:00 2001 > From: Kaushal Modi > Date: Tue, 30 Nov 2021 20:37:10 -0500 > Subject: [PATCH] org: Remove `org-comment-line-break-function' > > * lisp/org.el: Remove `org-comment-line-break-function' and let > `comment-line-break-function' be the default value. > > This fixes the `M-j' binding issue reported by Richard Lawrence in > . > --- > lisp/org.el | 17 ++--------------- > 1 file changed, 2 insertions(+), 15 deletions(-) > > diff --git a/lisp/org.el b/lisp/org.el > index ec59ddf44..ee8ca1f03 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -19624,8 +19624,7 @@ assumed to be significant there." > > ;; `org-auto-fill-function' takes care of auto-filling. It calls > ;; `do-auto-fill' only on valid areas with `fill-prefix' shadowed with > -;; `org-adaptive-fill-function' value. Internally, > -;; `org-comment-line-break-function' breaks the line. > +;; `org-adaptive-fill-function' value. > > ;; `org-setup-filling' installs filling and auto-filling related > ;; variables during `org-mode' initialization. > @@ -19647,8 +19646,7 @@ assumed to be significant there." > (setq-local fill-paragraph-function 'org-fill-paragraph) > (setq-local auto-fill-inhibit-regexp nil) > (setq-local adaptive-fill-function 'org-adaptive-fill-function) > - (setq-local normal-auto-fill-function 'org-auto-fill-function) > - (setq-local comment-line-break-function 'org-comment-line-break-function)) > + (setq-local normal-auto-fill-function 'org-auto-fill-function)) > > (defun org-fill-line-break-nobreak-p () > "Non-nil when a new line at point would create an Org line break." > @@ -19903,17 +19901,6 @@ filling the current element." > (adaptive-fill-mode (not (equal fill-prefix "")))) > (when fill-prefix (do-auto-fill)))))) > > -(defun org-comment-line-break-function (&optional soft) > - "Break line at point and indent, continuing comment if within one. > -The inserted newline is marked hard if variable > -`use-hard-newlines' is true, unless optional argument SOFT is > -non-nil." > - (if soft (insert-and-inherit ?\n) (newline 1)) > - (save-excursion (forward-char -1) (delete-horizontal-space)) > - (delete-horizontal-space) > - (indent-to-left-margin) > - (insert-before-markers-and-inherit fill-prefix)) > - > > ;;; Fixed Width Areas