在hexl-mode emacs中配置颜色

时间:2013-04-11 15:08:01

标签: emacs hex

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

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

<00> 00000000:2550 4446 2d31 2e34 0a25 c7ec 8fa2 0a35%PDF-1.4。%..... 5 00000010:2030 206f 626a 0a3c 3c2f 4c65 6e67 7468 0 obj。&lt;

我尝试更新我的颜色主题:

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

1 个答案:

答案 0 :(得分:0)

我能够复制你的问题。 hexl-mode似乎存在一个问题,它在模式启动时不会使缓冲区显示出来。

要强制hexl-mode为缓冲区提供支持,请将其添加到.emacs

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

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