From 87badd749139b5c80897e3409a7a4c4d971262cd Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 21 Oct 2024 12:34:07 +0200 Subject: emacs: Make abbreviations case-sensitive --- .config/emacs/modules/mm-abbrev.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to '.config/emacs/modules') diff --git a/.config/emacs/modules/mm-abbrev.el b/.config/emacs/modules/mm-abbrev.el index 73ca761..7592d3a 100644 --- a/.config/emacs/modules/mm-abbrev.el +++ b/.config/emacs/modules/mm-abbrev.el @@ -7,16 +7,20 @@ Expand abbrev DEFINITIONS for the given TABLE. DEFINITIONS are a sequence of either string pairs mapping an abbreviation to its expansion, or a string and symbol pair mapping an abbreviation to a -function." +function. + +After adding all abbreviations to TABLE, this macro marks TABLE as +case-sensitive to avoid unexpected abbreviation expansions." (declare (indent 1)) (unless (cl-evenp (length definitions)) (user-error "expected an even-number of elements in DEFINITIONS")) - (macroexp-progn - (cl-loop for (abbrev expansion) in (seq-partition definitions 2) - if (stringp expansion) - collect (list #'define-abbrev table abbrev expansion) - else - collect (list #'define-abbrev table abbrev "" expansion)))) + `(progn + ,@(cl-loop for (abbrev expansion) in (seq-partition definitions 2) + if (stringp expansion) + collect (list #'define-abbrev table abbrev expansion) + else + collect (list #'define-abbrev table abbrev "" expansion)) + (abbrev-table-put ,table :case-fixed t))) ;;; Abbreviation Configuration -- cgit v1.2.3