1

Normally when I use abbreviations in Emacs the abbreviations are expanded such that depending on how you capitalize your abbreviation you get a different output (see table 3.7 in http://flylib.com/books/en/2.27.1.40/1/ for example). I use a huge number of abbreviations and this is rarely useful for me. I would much prefer to have Emacs not expand the abbreviation unless it perfectly matched the case for the way I wrote the abbreviation. For example if I wrote that "lc" -> lambchop, I want Emacs to not expand "lC" or "Lc" but just "lc".

I don't have very much experience using Lisp and I've spent hours and hours trying to change this. Anyone have any ideas?

1
  • I assume you are using abbrev-mode and not dabbrev-mode. Mar 9, 2013 at 14:28

1 Answer 1

2

According to the docstring of define-abbrev:

  • `:case-fixed': non-nil means that abbreviations are looked up without case-folding, and the expansion is not capitalized/upcased.

To disable case folding, set :case-fixed to true on the abbrev tables you use:

(abbrev-table-put global-abbrev-table :case-fixed t)

Or, to do it for all abbrev tables:

(dolist (tbl abbrev-table-name-list)
  (abbrev-table-put tbl :case-fixed t))
0

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.