emacs-faces

How do I change Emacs's font face for Python docstrings?

做~自己de王妃 提交于 2019-11-30 05:32:56
问题 I'm just starting to learn Python and use Emacs as my editor. Currently, Emacs uses the same color for normal strings (single quotes) and docstrings (triple quotes). I want docstrings to be a different color, so I used the 'Options->Customize Emacs' menu option to change 'font-lock-doc-face' to a new color and saved the changes. However, Emacs continues to keep docstrings the same color as normal strings. Changing the color of normal strings applies the change to docstrings as well. It would

Emacs font lock mode: provide a custom color instead of a face

筅森魡賤 提交于 2019-11-29 19:07:04
问题 On this page discussing font lock mode, an example is provided which highlights a custom pattern: (add-hook 'c-mode-hook (lambda () (font-lock-add-keywords nil '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t))))) Is there a way to provide a custom color instead of font-lock-warning-face and without defining a new custom face. I want to be able to write something like: (font-lock-add-keywords nil '(("\\<\\(FIXME\\):" 1 "Blue" t))) or an RGB color definition: (font-lock-add-keywords nil '(("\\<

Get font face under cursor in Emacs

旧城冷巷雨未停 提交于 2019-11-28 15:30:15
I've been developing my own custom color theme, and it'd be really useful if I could get a list of font-faces affecting the text under the cursor. Something like Textmate's show current scope command. That would save me the trouble of doing M-x customize-face and looking through available options, guessing at which one affects the current word I'm on. Any ideas? Trey Jackson You can define what-face with this code: (defun what-face (pos) (interactive "d") (let ((face (or (get-char-property (pos) 'read-face-name) (get-char-property (pos) 'face)))) (if face (message "Face: %s" face) (message "No

Adjusting term faces in the new Emacs 24.3

青春壹個敷衍的年華 提交于 2019-11-28 10:59:14
How can I adjust the term face in the new Emacs to get the same control that was possible with ansi-term-color-vector ? One of the new features in Emacs 24.3 seems to be that it revamps the mechanism to control the face of term buffers, i.e.: The variables term-default-fg-color and term-default-bg-color are now deprecated in favor of the customizable face term . You can customize how to display ANSI terminal colors and styles by customizing the corresponding term-color-COLOR , term-color-underline and term-color-bold faces. Mickey from Mastering Emacs comments the following : If, like me, you

Get font face under cursor in Emacs

一世执手 提交于 2019-11-27 19:46:23
问题 I've been developing my own custom color theme, and it'd be really useful if I could get a list of font-faces affecting the text under the cursor. Something like Textmate's show current scope command. That would save me the trouble of doing M-x customize-face and looking through available options, guessing at which one affects the current word I'm on. Any ideas? 回答1: You can define what-face with this code: (defun what-face (pos) (interactive "d") (let ((face (or (get-char-property (pos)

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

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.

How to set the font size in Emacs?

怎甘沉沦 提交于 2019-11-26 06:52:37
问题 I also want to save the font size in my .emacs file. 回答1: (set-face-attribute 'default nil :height 100) The value is in 1/10pt, so 100 will give you 10pt, etc. 回答2: From Emacswiki, GNU Emacs 23 has a built-in key combination: C-x C-+ and C-x C-- to increase or decrease the buffer text size 回答3: Press Shift and the first mouse button. You can change the font size in the following way: This website has more detail. 回答4: M-x customize-face RET default will allow you to set the face default face,