2

I use org-mode to write an executable paper, combining text and code. I make use of abbrev-mode to insert text more efficiently (e.g. type 'bc' to insert 'because') and to correct spelling errors. Is there any way to switch off abbrev-mode in the source blocks to prevent it expanding my variables?

I did run into this post, but don't see how to use that for my problem. Any help would be appreciated.

1 Answer 1

3

One way might be like this, where expansion only occurs conditionally. Put this statement in an init file, or in an org-mode hook function and you should not get expansion in src-blocks.

(setq abbrev-expand-function (lambda ()
                   (unless (org-in-src-block-p)
                 (abbrev--default-expand))))

Your Answer

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

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