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?


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)
  • Hi, can I know what does ?> and ?- mean? Jul 30 '19 at 20:42
  • ?<char> is the Elisp syntax for a character literal, like '<char>' in C.
    – Stefan
    Jul 30 '19 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. Jul 30 '19 at 21:05
  • IIRC it's not very documented :-(
    – Stefan
    Jul 30 '19 at 22:11
  • Got it! Thank you a lot! Jul 31 '19 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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