I am using prettify-symbols
to switch between the following words and shortcuts. The problem is that when the replacement is more than a single character, all letters are being inserted at the same point.
For instance when little
is replaced I get a single l
, rather than ll
.
(defvar cluster
'(
("all" . "l") ("as" . "as") ("can" . "k")
("do" . "do") ("for" . "f") ("in" . "n")
("is" . "s") ("it" . "t") ("know" . "no")
("like" . "lk") ("little" . "ll") ("more" . "mo")
("some" . "so") ("than" . "n") ("that" . "ta")
("there" . "tr") ("this" . "th") ("time" . "ti")
("to" . "to") ("we" . "w") ("well" . "l")
("will" . "l") ("work" . "wk") ("you" . "u"))
"List of replacements for specific words.")
(defun prettify-cluster ()
"Set keywords and corresponding glyph."
(setq-local prettify-symbols-alist cluster))
The doc string of variable
prettify-symbols-alist
tells you that each alist entry is(SYMBOL . CHARACTER)
, whereSYMBOL
is a string.In your alist, you have instead
(STRING . STRING)
entries.Furthermore, if you use a list or vector of chars for
CHARACTER
then those chars are composed.I think that what you want is maybe something like
abbrev-mode
?