mariownyou · 2022-08-31 19:04
​
https://preview.redd.it/nqk2tsmik3l91.png?width=2092&format=png&auto=webp&s=5bcdbd8c89240e477e2e1836dd32347b68d86fae
MitchellMarquez42 · 2022-08-31 19:17
The reason there's different highlight groups is so emacs can render source blocks the same way as buffers with just code. This is useful especially with org-variable-pitch-mode, where you can use proportional fonts for the main text and colored monospace fonts for source blocks.
You can check which fonts specifically are used for the block with:
M-x describe-face RET org-block RET
mitchTux · 2022-08-31 19:27
just to add to this. the font and style can be set for *any* face and every bit of text has some face. The function `list-faces-display` will show you all the different ones with their current setting.
mariownyou · 2022-08-31 19:38
How can I turn of this feature, I want source block to use default font. Current default font is the font text uses
mitchTux · 2022-08-31 19:51
You can try running `M-x customize-face RET variable-pitch RET` then unchecking the "Font Family" attribute then clicking `Apply and Save`
There might be a better way to go about this but that's essentially how I solved it :P
You can also try editing the `org-block` face instead of `variable-pitch` if you only want this font change to only happen specifically for org blocks
ieure · 2022-08-31 20:05
Short answer: The theme you chose made it that way.
> How can I turn of this feature, I want source block to use default font.
Use a different theme, or figure out what that theme did which you don't like, and change it.
mariownyou · 2022-08-31 20:41
(deftheme default-black
"Automatically created 2013-05-20.")
(custom-theme-set-faces
'default-black
'(default ((t (:inherit nil :stipple nil :background "Black" :foreground "White" :inverse-video nil :box nil :strike-t*hrough nil :overline nil :underline nil :slant normal :weight normal :width normal :height 105))))
'(highlight ((((class color) (min-colors 88) (background dark)) (:background "#111111"))))
'(region ((nil (:background "#464740"))))
'(hl-line ((nil (:background "#222222"))))
'(yas-field-highlight-face ((nil (:background "#333399"))))
'(js2-function-param-face ((t (:foreground "LightGoldenrod"))))
'(font-lock-warning-face ((nil (:foreground "#ff6666"))))
'(show-paren-match ((nil (:background "#333399"))))
'(show-paren-mismatch ((((class color)) (:background "red")))))
(provide-theme 'default-black)
That is all nothing else. Some others themes works fine, modus themes works fine. this one is not, Gruber darker also has the same problem
ieure · 2022-08-31 21:34
Your code is broken on old reddit, but I do see that you're changing the height of `default` in there.
All's I can really say is: what you shows in the screenshot isn't the default. Therefore, something in your own config is doing the thing you don't want.
mariownyou · 2022-09-01 07:04
I found out that it is default behaviour of emacs. Try any default theme. Source block will look different
causal_friday · 2022-09-01 14:06
Just having your point on the face you want to change and doing customize-face will select that one.
ocodo · 2022-09-01 16:46
(deftheme default-black
"Automatically created 2013-05-20."
(custom-theme-set-faces
'default-black
'(default ((t (:inherit nil
:stipple nil
:background "Black"
:foreground "White"
:inverse-video nil
:box nil
:strike-t*hrough nil
:overline nil
:underline nil
:slant normal
:weight normal
:width normal
:height 105))))
'(highlight ((((class color) (min-colors 88) (background dark)) (:background "#111111"))))
'(region ((nil (:background "#464740"))))
'(hl-line ((nil (:background "#222222"))))
'(yas-field-highlight-face ((nil (:background "#333399"))))
'(js2-function-param-face ((t (:foreground "LightGoldenrod"))))
'(font-lock-warning-face ((nil (:foreground "#ff6666"))))
'(show-paren-match ((nil (:background "#333399"))))
'(show-paren-mismatch ((((class color)) (:background "red"))))))
(provide-theme 'default-black)
Just formatting it.
ieure · 2022-09-01 17:53
Try to reproduce with `emacs -Q`.