Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Consistent face handling with defface.

Turned merlin-compilation-warning-face and merlin-compilation-error-face into
actual faces. Thus they will be easier to customize and be consistent with
merlin-locked-face and merlin-type-face.

Also fixed defface for merlin-type-face by removing superfluous quote char so
now the customize interface displays the proper editor instead of just an
  • Loading branch information...
commit 6e68cf9c6fda61af13d45844182a9f6f5e1f6944 1 parent b5d01e4
@sheijk sheijk authored
Showing with 14 additions and 13 deletions.
  1. +14 −13 emacs/merlin.el
27 emacs/merlin.el
@@ -48,10 +48,20 @@
:group 'merlin)
(defface merlin-type-face
- '((t :inherit 'caml-types-expr-face))
+ '((t :inherit caml-types-expr-face))
"Face for highlighting a typed expr."
:group 'merlin)
+(defface merlin-compilation-warning-face
+ '((t :inherit compilation-error))
+ "If non-nil, face to use to highlight merlin warnings."
+ :group 'merlin)
+(defface merlin-compilation-error-face
+ '((t :inherit compilation-warning))
+ "If non-nil, face to use to highlight merlin errors."
+ :group 'merlin)
;; Customizable vars
@@ -138,15 +148,6 @@ In particular you can specify nil, meaning that the locked zone is not represent
"If non-nil, when locate opens a new window it will give it the focus."
:group 'merlin :type 'boolean)
-(defcustom merlin-compilation-warning-face 'compilation-warning-face
- "If non-nil, face to use to highlight merlin warnings."
- :group 'merlin :type '(choice symbol (const :tag "Disable" nil)))
-(defcustom merlin-compilation-error-face 'compilation-error-face
- "If non-nil, face to use to highlight merlin errors."
- :group 'merlin :type '(choice symbol (const :tag "Disable" nil)))
;; Internal variables ;;
@@ -323,7 +324,7 @@ An ocaml atom is any string containing [a-z_0-9A-Z`.]."
(defun merlin-put-margin-overlay (overlay string &optional face)
"Put a margin overlay inside OVERLAY, with face FACE and string STRING."
(set-window-margins nil 1)
- (when face (overlay-put overlay 'face (eval face)))
+ (when face (overlay-put overlay 'face face))
(overlay-put overlay 'before-string
(propertize " " 'display `((margin left-margin) ,string))))
@@ -828,10 +829,10 @@ If there is no error, do nothing."
(if (merlin-error-warning-p (cdr (assoc 'message err)))
(merlin-put-margin-overlay overlay
- merlin-compilation-warning-face)
+ 'merlin-compilation-warning-face)
(merlin-put-margin-overlay overlay
- merlin-compilation-error-face))
+ 'merlin-compilation-error-face))
(errors (mapcar err-point errors)))
(setq merlin-pending-errors errors)
Please sign in to comment.
Something went wrong with that request. Please try again.