Skip to content

Improve documentation for setting up colors #32

@dbuenzli

Description

@dbuenzli

Area

Font-locking (syntax highlighting)

Expected behavior

The rune you give here for customizing faces change things globally which is not what the user may want. I think you should rather indicate how it can be set just for the mode locally by setting up stuff in the hook.

That is replace:

;; Use a custom color for type names
(custom-set-faces
 '(font-lock-type-face ((t (:foreground "DarkSeaGreen4")))))

by something like (IIUC):

;; Use a custom color for type names
(add-hook 'neocaml-base-mode-hook 
  (lambda ()
    (face-remap-add-relative 'font-lock-type-face :foreground "DarkSeaGreen4"))

Actual behavior

See above

Steps to reproduce

See above

Environment

Emacs: 30.2
System: darwin
neocaml: 0.4.1
Grammars: ocaml (expected: v0.24.2), ocaml-interface (expected: v0.24.2)
Eglot: inactive

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions