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 UIMDJA6hpmEKmwAAgWs5BA (envelope-from ) for ; Tue, 30 Nov 2021 23:09:18 +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 EDB9Hw6hpmGUcwAAbx9fmQ (envelope-from ) for ; Tue, 30 Nov 2021 22:09:18 +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 24B6D136CD for ; Tue, 30 Nov 2021 23:09:18 +0100 (CET) Received: from localhost ([::1]:40966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msBJN-0008TT-97 for larch@yhetil.org; Tue, 30 Nov 2021 17:09:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msBIz-0008TE-4j for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 17:08:53 -0500 Received: from [2a00:1450:4864:20::436] (port=39454 helo=mail-wr1-x436.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1msBIx-0002NS-KA for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 17:08:52 -0500 Received: by mail-wr1-x436.google.com with SMTP id a18so47673308wrn.6 for ; Tue, 30 Nov 2021 14:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EP6BQRFHKrP236M0x2lctx7FKPMCDhoHELu4qoj+GuI=; b=pjAuVJdkTdwspu96YVTiIAjrzBjAZSVYzgurgwQh4qQY5RD8h9aKLYqGlTuMKvCrOR fQlsbWodO/p3AvJf4+0WIyR8GdvqbBJEiRRi/+x2M866oH59/YJHcarNOf0Fgsapb37x ObcIctqVGx+XpwHcR8gPTzcwcl7LtegEzWChWayvWMsNy2a2X4e8CsHl6fLr+ypERHe4 M5ynHAXeHr8FIq0TpkJNUF8kvuY6OJHfawC01Xs/dopZsdyMQiX/4rsRebkIjfDVV4BB rDIp3yAxFmna8kAHJEdCzEI6Z+m0Ucnx6NRlsDyDPtTzeaT2nVt603BTZbc1k5xskkxd anSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EP6BQRFHKrP236M0x2lctx7FKPMCDhoHELu4qoj+GuI=; b=S5Aiqsax0jYwTPh9B3cvv9qpIZViedk8ADyRFH57ZY4jw4UpgR38xWplGQzcpQww9G FVGksFYxB/p2Ht5lHzPzBTmaOIaBHNMVZSYlgodq8ngNt5JFJBW7FAc7nTjC/iGcPIpy rILmc9gVe6qcV6YpZAMRDpj+aEUR0gn4Pu6g85prKG13KfHRGWCCiwhUbpXn5E2PdEoO m8Mmhr1jMx5ZUXfifr7bm3bVrzuxCwWNCB91oaj271hfQ1zvmLc/UdyZ5CSDU/eZcAjb 9+mXmdpNnb9KnmF8hnKANW5q9SFwiyCtJRK1Pm84+qIu4hs4YfqHS7SGAvgOwSpFOvoO 3fPQ== X-Gm-Message-State: AOAM532Ip8i8bLgix16xM1Xo826PCxs3Vi8P6cXzHkRQkoMawAbdXTJ6 1HSWmJAEIbbart1geYLW+qe4E3Bb5TP7NCUpKuc= X-Google-Smtp-Source: ABdhPJyQs+8oEaXlDd0gNnsUA3X06zDHZprXAPJMSyvN698HeBoLt1Lut8m596h0gJFuLykLS/pOfd2I3m8LQoQtjlc= X-Received: by 2002:adf:a319:: with SMTP id c25mr1887494wrb.629.1638310129689; Tue, 30 Nov 2021 14:08:49 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <87h7btpfbt.fsf@gmail.com> From: Kaushal Modi Date: Tue, 30 Nov 2021 17:08:13 -0500 Message-ID: Subject: Re: [PATCH] Fix org-comment-line-break-function To: Marco Wahl Content-Type: multipart/alternative; boundary="0000000000004fe98005d208cd9b" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::436 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=kaushal.modi@gmail.com; helo=mail-wr1-x436.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, HTML_MESSAGE=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 , Tim Cross , emacs-org list 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=1638310158; 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=EP6BQRFHKrP236M0x2lctx7FKPMCDhoHELu4qoj+GuI=; b=lqyT80zNDrqc4wlcae49RVC5I5W36LuTO+aOs4PmSheI3+JqXPE8GaTFwWdxOsiPOx0Rxd 0uzlTv+CSNwwppVMs3d2DBn5mbPreDUHwkiRXftUIpJ2PGGTifGG3njQC5gAhr+3fruNdg mkFL1vgsdpKoY7LvquvDN70VIDqTVY1z4+R8MPwHp7y5Gwg8TAh/Q/wjs2Jhq7agh1mBmT gp7faboljuPB4soYHYnp72duGXicy/HENV8ZvsSpJTjABfgxLEt5MV56m7lcgUGRe5IKAe Qz94aZmtgvOU7I4D+Wtz9QwTebrXD792yhssIsLqs3SR6VtJ1MIaxjjzDUn8Gg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638310158; a=rsa-sha256; cv=none; b=Ab3/LSjV4LLcsYQSPHPIGFtDJev824MrXmT2cLMI0m1uJIj35cldHZQwFiGqfy2QjFu4Fj IDHEL5YeL3f6yxsFmfEpNlR/vkCGR9HYVzcwwD3RrSSPUOLu624jxphKf3DPDcA6vFMmMs mtQjv9HhT2b3RpbPsclro+bNRMNURCRKIO/JIcrZyFVjGd9x3R4o9fLiwjiwafBpFErry8 qGFTycjfKe08PHnNX5mERt1eOH0fDKGTMfGUbcSXYzS9rW2lvWLoGKu/lOj5IkqWQXzRED uOv6i4uYFFai5WSlL7aIjRBD4farupRGk/sT8khv0ZKzGXH2g1xViK1244/Ihw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=pjAuVJdk; 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=pjAuVJdk; 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: 24B6D136CD X-Spam-Score: -4.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: T5pPZLLtlr4Q --0000000000004fe98005d208cd9b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Nov 30, 2021 at 3:20 PM Marco Wahl wrote: > > > 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 am able to reproduce that M-j issue (using Emacs version: GNU Emacs 28.0.60 (build 9, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.12) of 2021-11-29, built using commit c4daff9cf844ec85930bdcd2064787c92c260861, and Org mode version 9.5 (release_9.5-292-g5e35de)). And this patch fixes that for me as well. +1 for applying this patch. =3D=3D=3D=3D=3D Before this patch, M-j gave this backtrace with debug enabled: Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil) insert-before-markers-and-inherit(nil) org-comment-line-break-function(nil) default-indent-new-line(nil t) funcall-interactively(default-indent-new-line nil t) call-interactively(default-indent-new-line nil nil) command-execute(default-indent-new-line) Output of C-h k M-j: M-j runs the command default-indent-new-line (found in global-map), which is an interactive compiled Lisp function in =E2=80=98simple.el=E2=80= =99. It is bound to C-M-j, M-j. (default-indent-new-line &optional SOFT FORCE) Break line at point and indent. If a comment syntax is defined, call =E2=80=98comment-line-break-function= =E2=80=99. The inserted newline is marked hard if variable =E2=80=98use-hard-newlines= =E2=80=99 is true, unless optional argument SOFT is non-nil. --0000000000004fe98005d208cd9b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Tue, Nov 30, 2021 at 3:20 PM Marco Wah= l <marcowahlsoft@gmail.com> wrote:

=C2=A0 =C2=A0 diff --git a/lisp/org.el b/lisp/org.el
=C2=A0 =C2=A0 index 1a1375461..fdeec0d67 100644
=C2=A0 =C2=A0 --- a/lisp/org.el
=C2=A0 =C2=A0 +++ b/lisp/org.el
=C2=A0 =C2=A0 @@ -19695,7 +19695,8 @@ non-nil."
=C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion (forward-char -1) (delete-horizo= ntal-space))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(delete-horizontal-space)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(indent-to-left-margin)
=C2=A0 =C2=A0 -=C2=A0 (insert-before-markers-and-inherit fill-prefix))
=C2=A0 =C2=A0 +=C2=A0 (when fill-prefix
=C2=A0 =C2=A0 +=C2=A0 =C2=A0 (insert-before-markers-and-inherit fill-prefix= )))

