Thanks Doug for your answer.
Actually changing the mode of the buffer (be it narrowed, cloned or not)
does not consistently help, because even if it is not seen, the non code
text impacts on the code highlighting.
Even with standalone code blocks or delimiters, I can't see how to get
this to work without commenting out the non code sections.
Alexandre
On 05/09/2012 04:19 PM, Doug Lewan wrote:
At my last job I had to work with HTML that was heavily laden with
JavaScript, so something similar was very useful for me.
I wrote a post-command-hook to see if the point had moved into a
region of JavaScript and, if it had, then change to JavaScript mode.
If your regions of shell code have reasonably consistent delimiters,
then doing the same thing should not be too difficult.
,Doug
-----Original Message-----
From: help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org
[mailto:help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org] On
Behalf Of Alexandre Oberlin
Sent: Wednesday, 2012 May 09 09:26
To: help-gnu-emacs@gnu.org
Subject: sh mode for region only ?
Hi all,
Is there a possibility to benefit of sh (or whatever) syntax
highlighting on a region only?
This could be useful when editing a list of instructions containing
codes.
Alexandre