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

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

Re: Narrow: How to hide a specific part?


From: daniel
Subject: Re: Narrow: How to hide a specific part?
Date: Mon, 10 Jun 2013 14:43:09 +0100

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 via email to

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