emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Javier Olaechea <pirata@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Fix M-j with default fill-prefix value
Date: Fri, 22 Apr 2022 13:13:32 +0800	[thread overview]
Message-ID: <87a6cdu2df.fsf@localhost> (raw)
In-Reply-To: <CAFVS=zBfxN+txFGwpTfdpsmM0+fdW4nNLTVKH6XbCNuPogAmRQ@mail.gmail.com>

Javier Olaechea <pirata@gmail.com> writes:

> org-comment-line-break-function does not handle fill-prefix being set to
> nil, which is the default value for fill-prefix. This means that pressing
> M-j inside an org-mode buffer in a vanilla installation of Emacs results in
> an error. From looking at other callers of
> insert-before-markers-and-inherit it is clear that a guard against
> fill-prefix being nil is missing.

I guess this is fine to fix the immediate error, but I do not see much
point in the whole org-comment-line-break function. AFAIU, it does not
even recognise whether we are inside comment or not. I just tried to use
the default comment-indent-new-line and it correctly indents paragraphs
and also comments. On the other hand, it does not indent item lists and
src-blocks.

Rather than applying this patch I would remove
org-comment-line-break-function alltogether. It will already be better
than the current state. Alternatively, it should be rewritten to take
into account current element context, similar to org-insert-comment.

Best,
Ihor


  reply	other threads:[~2022-04-22  5:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 17:49 Fix M-j with default fill-prefix value Javier Olaechea
2022-04-22  5:13 ` Ihor Radchenko [this message]
2022-10-24 13:00   ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6cdu2df.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=pirata@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).