开发者

Disable italic in Emacs?

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开发者_如何学C-foreground
set-face-inverse-video-p    set-face-stipple
set-face-underline        set-face-underline-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)


Since emacs 24.4:

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


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.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