I don't have anything better.=C2=A0 I think this is a good patch.=C2=A0= It makes
M-j work again.

Possible refinements and improvements can follow.

+1 for applying of your patch.


=3D=3D=3D=3D=3D

Before this patch, M-j gave this backtrace with debug = enabled:

Debugger entered--Lisp error: (wrong-type= -argument char-or-string-p nil)
=C2=A0 insert-before-markers-and-inherit= (nil)
=C2=A0 org-comment-line-break-function(nil)
=C2=A0 default-inde= nt-new-line(nil t)
=C2=A0 funcall-interactively(default-indent-new-line = nil t)
=C2=A0 call-interactively(default-indent-new-line nil nil)
=C2= =A0 command-execute(default-indent-new-line)


<= /div>
Output of C-h k M-j:

M-j runs the comman= d default-indent-new-line (found in global-map),
which is an interactive= compiled Lisp function in =E2=80=98simple.el=E2=80=99.

It is bound = to C-M-j, M-j.

(default-indent-new-line &optional SOFT FORCE)
Break line at point and indent.
If a comment syntax is defined, cal= l =E2=80=98comment-line-break-function=E2=80=99.

The inserted newlin= e is marked hard if variable =E2=80=98use-hard-newlines=E2=80=99 is true,unless optional argument SOFT is non-nil.

--0000000000004fe98005d208cd9b--