[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix org-comment-line-break-function
From: |
Marco Wahl |
Subject: |
Re: [PATCH] Fix org-comment-line-break-function |
Date: |
Tue, 30 Nov 2021 21:18:46 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
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.
Ciao,
--
Marco
- Re: Is M-j broken for you in Org on Emacs 27 and 28?, (continued)
- Re: Is M-j broken for you in Org on Emacs 27 and 28?, Greg Minshall, 2021/11/28
- Re: Is M-j broken for you in Org on Emacs 27 and 28?, Colin Baxter 😺, 2021/11/28
- Re: Is M-j broken for you in Org on Emacs 27 and 28?, Richard Lawrence, 2021/11/28
- Re: Is M-j broken for you in Org on Emacs 27 and 28?, Colin Baxter 😺, 2021/11/29
- Re: Is M-j broken for you in Org on Emacs 27 and 28?, Tim Cross, 2021/11/29
- [PATCH] Fix org-comment-line-break-function (was: Is M-j broken for you in Org on Emacs 27 and 28?), Richard Lawrence, 2021/11/30
- Re: [PATCH] Fix org-comment-line-break-function,
Marco Wahl <=
- Re: [PATCH] Fix org-comment-line-break-function, Kaushal Modi, 2021/11/30
- Re: [PATCH] Fix org-comment-line-break-function, Tim Cross, 2021/11/30
- Re: [PATCH] Fix org-comment-line-break-function, Kaushal Modi, 2021/11/30
- Re: [PATCH] Fix org-comment-line-break-function, Kaushal Modi, 2021/11/30
- Re: [PATCH] Fix org-comment-line-break-function, Tim Cross, 2021/11/30
- Re: Is M-j broken for you in Org on Emacs 27 and 28?, Morgan Willcock, 2021/11/30
- Re: Is M-j broken for you in Org on Emacs 27 and 28?, Richard Lawrence, 2021/11/29