unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: daniel <idnael@gmail.com>
To: Marius Hofert <marius.hofert@math.ethz.ch>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Narrow: How to hide a specific part?
Date: Mon, 10 Jun 2013 14:43:09 +0100	[thread overview]
Message-ID: <CABX3oxarxQi3qD=SkDKOVVLcJw1b461XwLo9xubFp6eNQqKJGQ@mail.gmail.com> (raw)
In-Reply-To: <CAM3-KjYFtH0Vk8W2QXf+Fs3VxDG+ENdK5GCEEpy-05eRDTz6ew@mail.gmail.com>

hi! that was an elisp programming answear, not an user answear!

But you can load this elisp and then use functions hide-region and
unhide-region


(defun hide-region ()
  (interactive)
  (setq ov (make-overlay (region-beginning) (region-end)))
  (overlay-put ov 'invisible t)
  (overlay-put ov 'my-overlay t)
  )

(defun unhide-region ()
  (interactive)
  (loop for ov in (overlays-in (region-beginning) (region-end))
if (overlay-get ov 'my-overlay)
 do (delete-overlay ov)
)
  )



2013/6/10 Marius Hofert <marius.hofert@math.ethz.ch>

> Hi Daniel,
>
> Thanks for your quick reply.
>
> You mean selecting B? But how do you make it invisible? AFAIK,
> narrowing only makes regions visible, not invisible (?)
>
> Cheers,
>
> Marius
>
> On Mon, Jun 10, 2013 at 2:59 PM, daniel <idnael@gmail.com> wrote:
> > You could create an overlay in the B area and make it invisible, I
> think...
> > I did that one time.
> >
> > But most emacs function, like search, will continue to see the hidden
> part.
> >
> >
> > 2013/6/10 Marius Hofert <marius.hofert@math.ethz.ch>
> >>
> >> Hi,
> >>
> >> I recently discovered narrowing (C-x n n). Say I have three
> >> consecutive paragraphs...
> >>
> >> A
> >> B
> >> C
> >>
> >> ... and I want to hide the 'middle' one, that is, B, while keeping A
> >> and C visible. Can this be done with narrowing? (or in any similar
> >> way?). As far as I know, with narrowing, I can only narrow down to A
> >> or C but can't make them both visible simultaneously.
> >>
> >> Cheers,
> >>
> >> Marius
> >>
> >
>


  reply	other threads:[~2013-06-10 13:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 12:03 Narrow: How to hide a specific part? Marius Hofert
2013-06-10 12:59 ` daniel
2013-06-10 13:18   ` Marius Hofert
2013-06-10 13:43     ` daniel [this message]
2013-06-10 13:48       ` Bastien
2013-06-10 14:46         ` Marius Hofert
2013-06-10 15:04           ` daniel
2013-06-10 15:12             ` Marius Hofert

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CABX3oxarxQi3qD=SkDKOVVLcJw1b461XwLo9xubFp6eNQqKJGQ@mail.gmail.com' \
    --to=idnael@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=marius.hofert@math.ethz.ch \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).