help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Narrowing to non-adjacent regions


From: address@hidden
Subject: Narrowing to non-adjacent regions
Date: Wed, 30 Jan 2008 11:42:51 -0800 (PST)
User-agent: G2/1.0

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)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]