-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disable Variable Pitch Mode #30
Comments
I think |
I'm also getting this issue, and i attemed setting: (add-hook 'polymode-init-inner-hook
(lambda () (variable-pitch-mode -1))) And the code inside blocks is still in my variable-pitch font |
I encounter the same issue when trying to remap faces: (add-hook 'polymode-init-inner-hook
(lambda ()
(let ((fix-pitch (face-attribute 'fixed-pitch :family))
(fix-font (face-attribute 'fixed-pitch :font))
(fix-height (face-attribute 'fixed-pitch :height)))
(face-remap-set-base 'default
:font fix-font :family fix-pitch :height fix-height)))) I also tried with Is there any way to modify faces within the inner modes? |
But can you make it work from within an inner mode? Whatever works manually should be working from the inner hook. |
Hi @vspinu :) Thank you for your work on polymode. Multi-mode org buffers are amazing. :) When you say make it work within an inner-mode, how do you mean? If I eval the |
I see. But that's how emacs works. You cannot have a face remap only on part of the buffer. It will always take effect on the entire buffer. Polymode moves |
Ah, when you put it that way, it makes sense. Thanks for explaining. :) I'm still a bit confused why the Maybe it would be better for me to explain what I'm trying to accomplish. I want to have the 'regular' contents of the org buffer displayed in a variable-pitch font, but have the org source blocks displayed in a fixed-pitch font, similar to what is achieved with something like mixed-pitch-mode. The problem as I understand it is, |
I am not expert on emacs fonts but if mixed-pitch can do it that mean we can also do it here. Unfortunately this issue is a bit low prio as I am working on bigger usuablity enhancements ATM. But if you can figure out how to make a face in a region of a buffer be of different pitch then we we figure how to do it on code spans. Particularly, if pitch can be configured as part of a face then you can plug that configuration into |
Thank you so much for the hint about Not sure if the way I'm doing it here is actually the smartest, but it's definitely getting the job done. :) So if anybody stumbles across this issue later looking to accomplish the same thing, the code is here: (Edit -- fixed a problem with this snippet) (use-package polymode
:after org
:config
(add-hook 'polymode-init-inner-hook
(lambda ()
(let* ((fix-pitch (face-attribute 'fixed-pitch :family))
(fix-font (face-attribute 'fixed-pitch :font))
(fix-height (face-attribute 'fixed-pitch :height))
(bg (face-attribute 'org-block-begin-line :background))
(props `(:background ,bg
:extend t
:height ,fix-height
:family ,fix-pitch
:font ,fix-font)))
(oset pm/chunkmode adjust-face props))))) |
Thanks @shtwzrd, this fixes the pitch issue for me. Not the end of the world, but it does breaks ligatures for me also (they work in a dedicated buffer as in |
Hi,
I use Org Mode with the Variable Pitch Mode enabled. I have configured the
org-block
face, so that it inherits thefixed-pitch
face, so that the font in the source blocks is still a monospace font.However this setup stoped working, when I enable poly-org, since now the
org-block
face is not applied (As far as I can tell.) and the innermodes still have the variable pitch mode enabled for some reason. I can move into a block manually and disable the variable-pitch mode manually there; or I can use the switch buffer hooks that polymode provides in order to disable the variable pitch mode, whenever I enter a source block.But this solution starts out with the variable pitch mode enabled for the inner buffers, which is really ugly and I havn't found a way to disable the Variable Pitch Mode only in the innermodes when opening a new org-file.
How would I do that?
The text was updated successfully, but these errors were encountered: