From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexandre Oberlin Newsgroups: gmane.emacs.help Subject: Re: sh mode for region only ? Date: Wed, 09 May 2012 17:40:09 +0200 Organization: TeraNews.com Message-ID: <8dwqr.14$Rs4.8@newsfe04.iad> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1336578017 718 80.91.229.3 (9 May 2012 15:40:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 May 2012 15:40:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 09 17:40:16 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SS8zt-0005cq-Ar for geh-help-gnu-emacs@m.gmane.org; Wed, 09 May 2012 17:40:13 +0200 Original-Received: from localhost ([::1]:48275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SS8zs-0006Ha-LS for geh-help-gnu-emacs@m.gmane.org; Wed, 09 May 2012 11:40:12 -0400 Original-Path: usenet.stanford.edu!news.glorb.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe04.iad.POSTED!6712a1ff!not-for-mail User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 52 Original-X-Complaints-To: abuse@teranews.com Original-NNTP-Posting-Date: Wed, 09 May 2012 15:39:48 UTC X-Received-Bytes: 2453 Original-Xref: usenet.stanford.edu gnu.emacs.help:192374 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84781 Archived-At: 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 >>> >> >> >