2

当使用 hexl-mode 显示时,我想配置不同数据部分的颜色。

例如,我希望地址范围为白色背景,黄色字节和红色 ASCII(无论如何)。

00000000:2550 4446 2d31 2e34 0a25 c7ec 8fa2 0a35 %PDF-1.4.%.....5 00000010:2030 206f 626a 0a3c 3c2f 4c65 6e67 7468 0 对象。

我尝试像这样更新我的颜色主题:

 (hexl-address-region ((t (:background "#252525"))))
 (hexl-ascii-region ((t (:foreground "#cfbfad"))))

但这显然行不通。颜色没有改变:(

我的全彩主题:

(eval-when-compile
   (require 'color-theme))

(defun sublime-text-2 ()
   "Color theme that looks like the Sublime Text 2 editor."
   (interactive)
   (color-theme-install
    '(sublime-text-2
      ((background-color . "#171717")
       (background-mode . light)
       (border-color . "#1a1a1a")
       (cursor-color . "#fce94f")
       (foreground-color . "#cfbfad")
       (mouse-color . "black"))
       (fringe ((t (:background "#1a1a1a"))))
       (mode-line ((t (:foreground "#eeeeec" :background "#555753"))))
       (region ((t (:foreground "#404040" :background "#CC9900"))))
       (font-lock-builtin-face ((t (:foreground "#52e3f6"))))
       (font-lock-comment-face ((t (:foreground "#ffffff"))))
       (font-lock-function-name-face ((t (:foreground "#edd400"))))
       (font-lock-keyword-face ((t (:foreground "#ff007f"))))
       (font-lock-string-face ((t (:foreground "#ece47e"))))
       (font-lock-type-face ((t (:foreground"#8ae234"))))
       (font-lock-variable-name-face ((t (:foreground "#8ae234"))))
       (minibuffer-prompt ((t (:foreground "#729fcf" :bold t))))
       (font-lock-warning-face ((t (:foreground "Red" :bold t))))
       (hexl-address-region ((t (:background "#252525"))))
       (hexl-ascii-region ((t (:foreground "#cfbfad"))))
       (speedbar-directory-face ((t (:foreground "light blue"))))
       (speedbar-tag-face ((t (:foreground "#cfbfad"))))
 )))
4

1 回答 1

0

我能够复制您的问题。hexl-mode 似乎有一个问题,它在模式启动时没有字体化缓冲区。

要强制hexl-mode字体化缓冲区,请将其添加到您的 .emacs

(require 'hexl)
(add-hook 'hexl-mode-hook 'font-lock-fontify-buffer)

我还提交了有关该问题的错误报告。

于 2013-04-12T18:26:15.353 回答