emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Étienne Deparis" <etienne@depar.is>
To: emacs-orgmode@gnu.org
Subject: Re: error message at line break
Date: Sun, 03 May 2020 17:47:12 +0200	[thread overview]
Message-ID: <87a72powan.fsf@depar.is> (raw)
In-Reply-To: <87lfma5jj4.fsf@nicolasgoaziou.fr>

Hello,

sam. 02 mai 2020 à 19:33, mail@nicolasgoaziou.fr a écrit :

> [...]
>
>> 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?

I must admit I have absolutely no reason to do so. I don't even remember
when this line appear in my config file. At the time, I think I wished
to have auto-fill-mode in all buffer and blindly copy-paste this code
without thinking about it.

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

Yes, I agree you, with my today's Emacs knowledge it makes more
sense. I'll switch to that, or maybe completely remove it and see, mode
per mode, when I really need it.

>
> 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
> `auto-fill-function'.

With your explanations, I agree this fix proposal doesn't make sense,
and I understand and I agree the error expectation

Thank you Nicolas and Tim for your clarification. In the next day I'll
see to amend the EmacsWiki to note that this tip is outdated or
dangerous.


Enjoy your evening,

Étienne


>
> WDYT?
>
> Regards,


--
Étienne Deparis

https://etienne.depar.is/
xmpp: etienne@depar.is


  reply	other threads:[~2020-05-03 15:47 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
2020-05-03 15:47                     ` Étienne Deparis [this message]
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:
  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=87a72powan.fsf@depar.is \
    --to=etienne@depar.is \
    --cc=emacs-orgmode@gnu.org \
    /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).