2

The standard way to define an abbreviation using quail is as follows:

(quail-define-rules
("a" ?s ))

Inserting "a" gives "s".

I am wondering if one can insert an arbitrary string using quail, I tried the following but do not work

(quail-define-rules
("a" ?s?o?m?t?h?i?n?g ))

(quail-define-rules
("a" "something" ))

I know there are other methods to achieve this (e.g., abbrev-mode) but I am interested if there is way to do it using quail.

Update If one uses ("a" "something" ), typing a inserts s and ignores omething.

Name
  • 7,689
  • 4
  • 38
  • 84

1 Answers1

3

Using quail-define-rules is overkill (note the rules, plural, in the function name) — an alternative is quail-defrule (one rule...)

Directly from my scratch buffer

(quail-defrule "á" ["something"])
["something"]

— note that it's not (quail-defrule "á" "something"), to do what you want the string must be an element of a vector (ref. C-h f quail-defrule RET) — then I typed á and I got

something

I have to mention that my knowledge in these matters is solely due to (is stolen from...) this answer from Stefan.

gboffi
  • 594
  • 2
  • 19