Is there a way to get abbrev expansion on a lower case abbrev but not on its upper case version?

E.g.: I have "r" expanding to "are". I'd like "R" to stay "R".

I don't necessarily want to get rid of capitalization completely, so I'd still like "Btw" to expand to "By the way", but if there is no other option I'd take it.


Yes: just put a non-nil value for the :case-fixed property.

(define-abbrev my-foo-abbrev-table "r" "EmacsRocks" nil
               :case-fixed t)

See C-h v define-abbrev RET for more details.

  • Thanks! Even better, you can do it also in define-abbrev-table. The property has to go before the counter value. E.g.: ("r" "are" nil :case-fixed t 332) – user673592 Apr 6 '16 at 7:34
  • Yes, it can be applied to the whole abbrev table, if you prefer. As for the position of the counter: not really! the counter value is just another property, so it should be ("r" "are" nil :case-fixed t :counter 332) but the ordering of the properties doesn't matter. – Stefan Apr 6 '16 at 11:47

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.