OCaml Emacs Tuareg: Evaluate keyboard phrase combination and how to display actual Greek characters?

Two questions about Emacs Tuareg for OCaml:

  • I have seen several configurations where it displays an alpha character instead of '. How can I enable this?

  • What is the keyboard shortcut for "phrase score" or "buffer score"?

+2


source to share


4 answers


I can only answer part (2):



  • To start the top level Ocaml: C-c C-s

  • To rate a phrase: C-x C-e

  • To evaluate the buffer: C-c C-b

  • To evaluate an area: C-c C-r

+2


source


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).

+2


source


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)

      

+1


source


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

+1


source







All Articles