1

I am trying to stop emacs from expanding abbrevs after I press the return key. If I press return, I simply want to create a new line without expanding any abbrev at point.

I am relatively new at elisp. I’m assuming the answer involves pre-abbrev-expand-hook, but I haven’t found an answer in my research.

3
  • 1
    Does this answer your question? Prevent abbrev-mode from expanding on underscore
    – Tyler
    Commented May 20, 2021 at 14:28
  • @Tyler yes, I linked to that thread in the marked Answer below. Let me know if I should clarify further.
    – Faulkner77
    Commented May 22, 2021 at 5:53
  • That's fine, no need to do anything further @Faulkner77. This question will probably end up getting closed, since it already has an answer in the linked post. That doesn't mean there's anything wrong here, just that we want to keep the site streamlined, with a single question/answer post for each issue.
    – Tyler
    Commented May 23, 2021 at 17:09

1 Answer 1

1

It seems this has been addressed after all in similar post here that I found after the fact. The solution I settled on was as follows:

(defun my-self-insert-no-abbrev-RET ()
  (interactive)
  (let ((abbrev-mode nil))
    (newline nil t)))

(global-set-key (kbd "RET") #'my-self-insert-no-abbrev-RET)
0

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.