From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: narrow question Date: Wed, 27 Sep 2006 13:53:33 +0200 Organization: Organization?!? Message-ID: <85irj9r0ea.fsf@lola.goethe.zz> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1159360882 26725 80.91.229.2 (27 Sep 2006 12:41:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Sep 2006 12:41:22 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 27 14:41:20 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GSYiH-0006WA-9Z for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Sep 2006 14:40:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GSYiG-0004d8-Kr for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Sep 2006 08:40:32 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:rxOV78ITjkbH+rv6uciKi+EAtSY= Original-Lines: 18 Original-NNTP-Posting-Date: 27 Sep 2006 13:53:38 CEST Original-NNTP-Posting-Host: c9091796.newsspool2.arcor-online.net Original-X-Trace: DXC=^>DW0GJ5:_[\PS5Xo=M[RVA9EHlD; 3YcR4Fo<]lROoRQ4nDHegD_]RU]KeUVjgo<3\CV`H8_`hhQT^9QSCVg3dOVlR6Na\ Original-X-Complaints-To: usenet-abuse@arcor.de Original-Xref: shelby.stanford.edu gnu.emacs.help:142053 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:37674 Archived-At: Barry Margolin writes: > In article , > ray wrote: > >> I have learned to use narrow-to-region to narrow a buffer. But how can I >> determine whether a buffer is narrowed with elisp? Thanks. > > (defun buffer-narrowed-p () > (/= (- (point-max-marker) (point-min-marker)) > (buffer-size))) That is a bad idea since it creates unnecessary markers which slow down editing until they are garbage-collected. Just use (point-max) and (point-min) instead. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum