From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mLziMQBapmEfcwEAgWs5BA (envelope-from ) for ; Tue, 30 Nov 2021 18:06:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aAWILQBapmEmJwAAbx9fmQ (envelope-from ) for ; Tue, 30 Nov 2021 17:06:08 +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 398CCAD48 for ; Tue, 30 Nov 2021 18:06:08 +0100 (CET) Received: from localhost ([::1]:47912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ms6Zz-000382-6o for larch@yhetil.org; Tue, 30 Nov 2021 12:06:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms6Y7-0001lO-BJ for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 12:04:11 -0500 Received: from [2001:7c0:300c:3105::8602:5d5] (port=53416 helo=mx03.uni-tuebingen.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms6Y5-0007q5-3u for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 12:04:11 -0500 Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) by mx03.uni-tuebingen.de (Postfix) with ESMTPSA id 332BB20C7CD6; Tue, 30 Nov 2021 18:03:53 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 1DB7B27C005B; Tue, 30 Nov 2021 12:03:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 30 Nov 2021 12:03:46 -0500 X-ME-Sender: X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddriedugdeljecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufgjfhffkfggtgesmhdttdertd dtjeenucfhrhhomheptfhitghhrghrugcunfgrfihrvghntggvuceorhhitghhrghrugdr lhgrfihrvghntggvsehunhhiqdhtuhgvsghinhhgvghnrdguvgeqnecuggftrfgrthhtvg hrnhepheejudekueduffevgefgtedtieelvefghedtiefgvddvgeefieekgfegvdehvdei necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhiflh domhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidquddujeekgeehuddvkedqudel tddvjeelgeegqdhrihgthhgrrhgurdhlrgifrhgvnhgtvgeppehunhhiqdhtuhgvsghinh hgvghnrdguvgesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 30 Nov 2021 12:03:45 -0500 (EST) Received: from rwl by aquinas with local (Exim 4.92) (envelope-from ) id 1ms6Xe-000268-P0; Tue, 30 Nov 2021 18:03:42 +0100 From: Richard Lawrence To: Tim Cross Subject: [PATCH] Fix org-comment-line-break-function (was: Is M-j broken for you in Org on Emacs 27 and 28?) In-Reply-To: <87czmijtrp.fsf@gmail.com> 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> X-Woof-Bug: confirmed Date: Tue, 30 Nov 2021 18:03:42 +0100 Message-ID: <87o861o9sh.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:7c0:300c:3105::8602:5d5 (failed) Received-SPF: pass client-ip=2001:7c0:300c:3105::8602:5d5; envelope-from=richard.lawrence@uni-tuebingen.de; helo=mx03.uni-tuebingen.de X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, 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: emacs-orgmode@gnu.org 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=1638291968; 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; bh=leq9Qhor1eql9W5r8j1AmfqQ/HqbXPQx++yP6Mz0pFA=; b=YZZzNm1ogqUlyANHAsKY8XwOOe2lpd9CVp5dkRmE3vj1QUzqPXrS7SjFle7mBNoyJQeBfD 67AL0sDXotj1LBmzbuE1s0twsOBXKzgdsAZg3J5TurTaQL16F9LyxAST/EUu51bjvbp+xa 1KlD4Bd/0LwsZlWdgs04hq6qtEqQ6hwhXJgHR6eYBjhZjajdKwrI40sosPA+OoPhMNUJwL kMbmZNYzOeE9/6N7ekfxkp8nPJiMjeh3XmCRqBgu0EvIuOCwr6Icn9yxYVXosEVmSpPrNU 0mP/bPhSt0E4jUndg+MI9p/SuJHo/iRi8X/c8yGS/sqve4Wu4w76IZu1EwglPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638291968; a=rsa-sha256; cv=none; b=EZtMQrYnPpwJjZW2LxPrc6v9nt7lRAegARXE7AUhWZIM32JgesHU+ZFSsAcNl5Rup6uGS0 TI5h1FeJRpHkxbGFIR3pRi1ONpkOy8j8T0Daz6a1733KAxH/nVX2GPNamH3s6YHVTZhZhd OnwL4nrrJWy49FCZmx48nWapYpARAnrXW/9EvVg4ai5lsvzpGUycr6IqBxZQwpoTCxgHvK bhRQZ9OuG1spWFohX+2RTvtB5N74OM7M+McqZEwWwrqY+iiNx3erq4PQiLAaPISTPznuiG WRxIIoJxub7QlSaSLX0mO5R7RqaQw8RPnuRTtez1cE9ycRu23wZ9S6XNc6mG1Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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: -3.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: 398CCAD48 X-Spam-Score: -3.01 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6wsvA2+u/C3x --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Tim and all, Thanks for sticking with me here... Tim Cross writes: > I just checked this when running emacs -Q and get the following > > comment-line-break-function is a variable defined in =E2=80=98simple.el= =E2=80=99. > > Its value is =E2=80=98org-comment-line-break-function=E2=80=99 > > and fill-prefix is > > fill-prefix is a variable defined in =E2=80=98simple.el=E2=80=99. > > Its value is nil OK, those are the values I have too... > and I don't get any error with M-j and cannot reproduce the issue you > are encountering. . Do you see an error if you explicitly call (insert-before-markers-and-inherit nil) ? Because that is what org-comment-line-break-function does when fill-prefix is nil. That is the source of the error on all the versions where I have reproduced it. If you don't see the error then, it would indicate to me that something in your setup is suppressing it. > Looking at the git log, I can only find these messages relating to > default-indent-new-line > ... > which indicates the function was added in 2007 by RMS and made the > default for M-j in 2019.=20 Right, which is why I don't see it with M-j in Emacs 26, presumably. Emacs 26.1, the version installed on my Debian system, was released May 28, 2018. > my suspicion is that your org version is too old for the current Emacs > versions... The other possibility is that you have a broken "mixed" > installation of org. I'm aware of the difficulties of a mixed installation and have been careful to avoid them. I run Org from git, usually a recent pull of the bugfix branch, which I load via use-package from my init file. But I have also tested it with the built-in Org for various versions of Emacs with emacs -Q. I do not have Org installed via ELPA. Just to be extra, super sure, I built Emacs this afternoon from a checkout of the repo, and the error is *still* there, with the same cause. In that build, with emacs -Q, I have: (org-version) "9.5" (emacs-version) "GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cair= o version 1.16.0) of 2021-11-30" At this point I've replicated the bug on my machine in four different builds of Emacs (version 26.1 from Debian, 27.2 and "emacs-next" from Guix, and version 29.0.50 I built myself from source) with several versions of Org (the built-in ones in these Emacsen and a recent build of the bugfix branch). It is robustly reproducible for me, and the cause is clear: default-indent-new-line calls org-comment-line-break-function, which calls (insert-before-markers-and-inherit nil) which is a type error. I'm looking for help figuring out what the right fix is. I attach a patch for the simplest fix I can think of; please let me know if something else would be better. --=20 Best, Richard --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org.el.diff diff --git a/lisp/org.el b/lisp/org.el index 1a1375461..fdeec0d67 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -19695,7 +19695,8 @@ non-nil." (save-excursion (forward-char -1) (delete-horizontal-space)) (delete-horizontal-space) (indent-to-left-margin) - (insert-before-markers-and-inherit fill-prefix)) + (when fill-prefix + (insert-before-markers-and-inherit fill-prefix))) ;;; Fixed Width Areas --=-=-=--