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:05:30 +0200 Organization: TeraNews.com Message-ID: 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 1336576216 17197 80.91.229.3 (9 May 2012 15:10:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 May 2012 15:10:16 +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:10:15 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 1SS8Wr-0000Nl-AF for geh-help-gnu-emacs@m.gmane.org; Wed, 09 May 2012 17:10:13 +0200 Original-Received: from localhost ([::1]:32957 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SS8Wq-0003e1-Db for geh-help-gnu-emacs@m.gmane.org; Wed, 09 May 2012 11:10:12 -0400 Original-Path: usenet.stanford.edu!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe23.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: 42 Original-X-Complaints-To: abuse@teranews.com Original-NNTP-Posting-Date: Wed, 09 May 2012 15:05:10 UTC X-Received-Bytes: 2181 Original-Xref: usenet.stanford.edu gnu.emacs.help:192372 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:84779 Archived-At: 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 >> > >