在 Emacs 中禁用斜体?

发布于 2024-09-12 08:58:04 字数 439 浏览 5 评论 0原文

我真的很想在 Emacs 中禁用斜体样式。

这篇文章中解释了如何禁用粗体并下划线,但不是斜体。

有谁知道该怎么做?

使用制表符完成,我可以看到我有这些可用的

set-face-background          set-face-background-pixmap
set-face-font              set-face-foreground
set-face-inverse-video-p    set-face-stipple
set-face-underline        set-face-underline-p

I would really like to have the italic style disabled in Emacs.

In this post it is explained how to disable bold and underline, but not italic.

Does anyone know how to do that?

Using tab-completion, I can see I have these available

set-face-background          set-face-background-pixmap
set-face-font              set-face-foreground
set-face-inverse-video-p    set-face-stipple
set-face-underline        set-face-underline-p

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

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

发布评论

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

评论(4

南城旧梦 2024-09-19 08:58:04

它实际上以非常相似的方式完成:

(set-face-italic-p 'italic nil)

请参阅该函数的文档以获取更多详细信息(Ch f set-face-italic-p)

It's actually done in a very similar manner:

(set-face-italic-p 'italic nil)

Refer to the function's documentation for further details(C-h f set-face-italic-p)

几味少女 2024-09-19 08:58:04

emacs 24.4 起:

(set-face-italic 'font-lock-comment-face nil)

Since emacs 24.4:

(set-face-italic 'font-lock-comment-face nil)
于我来说 2024-09-19 08:58:04
M-x customize-face RET italic RET

slant 属性更改为“正常”。

一个丑陋的黑客(错误或功能?)是使用没有斜体的字体,例如 Terminus。这就是我用的。我有时将斜体设置为从可变间距而不是默认继承,并且当字体没有倾斜版本时会创建斜体。

M-x customize-face RET italic RET

Change the slant property to "normal."

An ugly hack (bug or feature?) is to use a font that has no italic, like Terminus. That's what I use. I have sometimes set italic to inherit from variable-pitch instead of default and that creates an italic when the font has no slanted version.

乖不如嘢 2024-09-19 08:58:04

emacs 25.x 在这里:

M-x make-face-unitalic <ENTER>
default  <ЕNTER>   # <- your answer to "Make which face unitalic:"

有时上面的方法不起作用,然后尝试这些额外的命令:

C-x h      # select all of the text
M-x make-face-unitalic  < ENTER>
<ENTER>    # <-- selects the default option to apply it to whole region
C-g        # deselect region

emacs 25.x here:

M-x make-face-unitalic <ENTER>
default  <ЕNTER>   # <- your answer to "Make which face unitalic:"

Sometimes the above does not work, then try these extra commands:

C-x h      # select all of the text
M-x make-face-unitalic  < ENTER>
<ENTER>    # <-- selects the default option to apply it to whole region
C-g        # deselect region
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文