I take notes with org-mode and abbrev-mode. Normally pressing SPC or RET leads to any abbreviations at point expanding before the edit is made.

This doesn't happen when I use C-RET (org-insert-heading-respect-content) or M-RET (org-meta-return). Is there a way to make this happen simpler than advising those functions?


A solution with advice is:

(defun expand-abbrev-eat-args (&rest args)
  "Call `expand-abbrev', ignoring ARGS."
(advice-add 'org-insert-heading :before #'expand-abbrev-eat-args)
(advice-add 'org-table-wrap-region :before #'expand-abbrev-eat-args)
(advice-add 'org-insert-item :before #'expand-abbrev-eat-args)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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