[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is M-j broken for you in Org on Emacs 27 and 28?
From: |
Colin Baxter 😺 |
Subject: |
Re: Is M-j broken for you in Org on Emacs 27 and 28? |
Date: |
Sun, 28 Nov 2021 14:45:30 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) |
>>>>> Richard Lawrence <richard.lawrence@uni-tuebingen.de> writes:
> Hi Org community, Some questions for those of you on Emacs 27 and
> 28:
> Does M-j in an org-mode buffer do what you expect? Does it throw
> an error? What function is M-j bound to in Org?
> Backstory:
> I have long been on Emacs 26.3 (in Debian stable) but recently
> decided to try a newer Emacs from GNU Guix. I immediately ran into
> an issue, and now I'm trying to figure out if it's a bug, and if
> so where to file it: in both Emacs 27.2 and 28.0.50, typing M-j in
> an Org buffer throws (wrong-type-argument char-or-string-p nil)
> The source of this problem appears to be that the keybinding for
> M-j changed between Emacs 26 and 27. In Emacs 26 it calls
> indent-new-comment-line. In Emacs 27 and 28 it calls
> default-indent-new-line, and the call stack look like:
> insert-before-markers-and-inherit(nil)
> org-comment-line-break-function(nil) default-indent-new-line()
> funcall-interactively(default-indent-new-line)
> call-interactively(default-indent-new-line nil nil)
> command-execute(default-indent-new-line)
> The error arises because insert-before-markers-and-inherit cannot
> accept nil (the value of fill-prefix in this context).
> I see this error in emacs -q with both Emacs 27 and 28 from Guix.
> After some investigation, the functions involved here don't appear
> to have changed at all recently (though see [1]); just the
> binding. This leads me to ask: why hasn't this been discovered
> already? Which leads me to wonder if I am using M-j in some
> non-standard way.
> Some time in the distant past, I internalized the idea that M-j is
> a better way to type a newline because (a) it doesn't involve a
> pinky reach and (b) in most contexts in Emacs, it is more likely
> to "do what I mean" than RET is. In particular, it continues
> comments and indents properly. (I am also an evil-mode user and
> there is probably some part of my brain that thinks "M-j is like j
> for insert mode".) But maybe that was always wrong, and the
> recently changed binding is just an indication that I was not
> using M-j as intended.
> So which is it? Is this a bug in Emacs, in Org, or in my ingrained
> typing habits? Many thanks for your advice.
> -- Best, Richard
> [1] There is a commit which changed default-indent-new-line in
> August of this year, but the changes don't seem relevant to the
> error I'm seeing, since I also see it in Emacs 27.2:
>
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=b41f31d2b60269bd0e7addd1081f3738f91e76bc
I confirm that it also appears broken to me in emacs-27.2, with the same
error as you found. I have never noticed it before, possibly because I
use C-j rather than M-j.
Best wishes,
- 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?, Greg Minshall, 2021/11/28
- Re: Is M-j broken for you in Org on Emacs 27 and 28?,
Colin Baxter 😺 <=
- 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, 2021/11/30
- Re: [PATCH] Fix org-comment-line-break-function, Kaushal Modi, 2021/11/30