Question

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
Was it helpful?

Solution

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)

OTHER TIPS

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top