emacs-faces

Change Emacs Mode-Line color based on major-mode

旧城冷巷雨未停 提交于 2019-12-05 06:39:35
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-line "red") ... default: (set-face-foreground 'mode-line "black") (set-face-background 'mode-line

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

浪尽此生 提交于 2019-12-05 03:24:50
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 Here is what you need to do: ;; First create new face which is a copy of hl-line-face (copy-face 'hl-line 'hl-line-agenda-face) ;; Change what you want in this new face (set-face-attribute 'hl-line-agenda

Change face of plain text between double quotation marks in Emacs

元气小坏坏 提交于 2019-12-04 18:17:52
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 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-mode "Rich Text" "text mode with string highlighting." ;;register keywords (setq rich-text-font-lock-keywords

what is custom-set-variables and faces in my .emacs?

与世无争的帅哥 提交于 2019-12-04 15:49:05
问题 this is in my .emacs can I mess with it or not? (custom-set-variables ;; custom-set-variables 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. ) (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

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

亡梦爱人 提交于 2019-12-03 10:01: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. 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

what is custom-set-variables and faces in my .emacs?

我只是一个虾纸丫 提交于 2019-12-03 09:49:37
this is in my .emacs can I mess with it or not? (custom-set-variables ;; custom-set-variables 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. ) (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. '(better-fringes-bitmap ((t (:foreground "#00dd44")))) '(font-lock-string

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 set colors for a specific mode?

给你一囗甜甜゛ 提交于 2019-12-02 06:42:27
问题 I'm trying Emacs. I would like to set colors for Eshell. I tried that first with set-foreground-color. But it affects my other modes too. (add-hook 'eshell-mode-hook (lambda ( default ((t (:foreground "#BD8700")))))) But that's not working either. Or it's affecting the colors on other modes/ scratch too. Have anyone a suggestion? This is not a duplicate question, because the other answers change the colors of other buffers as well. 回答1: Here is a link to the documentation regarding remapping

How set colors for a specific mode?

瘦欲@ 提交于 2019-12-02 05:34:52
I'm trying Emacs. I would like to set colors for Eshell. I tried that first with set-foreground-color. But it affects my other modes too. (add-hook 'eshell-mode-hook (lambda ( default ((t (:foreground "#BD8700")))))) But that's not working either. Or it's affecting the colors on other modes/ scratch too. Have anyone a suggestion? This is not a duplicate question, because the other answers change the colors of other buffers as well. Here is a link to the documentation regarding remapping faces: http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html (defun my-eshell-mode

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

99封情书 提交于 2019-11-30 13:51:06
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 '(("\\<\\(FIXME\\):" 1 "#F0F0F0" t))) Using the double quotes doesn't work. Do you know what will make it