2011-07-20 18 views
1

對於Indentation of 「if」,我必須在Emacs下使用caml-mode在Emacs的caml模式下可以使用tuareg的字體嗎?

但我發現的tuareg字體比caml-font更加豐富多彩,所以我的問題是,是否有可能使用的tuareg的字體在caml-mode

此外,與當前.emacs需要caml-font,當我打開.ml文件時,某些行(特別是在文件的開頭)不突出顯示。如果我去那些線,修改他們,他們將改變他們的顏色。有誰能告訴我如何解決這個問題?

另外,你有一些更好的ocaml程序建議的字體,除了tuaregcaml-font之一嗎?

非常感謝!

回答

1

你的意思是說你喜歡顏色更好還是顏色更多?

如果是後者,可能很難在caml模式下使用tuareg字體鎖定功能,儘管我只是看了一下這兩點。

如果是前者,您可以簡單地自定義caml-mode使用的面部以使用更好的面部(我的意思是字體或「顏色」)。使用足夠新的emacs,將光標放在要更改的錶盤上並鍵入M-x customize-face RET。它會提示您所在的臉部名稱,因此請再次點擊返回。然後你可以用任何你想要的方式改變臉部。作爲第一步,你可能會保持tuareg.el打開查看面孔是有什麼,比如

(defface tuareg-font-lock-governing-face 
    '((((background light)) (:foreground "blue" :bold t)) 
    (t (:foreground "orange" :bold t))) 
    "Face description for governing/leading keywords." 
    :group 'tuareg-faces) 

是用於讓利,所以你只需把你的讓利,M-x customize-face RET RET光標臉的定義,然後更改前景變爲藍色並打開粗體(假設您的背景爲淺色)。不要忘記保存它。

或者,您可以編輯caml-font.el並更改caml-font-lock-keywords部分以使用您喜歡的字體(可能來自tuareg)。如果您想添加到您的.emacs,則應將其更改爲(setq caml-font-lock-keywords ...)

(defconst caml-font-lock-keywords 
    (list 
    ... 
;definition 
    (cons (concat 
      "\\<\\(a\\(nd\\|s\\)\\|c\\(onstraint\\|lass\\)" 
      "\\|ex\\(ception\\|ternal\\)\\|fun\\(ct\\(ion\\|or\\)\\)?" 
      "\\|in\\(herit\\|itializer\\)?\\|let" 
      "\\|m\\(ethod\\|utable\\|odule\\)" 
      "\\|of\\|p\\(arser\\|rivate\\)\\|rec\\|type" 
      "\\|v\\(al\\(ue\\)?\\|irtual\\)\\)\\>") 
     ;; 'font-lock-type-face) 
     'tuareg-font-lock-governing-face) 
    ... 
    )) 
相關問題