Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In org-mode - is there a way I can make emacs treat a region to be of a given mode (with syntax highlighting and so on). I tried the following for bash:

#+begin_src bash
# -*- mode:sh -*-
find . -type f -not -name '*[[:digit:]]*'

it doesn't work - it just shows the find line in grey. I want to be highlighted as if I were in a shell-script mode, or at least - black - with no org-mode parsing.


The (setq org-src-fontify-natively t) solves it, but org still interprets [[:digit:]] as a link:

#+begin_src sh 
find . -type f -not -name '*[[:digit:]]*'

can this be turned of somehow?

share|improve this question
It's been a long time… – Adobe May 28 '15 at 20:42
up vote 7 down vote accepted

(setq org-src-fontify-natively t)

share|improve this answer
This solution requires me to have (org-babel-do-load-languages 'org-babel-load-languages '( (R . t) (sh . t) (python . t) (perl . t) )) right? – Adobe May 29 '12 at 9:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .