[Top][All Lists]

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

Re: Narrowing to non-adjacent regions

From: Andreas Röhler
Subject: Re: Narrowing to non-adjacent regions
Date: Fri, 1 Feb 2008 15:27:52 +0100
User-agent: KMail/1.9.5

Am Mittwoch, 30. Januar 2008 20:42 schrieb address@hidden:
> 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)))
> _______________________________________________

As GNU Emacs enables only a single region at time
AFAIK, you'll need another tool to do this.

Already exists block.el, look, if it is suitable.

Once several blocks are known, set the remaining chars
to invisible. Maybe block.el delivers that already.


Andreas Röhler

reply via email to

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