From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Hansen Newsgroups: gmane.emacs.help Subject: Re: How to use `narrow'? Date: Tue, 18 Oct 2005 14:53:30 +0200 Organization: disorganized Message-ID: <87ek6j17i5.fsf@robotron.ath.cx> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129641493 10614 80.91.229.2 (18 Oct 2005 13:18:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Oct 2005 13:18:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 18 15:18:12 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ERrLB-0002nY-Kz for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Oct 2005 15:17:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ERrLB-0000mK-5P for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Oct 2005 09:17:17 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!npeer.de.kpn-eurorings.net!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-X-Trace: news.uni-berlin.de oJZkriMTq7JNJCayGShlMAJiXzZQLnZC/Peewnn5YeAw== X-Orig-Path: robotron.ath.cx!news Mail-Copies-To: nobody User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:4VNye8NpboMUuHGPazu3xrXDFPo= Original-Xref: shelby.stanford.edu gnu.emacs.help:134740 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:30322 Archived-At: On Tue, 18 Oct 2005 02:09:51 +0000 (UTC) Ilya Zakharevich wrote: > My idea how *I* would use `narrow' is like this: > > Suppose I have a file which is "in multiple modes". E.g., consider > some "literate programming" style text, or one which contains a > HERE-document with a program in a different language than the main > text of the document: > > $var = < > // Here is some code in JavaScript > ... > > EOV > > So I would like to narrow to the region "inside the HERE-document", > and switch the mode to "other mode" (above, from CPerl mode to > JavaScript mode). > > However, I looked, and `font-lock' does `widen' before it starts up; > so all the effect of narrowing is gone... Is there any *use* of > narrowing? Is this working? (add-hook 'java-scrip-mode-hook (lambda () (set (make-local-variable 'font-lock-dont-widen t)))) ,----[ C-h v font-lock-dont-widen RET ] | font-lock-dont-widen is a variable defined in `font-lock'. | Its value is nil | | Documentation: | If non-nil, font-lock will work on the non-widened buffer. | Useful for things like RMAIL and Info where the whole buffer is not | a very meaningful entity to highlight. `---- David