help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sh mode for region only ?


From: Alexandre Oberlin
Subject: Re: sh mode for region only ?
Date: Wed, 09 May 2012 17:40:09 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

I noticed another problem when switching even temporarily to sh mode: the Enriched mode formatting goes away and does not come back.

Alexandre

On 05/09/2012 05:05 PM, Alexandre Oberlin wrote:
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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]