emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Étienne Deparis" <etienne@depar.is>
Cc: emacs-orgmode@gnu.org
Subject: Re: error message at line break
Date: Sat, 02 May 2020 19:33:19 +0200	[thread overview]
Message-ID: <87lfma5jj4.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <871ro2w9wx.fsf@piccolo.i-did-not-set--mail-host-address--so-tickle-me> ("Étienne Deparis"'s message of "Sat, 02 May 2020 18:58:54 +0200")


Étienne Deparis <etienne@depar.is> writes:

>   Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
>   insert-before-markers-and-inherit(nil)
>   org-comment-line-break-function(t)


> I confirm that I've the same variable set in my Emacs config file:
>   (setq-default auto-fill-function 'do-auto-fill)
> Which I take from the Emacs Wiki AutoFill page¹, with the explanation
> of: « If you would like to enable auto fill for all major modes, you can
> add this single line to your configuration ».
> ¹ https://www.emacswiki.org/emacs/AutoFillMode

This is a very bad (outdated ?) advice! With this, you force
`do-auto-fill' function in every major mode, even if that function
doesn't have a clue about what the major mode is about. Also this
prevents the major mode from setting its own filling. Do you have any
reason to do this?

A correct way to activate auto fill in all text-based modes (including
Org), is, for example,

  (add-hook 'text-mode-hook (lambda () (auto-fill-mode 1)))

See (info "(emacs)Auto Fill") for more information.

> To fix this, I simply replace the last line of
> `org-comment-line-break-function' (in ./lisp/org.el, line 19723) from:
>   (insert-before-markers-and-inherit fill-prefix)
> To
>   (when fill-prefix
>     (insert-before-markers-and-inherit fill-prefix))

Well, the fix is cheap, sure, but, OTOH, the error is to be expected,
since you force Org to use a function which is not adequate.

I'm not sure we should paper over this kind of misuse of



Nicolas Goaziou

  reply	other threads:[~2020-05-02 17:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 14:17 error message at line break henry atting
2013-09-09 15:56 ` Nicolas Goaziou
2013-09-09 16:35   ` henry atting
2013-09-11 13:15     ` henry atting
2013-09-11 13:19       ` Nicolas Goaziou
2013-09-11 14:40         ` henry atting
2013-09-11 15:50           ` Nicolas Goaziou
2013-09-11 16:07             ` henry atting
2013-09-17 14:24               ` henry atting
2020-05-02 16:58                 ` [O] " Étienne Deparis
2020-05-02 17:33                   ` Nicolas Goaziou [this message]
2020-05-03 15:47                     ` Étienne Deparis
2020-05-03  1:18                   ` [O] " Tim Cross

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:

  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=87lfma5jj4.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=etienne@depar.is \


* 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


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).