all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@online.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Narrowing to non-adjacent regions
Date: Fri, 1 Feb 2008 20:00:33 +0100	[thread overview]
Message-ID: <200802012000.33596.andreas.roehler@online.de> (raw)
In-Reply-To: <fb5c72c1-f708-430d-8d4b-dffe105be5cc@d4g2000prg.googlegroups.com>

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


here is multi-region.el

working right out of the box.

http://www.ph.ed.ac.uk/~s0198183/multi-region.el

It comes with a command

,----
| (defun multi-region-execute-command (&optional arg cmd)
|   "Perform a command on all active multi-regions.
`----

Remains just to revert that, making it work at all
non-active parts.

Andreas Röhler




      parent reply	other threads:[~2008-02-01 19:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30 19:42 Narrowing to non-adjacent regions davidjneu@gmail.com
2008-02-01 14:27 ` Andreas Röhler
2008-02-01 14:39   ` Lennart Borgman (gmail)
2008-02-01 16:58     ` Andreas Röhler
2008-02-01 18:51     ` Andreas Röhler
2008-02-01 19:00 ` Andreas Röhler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200802012000.33596.andreas.roehler@online.de \
    --to=andreas.roehler@online.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.