在 Emacs 中,如何创建将某个颜色常量映射到另一种颜色?

发布于 2024-10-18 00:55:22 字数 140 浏览 8 评论 0原文

我使用 Emacs 本机 Win 32,但使用 emacs -nw 在 DOS 提示符下运行它。我喜欢它。 但是,我无法轻松读取面部前景的蓝色。现在我喜欢将所有蓝色映射为浅蓝色。

有类似这样的别名吗?

谢谢。

I use Emacs native Win 32, but run it in DOS Prompt using emacs -nw. I love it.
But, I can not easily read the blue color for a face foreground. And now I like to mapped all blue color, to be lightblue.

Is there some sort of alias like this?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

可是我不能没有你 2024-10-25 00:55:22

我认为你应该从 颜色主题 包开始,然后选择你喜欢的颜色主题。

稍后您可以通过执行Mxcustomize-face来调整某些颜色。命令Mx list-colors-display将帮助您选择正确的颜色。

编辑:您在文本终端上运行 Emacs 吗?那么你可以尝试使用 tty-color-define。不幸的是我无法测试它,因为我的终端上没有 Emacs。

(defun my-define-red()
  (interactive)
  (tty-color-define "red" 1 (list 32000 12000 12000)))

I think you should start with a Color theme package and choose a color theme you like.

Later you can adjust certain colors by doing M-x customize-face. The command M-x list-colors-display will help you to pick a right color.

EDIT: Do you run Emacs on text terminal? Then you may try to use tty-color-define. Unfortunately I cannot test it because I don't have Emacs on the terminal.

(defun my-define-red()
  (interactive)
  (tty-color-define "red" 1 (list 32000 12000 12000)))
月光色 2024-10-25 00:55:22

如果您想要做的只是像我一样修复迷你缓冲区提示(在终端中的 Cygwin emacs 中默认为深蓝色黑色),请尝试使用以下命令编辑迷你缓冲区提示面:

  1. Mx list-faces-display
  2. select "minibuffer-prompt"并按回车键
  3. 转到前台属性并将光标放在 [ 选择 ] 区域上,然后按回车键
  4. 向下滚动到“绿色”,然后按回车键
  5. 向上至 [ 保存以供将来的会话 ] 并按回车键(这会将其写入您的 .emacs文件)

这是它添加到我的内容中的内容:

(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.
 '(minibuffer-prompt ((t (:foreground "green"))))

If all you want to do is fix the minibuffer prompt like I did (defaults to dark blue on black in Cygwin emacs in a terminal) try editing the minibuffer-prompt face using this:

  1. M-x list-faces-display
  2. select "minibuffer-prompt" and hit enter
  3. Go to foreground property and put your cursor over the [ Choose ] area and hit enter
  4. scroll down to "green" and hit enter
  5. Go up to [ Save for future sessions ] and hit enter (this will write it to your .emacs file)

This is what it added to mine:

(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.
 '(minibuffer-prompt ((t (:foreground "green"))))
蓝咒 2024-10-25 00:55:22
  1. Mx 列表面显示。
  2. 选择要自定义的面(使用蓝色的面显示为蓝色等)。 (要选择,请按 。)
  3. 转到“前景”属性并将蓝色更改为其他内容,例如青色。
  4. 如果没有选择前景,请选择青色或其他颜色。
  1. M-x list-faces-display.
  2. Select the face you want to customize (the ones using blue color are displayed in blue and so forth). (To select, press .)
  3. Goto "foreground" property and change blue to something else, say cyan.
  4. If no foreground selected, choose cyan or something else.
孤蝉 2024-10-25 00:55:22

如果将其添加到 .emacs 中,所有默认面孔都会适应深色背景:

(custom-set-variables '(frame-background-mode 'dark))

If you add this to your .emacs, all default faces will adapt to the dark background:

(custom-set-variables '(frame-background-mode 'dark))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文