font-lock-mode in haskell-mode seems to ruin the width of single spaces in emacs

212 Views Asked by At

I find that font-lock-mode are doing something wrong with the width of single spaces no matter what monospace font I'm using.

Here are some screenshots:

  • Using DejaVu Sans Mono:

    font-lock-mode on:

    djv1

    font-lock-mode off:

    djv2

  • Using Luculent:

    font-lock-mode on:

    lu1

    font-lock-mode off:

    lu2

Related (maybe) lines in my emacs init file:

(custom-set-variables
 ...
(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.
 '(default ((t (:inherit nil :stipple nil :inverse-video nil
                :box nil :strike-through nil :overline nil
                :underline nil :slant normal :weight normal
                :height 120 :width normal 
                :foundry "unknown" :family "Luculent")))))

Edit: Thanks to @Boojum 's help, I did C-u C-x = on 3 different style of characters. This is the result. I guess the problem is SPC does not have a "face" property.

In addition, I also tried switching to other major modes and found that this problem only happens in haskell-mode.

1

There are 1 best solutions below

7
Boojum On

I'm not sure what's going on, offhand, but it looks like the bold text is set to a size that's slightly larger than the default. Do you have any customizations on font-lock-keyword-face? Do you have a site configuration file that might be customizing the faces?

One thing that may help to debug this is to place the point on some of the bold text in your example and type C-u C-x = This will give you some more information on what's contributing to how it's displayed. Also do this on some of the default (non-bold) text. If you post the replies here we might be able to help you better.