Hello, I allow myself to revive an old thread, as I encounter today the exact same problem: Emacs crash in org mode at line ending with the following backtrace:
Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil) insert-before-markers-and-inherit(nil) org-comment-line-break-function(t) default-indent-new-line(t) do-auto-fill() internal-auto-fill() self-insert-command(1) org-self-insert-command(1) funcall-interactively(org-self-insert-command 1) call-interactively(org-self-insert-command nil nil) command-execute(org-self-insert-command) 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 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)) But I must admit I don't know all the implications of such a change. In my case, it does the job perfectly well, but maybe I miss something? I run make test and every thing goes fine too. I would like to suggest to fix the method `org-comment-line-break-function', in order to support user change of the variable auto-fill-function, as it seems to be a common thing. What do you think? Have a good week-end, Étienne >henry atting <address@hidden> writes: > >> Nicolas Goaziou <address@hidden> writes: >> >>> Hello, >>> >>> henry atting <address@hidden> writes: >>> >>>> Okay, say I have an org file with two lines in it (fill-column is set to >>>> 70). Here you go: >>>> >>>> >>>> Jemand mußte Josef K. verleumdet haben, denn ohne daß er etwas Boeses >>>> getan haette, wurde er eines Morgens verhaftet. Die Koechin der Frau >>>> >>>> >>>> Then you go on with the text, which is: >>>> >>>> Grubach, seiner Zimmervermieterin, die ihm jeden Tag gegen acht Uhr frueh >>>> das Fruehstueck brachte,... >>>> >>>> At each automatic line skip I get the mentioned error message. But if >>>> you indent these two lines one space everything works fine. >>> >>> Strange, I still cannot reproduce it. >>> >> Strange, in deed. I can reproduce it even this way: >> >> 1. Start emacs with `emacs -Q' >> 2. Add my org directory to the load path >> 3. Load org-mode >> 4. Then type the above quoted beginning of Kafka's Prozess >> > >Finally... the culprit was: > >(setq-default auto-fill-function 'do-auto-fill) > >A very old setting in my ~/.emacs. Now that I start auto-fill with the >appropriate hook everythings works fine. > >henry