emacs - 如何为特定缓冲区本地设置缓冲区face属性?

标签 emacs customization font-face org-mode emacs-faces

我只想更改Org-Agenda缓冲区中的face属性。
因此,我需要在本地更改Org-Agenda面部属性缓冲区

这是我的代码:(全局)

(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)

请帮助我在本地制作此缓冲区。谢谢

最佳答案

这是您需要做的:

;; 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-face nil
                    :box '(:color "deep pink" :line-width 2))

;; The function to use the new face
(defun my-org-agenda-hl-line ()
  (set (make-local-variable 'hl-line-face) ; This is how to make it local
       'hl-line-agenda-face)
    (hl-line-mode))

;; Finally, the hook
(add-hook 'org-agenda-mode-hook 'my-org-agenda-hl-line)

关于emacs - 如何为特定缓冲区本地设置缓冲区face属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17628985/

相关文章:

javascript - 你能创建一个自定义的 jQuery 库构建吗?

css - CSS @font-face 规则中 local() 的值是多少?

javascript - CSS3 中的连字 @font-face

css - @font-face 不适用于特定字体

emacs - Emacs Lisp 中的 GNU+Linux 构建框架?

macos - 如何将 iswitch 缓冲区名称限制为 minibuffer 中的 1 行(在 osx 上升级 emacs 24.1 后行为发生变化)?

emacs - 在 Windows 上使用 plink 时,如何更改 Emacs 中 TRAMP 发送的命令?

asp.net - 值不能为空。参数名称 : value

emacs - 为什么当我尝试打印无效符号时 GDB 这么慢?

c# - 最大化时从顶部拖动自定义窗口标题栏不起作用