From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AChuMgiopmHbqQAAgWs5BA (envelope-from ) for ; Tue, 30 Nov 2021 23:39:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qIIfLgiopmENZAAA1q6Kng (envelope-from ) for ; Tue, 30 Nov 2021 22:39:04 +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 38ABD13F43 for ; Tue, 30 Nov 2021 23:39:04 +0100 (CET) Received: from localhost ([::1]:47716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msBm9-0005rf-Ml for larch@yhetil.org; Tue, 30 Nov 2021 17:39:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msBlj-0005rW-EC for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 17:38:35 -0500 Received: from [2607:f8b0:4864:20::102c] (port=41861 helo=mail-pj1-x102c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1msBlh-0005g7-W5 for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 17:38:35 -0500 Received: by mail-pj1-x102c.google.com with SMTP id gx15-20020a17090b124f00b001a695f3734aso18691738pjb.0 for ; Tue, 30 Nov 2021 14:38:33 -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=ljsHYkkzrUTjC8aHNZkamsN0OSFtoBXF0yYUULtRhy8=; b=NlIWoPTAbCcsREvUqezz0P1wDIZxJVYBRSPe+iwoU8KUXHmUI8WCNEsU+bTXIJpf8A e4otHJSBILOLL8t1IeMhh0epoCIvfc+WvgHY1MUv/mF2C6nYy9IIj9lOix+dLRiqhFOD bSngw5wN4iPNlcZcaZtXgUl7n21WUFrjSaDILoXN+KKscDEhq0qumB9MiUMzINik1vCR tye9v9Eb6uQ8VO6i3L9Gn0mbp7El3/irnK9McyDYvw786n5s43sM4YjWETMMyRUOOJWw gf/5r0VSaEUCtDStqSSJnIRZAgcJXjcUbciygdxMW6IKXqMerSMbtCf2gvl2aEJYPhQp 7Gag== 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=ljsHYkkzrUTjC8aHNZkamsN0OSFtoBXF0yYUULtRhy8=; b=DuGC+Pi8LuwkS0T5xk8RWp/sWTtPlGKCnEisW8H0gwJcnNFqx1RWeUGdX/vClR4JDg GKdJmDK3WjfIcUmdflLSxphB1h/YRFraj3G6DlSSAl0CMyWVs3625tsYt+XIEXVLo95Q LCrmLEXBIk+UrgDuDUVD13dHtS60Alxg1sY8Km3ugf/O9HvH3DIlcwWKw+VXg3M/yf6V zTFlrkvNOCZ0XLopthsuwUhiIJqstOe0Wiy9cl43xT1KZSfRwRn+UShEoTiSu4HPzt6b FCxmfo6Xl5ngxM98of7DuR9cSqks4Y/2LKKNhJpHedCZAOX8Qo7bwLgRg6AYwoLQ8vZr sWGA== X-Gm-Message-State: AOAM530HUTsgbPlhx9FfkZlp+NZdo8NmLCyiMWOd4JDIWYCIXa54pbjY cfOV0BnK4m4iSRtiCU/pNs75goL5DxU= X-Google-Smtp-Source: ABdhPJy3jmQhCo51p8fwYWRDyHgA7gKRBj77V9bwnRkNGkqebsLrHnFIYX32v2BSV22jNa6F5cOCIA== X-Received: by 2002:a17:90a:df83:: with SMTP id p3mr2342721pjv.145.1638311912403; Tue, 30 Nov 2021 14:38:32 -0800 (PST) Received: from dingbat (2001-44b8-31f2-bb00-e8ca-8918-9bbb-dabb.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:e8ca:8918:9bbb:dabb]) by smtp.gmail.com with ESMTPSA id i1sm3738104pgs.50.2021.11.30.14.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 14:38:31 -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> User-agent: mu4e 1.7.5; emacs 28.0.60 From: Tim Cross To: Marco Wahl Subject: Re: [PATCH] Fix org-comment-line-break-function Date: Wed, 01 Dec 2021 09:06:56 +1100 In-reply-to: <87h7btpfbt.fsf@gmail.com> Message-ID: <874k7tjml8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x102c.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 , 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=1638311944; 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=ljsHYkkzrUTjC8aHNZkamsN0OSFtoBXF0yYUULtRhy8=; b=BUS2rHs6Wt3CORv7Ug6+QMmoabX3qz8QHdvkUTEWTt25UUbv0g/Y+SWuN+gP4UX/8RgI39 zLXk2jbHiOV0Ja9rqjIvpGrnerY71JrrTNb7w57F43ViCni6haSinYn/Vnztaqsk2PzYCX OIo9SxYQfuWaFkkf5AieOIjH87vr0P76Ty91S1V0+43rLFydoeiUOwQKlng9CSQvidgDzi 7Z3TZ6RcaliKuzu78RAqTzGUbNu8MRjaaCjmEl0y8oNX2VCCrNiXrlDiyDAsbgBR9dX9/L F6R1uWArDXRc1UZfCfA20m7E0xSzn8SvXw2W2LTs/E7VYR5WaSf+9WNzdxivSw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638311944; a=rsa-sha256; cv=none; b=a/YBCBQNKj/QwVH1Mgff8fOrBk0oIM4o53ku5afhDGtmyciWXbHLkPFndEmUT8LXBUZ6ST FTYXpB5a1JWmD6DYhp99xFakWJ9Dsq72EfeSlIdydqEwjyjeKsWnxZqAwdN2QIyhohHSjd 4xkhJe5aL6egYkRYOrIjsbWLU6E0CLOSY6CQkTmZZuUTQ0H/qnL14I3F57v7cBH/OpAXvA YZkYQx835hNxxvrZNiR2aVU18sbTg8nnzcUWLLkna+b7eOQcLYrbwsa6eI07HJGzr1VR08 VauKGggdSPEiC8qgTgqJoRf34mRjv3R6cxHVyYe+C5XjixXvDJOHR0F5ebnNEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NlIWoPTA; dmarc=pass (policy=none) header.from=gmail.com; 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: -4.79 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NlIWoPTA; dmarc=pass (policy=none) header.from=gmail.com; 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: 38ABD13F43 X-Spam-Score: -4.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: eR5/cKX4Nrth Marco Wahl writes: > Hi Richard and all, > > [...] > >> 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, cairo 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. > > 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))) > > I don't have anything better. I think this is a good patch. It makes > M-j work again. > > Possible refinements and improvements can follow. > > +1 for applying of your patch. > > I was finally able to reproduce the error. It depends to some degree on the text in the buffer and where the cursor is when you hit M-j. Adding some additional text and moving the cursor to different locations enabled me to reproduce the error and I now agree it is a bug in org-comment-line-break-function. I don't know if your patch is the right fix or not because I don't understand what the purpose of insert-before-marks-and-inherit is - in fact, the doc string for that function doesn't even state what the @rest args argument is for, so I don't understand why it is passing in fill-prefix. For example, is it safe to assume insert-before-merks-and-inherit does not need to be called if fill-prefix is nil? Why is that function even called with the fill-prefix as an argument?