Is there a way to put some extra conditions on the translation rules of an input method (quail defining rules)?
For example consider the following input method of the answer https://emacs.stackexchange.com/a/61882/
For example, I want put some condition on the rule ("b" ?ܒ)
.
For example something like below (which unfortunately does not work):
(if (eq (char-before) ?1) ("b" ?ܒ) ("b" ?x))
instead of ("b" ?ܒ)
.
Edit: The condition (eq (char-before) ?1)
that I provided is just for an example, the condition could be unrelated to the preceding character. The condition could be very general. For example the condition could be any of:
(not (eq (char-before) ?1))
(bobp)
(equal (get-last-key) "<home>")
(equal (char-after) ?i)
(texmathp)
(region-active-p)
(eolp)
org-mode
etc...
Some related questions:
(quail-define-package
"Syriac-trans" "Ar-trans" "S>" t
"Input method for Syriac transcription."
nil t nil nil nil nil nil nil nil nil t)
(quail-define-rules
("'" ?ܐ)
("b" ?ܒ)
("g" ?ܓ)
("d" ?ܕ)
("h" ?ܗ)
("w" ?ܘ)
("z" ?ܙ)
("x" ?ܚ)
("t." ?ܛ)
("y" ?ܝ)
("k" ?ܟ)
("l" ?ܠ)
("m" ?ܡ)
("n" ?ܢ)
("s" ?ܣ)
("`" ?ܥ)
("p" ?ܦ)
("s." ?ܨ)
("q" ?ܩ)
("r" ?ܪ)
("sh" ?ܫ)
("t" ?ܬ))