i have org mode set up with typo minor mode and pretty entities enabled by default.
but when i work on programming, these two are totally useless inside the source code blocks i insert into org files. is it possible to disable them for src blocks only?
i don’t understand if there’s a hook or header or something similar for such things? i actually don’t know what kind of object the blocks are.
my only solution so far has been to use local variables to disable the in the whole file individually. but it would make sense to me to disable them universally, but only in the blocks, as no one will need typographic inverted commas in src blocks.
steps: * install typo mode, and enable typo mode in org buffers with something like (typo-global-mode 1) / (add-hook 'org-mode-hook 'typo-mode) in your init file.
in an org buffer, insert a source block with #+begin_src
quotes inserted inside the block are prettified by typo mode, and your code parser throws an error.
to disable typo (and also pretty entities) i added this to the bottom of my file:
# Local Variables: # # eval: (typo-mode -1) # # eval: (org-toggle-pretty-entities) # # End: #
this disables both for the whole file though, not just for the src block. i thought something similar might be possible for blocks and other such structures. and i would be interested in learning how that works.beg
- https://github.com/kunalb/poet also enables typo-mode and inserts nice code blocks. maybe they have the secret!