emacs-faces

face font in c-mode when adding new keyword

笑着哭i 提交于 2020-01-11 13:05:15
问题 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

Change face of plain text between double quotation marks in Emacs

回眸只為那壹抹淺笑 提交于 2020-01-01 19:32:11
问题 I am looking for a way to highlight or use different face of quoted text in plain text. It seems that there should be a sophisticated/enhanced text mode but I cannot find it. If there isn't a easy solution, can you let me know where should I begin to write a function? Thank you very much! A noob who has been using Emacs from 19.xx 回答1: I'm not sure about a major-mode that already does this, but you can make one easily enough using define-derived-mode (define-derived-mode rich-text-mode text

How to set a buffer locally face attribute for a particular buffer?

老子叫甜甜 提交于 2019-12-22 04:34:07
问题 I want to change the face attribute in Org-Agenda buffer only. So I need to change Org-Agenda face attribute buffer locally . Here is my code: (which is globally) (defun my-org-agenda-hl-line () (hl-line-mode) (set-face-attribute 'hl-line nil :box '(:color "deep pink" :line-width 2)) ) (add-hook 'org-agenda-mode-hook 'my-org-agenda-hl-line) Please to help me make this buffer locally. Thanks 回答1: Here is what you need to do: ;; First create new face which is a copy of hl-line-face (copy-face

In C/C++ mode in Emacs, change face of code in #if 0…#endif block to comment face

旧巷老猫 提交于 2019-12-18 04:39:05
问题 I'm trying to add functionality found in some other code editors to my Emacs configuration, whereby C/C++ code within #if 0...#endif blocks is automatically set to the comment face/font. Based on my testing, cpp-highlight-mode does something like what I want, but requires user action. It seems like tying into the font-lock functionality is the correct option to make the behavior automatic. I have successfully followed examples in the GNU documentation to change the face of single-line regular

Adjusting term faces in the new Emacs 24.3

吃可爱长大的小学妹 提交于 2019-12-17 19:38:08
问题 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

In Emacs, how do I display a message in the minibuffer with font face properties?

寵の児 提交于 2019-12-09 08:26:53
问题 I want to display a colored string of text in the minibuffer, but when I use the 'message' function, the text-properties of are stripped. 回答1: Works for me: (message "%s" (propertize "foo" 'face '(:foreground "red"))) You probably had (message (propertize ...)) , which interprets the propertized string as a format control string, hence stripped of its properties. 来源: https://stackoverflow.com/questions/2742435/in-emacs-how-do-i-display-a-message-in-the-minibuffer-with-font-face-properties

latex-mode / font-lock: any way to obtain more than three (3) levels of highlighting?

↘锁芯ラ 提交于 2019-12-08 12:05:59
问题 With latex-mode, is there any way to obtain more than three (3) levels of highlighting? I would like to control more than three levels of highlighting, however, it appears as though latex-mode may be limited to three (3) levels. I say this because Emacs complains when attempting a fourth level -- Error during redisplay: (jit-lock-function 1) signaled (wrong-type-argument listp prepend) . The following is just an example of an attempt to control four (4) levels, which gave the error message

Multiple custom-set-faces and custom-set-variables in .emacs?

落花浮王杯 提交于 2019-12-08 02:27:16
问题 When I customize a face through the M-x customize-face menu and save the changes to disk, Emacs adds automatically generated code to my .emacs file that looks like this: (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ; ;; SOME CODE ; ) where SOME CODE is something like: '(diredp-dir-priv ((t (:foreground "cyan

Change Emacs Mode-Line color based on major-mode

冷暖自知 提交于 2019-12-07 04:37:58
问题 I like to see if there is a way to change the mode-link foreground and background color base on the major-mode, I was thinking to add the logic in the (add-hook 'after-change-major-mode-hook But, I do not have all the emacs lisp experience to make such change. Here is the logic: switch major-mode: case "emacs-lisp-mode": (set-face-foreground 'mode-line "ivory") (set-face-background 'mode-line "DarkOrange2") case "ruby-mode": (set-face-foreground 'mode-line "white") (set-face-background 'mode

Customizing highlighting faces in Emacs: Only change the background color

感情迁移 提交于 2019-12-06 02:50:52
问题 Is there any way to define a face in Emacs (e.g. highlight such as hl-line ) so that it only changes the background color (and have Emacs use the foreground color as if the word was not highlighted). More specifically, I tried the following on the tango-dark theme (custom-set-faces '(region ((t (:inherit nil :background "RoyalBlue4")))) '(highlight ((t (:inherit region :background "dark olive green")))) '(hl-line ((t (:inherit highlight))))) and, as can be seen below, region highlighting does