From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "davidjneu@gmail.com" Newsgroups: gmane.emacs.help Subject: Narrowing to non-adjacent regions Date: Wed, 30 Jan 2008 11:42:51 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1201725645 1107 80.91.229.12 (30 Jan 2008 20:40:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jan 2008 20:40:45 +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 Jan 30 21:41:06 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JKJk1-0002dp-Ri for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Jan 2008 21:41:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKJja-0003bG-7p for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Jan 2008 15:40:38 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!d4g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 23 Original-NNTP-Posting-Host: 75.69.180.181 Original-X-Trace: posting.google.com 1201722171 29839 127.0.0.1 (30 Jan 2008 19:42:51 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 30 Jan 2008 19:42:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d4g2000prg.googlegroups.com; posting-host=75.69.180.181; posting-account=_vJVmgkAAACAf1R7VaMjDxwcWTk8rrkB User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.11) Gecko/20080127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:155716 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:51099 Archived-At: Hi, Hi, I'm wondering if it's possible to narrow a buffer so that multiple non-adjacent regions are displayed. The code snippet below doesn't work, but conveys what I'm looking for. Many thanks! Cheers, David (defun narrow-two () (interactive "*") (widen) (goto-char (point-min)) (let ((start-1 (point)) (end-1 (progn (next-line 5) (point))) (start-2 (progn (next-line 7) (point))) (end-2 (progn (end-of-buffer) (point)))) (narrow-to-region start-1 end-1) (narrow-to-region start-2 end-2)))