1

I have (setq-default auto-fill-function 'do-auto-fill) in my config file, and I'm noticing that in org mode, auto-fill/wrapping occurs even within (wide) tables, which I don't like.

I confirmed that if I set the variable to nil, this no longer happens, but I don't want to disable this across the whole file, just in the tables. Is there some way to say "I want auto-fill, but not inside my org tables"?

1 Answer 1

2

Try not setting auto-fill-function at all in your config file: it is set from normal-auto-fill-function which is do-auto-fill by default, but it is org-auto-fill-function in Org mode buffers. There is no need for you to set it.

That way, with an Org mode buffer, and with auto-fill mode turned on, normal paragraphs get filled appropriately but table entries are not touched. You can check the value of normal-auto-fill-function in that buffer by using C-h v normal-auto-fill-function, which should say:

normal-auto-fill-function is a variable defined in ‘simple.el’.

Its value is ‘org-auto-fill-function’ Local in buffer foo.org; global value is do-auto-fill

1
  • Did you try this? Did it work? If you delete the customization completely, does that resolve your problem?
    – NickD
    Commented Oct 1, 2023 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.