OCaml Emacs Tuareg: Evaluate keyboard phrase combination and how to display actual Greek characters?
Start tuareg mode (for example M-x tuareg-mode
) and view its documentation by clicking C-h m
.
Symbols displayed by sym-lock mode only work for Xemacs and its variants, which I'm afraid of, but you'll find how to customize them in your .emacs in the help mentioned above. Shortcut to execute an operator C-x C-e
(see the Special Keys section of the Help).
source to share
I'm not sure if this is exactly what you mean for part 1 of your question, but I have the font-lock-mode keyword to display the keyword lambda
as a Greek lambda character, which can be adapted to do what you asking. It only requires that Font Lock Mode be enabled. (I didn't write it, I just found it floating somewhere).
;; real lisp hackers use the lambda character
;; courtesy of stefan monnier on c.l.l
(defun sm-lambda-mode-hook ()
(font-lock-add-keywords
nil `(("\\<lambda\\>"
(0 (progn (compose-region (match-beginning 0) (match-end 0)
,(make-char 'greek-iso8859-7 107))
nil))))))
(add-hook 'emacs-lisp-mode-hook 'sm-lambda-mode-hook)
(add-hook 'lisp-interactive-mode-hook 'sm-lamba-mode-hook)
(add-hook 'scheme-mode-hook 'sm-lambda-mode-hook)
source to share
You can see my existing configs based on EmacsWiki code with some extensions - a text-to-character conversion function, and an example of its use for erlang mode - you can change it for ocaml mode as well
PS but this code has one drawback - it also displays these characters inside lines and comments
source to share