0

I use purescript-unicode-input-method in Purescript. However, I want the input method not to translate ->, ~> and => because their Unicode characters look very similar. Is there a way to disable certain rules of an input method?

1 Answer 1

1

You can try something like the following:

(defvar my-quail-activate-hook-done nil)

(defun my-quail-activate-hook ()
  (unless (member (quail-name) my-quail-activate-hook-done)
    (push (quail-name) my-quail-activate-hook-done)
    (when (member (quail-name) '("purescript-unicode"))
      ;; Remove the "->" binding.
      (setf (alist-get ?> (cdr (alist-get ?- (quail-map)))) nil)
      ...
      )))
(add-hook 'quail-activate-hook #'my-quail-activate-hook)
5
  • Hi, can I know what does ?> and ?- mean? Commented Jul 30, 2019 at 20:42
  • ?<char> is the Elisp syntax for a character literal, like '<char>' in C.
    – Stefan
    Commented Jul 30, 2019 at 20:43
  • Great! Thank you a lot. Can I know where I can find document of quail-map? I tried describe-variable but it is not there. Commented Jul 30, 2019 at 21:05
  • IIRC it's not very documented :-(
    – Stefan
    Commented Jul 30, 2019 at 22:11
  • Got it! Thank you a lot! Commented Jul 31, 2019 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.