font-lock

face font in c-mode when adding new keyword

不羁岁月 提交于 2019-12-02 09:26:25
I am trying to customize some added words to be colored differently from the default face-font colors. This is what I am doing: (defconst lconfig-font-lock-faces (list '(font-lock-function-name-face ((((class color)) (:foreground "DarkBlue" :bold t)))) '(font-lock-constant-face ((((class color)) (:foreground "Black" :bold t)))) '(font-lock-builtin-face ((((class color)) (:foreground nil)))) '(font-lock-preprocessor-face ((((class color)) (:foreground nil)))) ) ) (autoload 'custom-set-faces "font-lock" "Set the color scheme" t) (autoload 'font-lock-fontify-buffer "font-lock" "Fontify Buffer" t)

How to distinguish Python strings and docstrings in an emacs buffer?

隐身守侯 提交于 2019-12-02 06:32:22
If I have just (set-face-foreground 'font-lock-comment-face "red") (set-face-foreground 'font-lock-string-face "green") in my .emacs, emacs uses the same font-lock for Python strings and for Python docstrings. What should I add to my .emacs so that comments, strings, and docstrings are distinguished? This answer suggests that it is possible to do so. Built-in python.el provides font-lock-doc-face via python-font-lock-syntactic-face-function. python-mode.el uses font-lock-doc-face , given py-use-font-lock-doc-face-p is t . You can customize that variable. The face used for doc strings should be

Set Emacs defaut font face per-buffer/mode

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 18:44:51
How do you change the default face which Emacs uses to style text on a per-mode basis? For example, say that I am already happy with the face customizations that I have, which include a default fixed-width font. However, in one particular mode ( markdown-mode.el , say), I want the default font to be variable-width. It is easy to style headers, links etc. uniquely for markdown-mode: simply place the cursor over the styled text and M-x describe-face , then click the link to customize it. However, the default face is the face used if no other face is specified, so it is not specific to markdown

emacs: is there a clear example of multi-line font-locking?

扶醉桌前 提交于 2019-11-27 16:04:52
问题 Some background, I'm comfortable with Emacs Lisp, and have written lots of lines of it. However I've never written a major mode, so I'm fairly new to how the font-locking mechanism works. For my current project, I'd like to add inlined javascript and css highlighting to html-mode . Currently, I do this with MMM-mode, but it's bulky and I don't use other features of it, so I'd just like to make a minor-mode or even just a hack that I can add to the sgml-mode-hook to just do the highlighting. I

Set Emacs defaut font face per-buffer/mode

痴心易碎 提交于 2019-11-26 19:35:19
问题 How do you change the default face which Emacs uses to style text on a per-mode basis? For example, say that I am already happy with the face customizations that I have, which include a default fixed-width font. However, in one particular mode ( markdown-mode.el , say), I want the default font to be variable-width. It is easy to style headers, links etc. uniquely for markdown-mode: simply place the cursor over the styled text and M-x describe-face , then click the link to customize it.