3

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
Community
  • 1
  • 1
Sandra Schlichting
  • 25,050
  • 33
  • 110
  • 162

4 Answers4

8

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)

Bozhidar Batsov
  • 55,802
  • 13
  • 100
  • 117
  • I can see the help screen, that you described, but for some reason, I don't have the ´set-face-italic-p´. When I do tab-completion on ´set-face´ I get those listen in the question. Do I need to install something? I use Linux. – Sandra Schlichting Jul 30 '10 at 21:14
  • set-face-italic-p is not an interactive function, so you can only call it by evaluating the above expression (put cursor behind the closing bracket, do C-x C-e). You cannot call it using M-x, which is why you don't see it when doing tab-completion. – pokita Aug 01 '10 at 09:40
6

Since emacs 24.4:

(set-face-italic 'font-lock-comment-face nil)
Björn Lindqvist
  • 19,221
  • 20
  • 87
  • 122
2
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.

Joel J. Adamson
  • 713
  • 4
  • 10
1

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
mistige
  • 619
  • 7
  • 11