From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: how does invisibility impact org? Date: Tue, 26 Apr 2016 14:47:03 -0400 Message-ID: References: <87h9eop68l.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114b243c138a7b053167b836 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av80n-0001pU-I5 for emacs-orgmode@gnu.org; Tue, 26 Apr 2016 14:47:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1av80m-0006xh-9y for emacs-orgmode@gnu.org; Tue, 26 Apr 2016 14:47:05 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:36494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av80m-0006xW-0C for emacs-orgmode@gnu.org; Tue, 26 Apr 2016 14:47:04 -0400 Received: by mail-wm0-x231.google.com with SMTP id v188so143759500wme.1 for ; Tue, 26 Apr 2016 11:47:03 -0700 (PDT) In-Reply-To: <87h9eop68l.fsf@gmx.us> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Rasmus Cc: "emacs-orgmode@gnu.org" --001a114b243c138a7b053167b836 Content-Type: text/plain; charset=UTF-8 normally I would use narrowing, but I want to see all the verses in the document at once., so I was going to make all the other text temporarily invisible. John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Tue, Apr 26, 2016 at 2:36 PM, Rasmus wrote: > John Kitchin writes: > > > Hi, I am trying to use this code to make parts of an org-file that are > > not a verse block invisible. That part works fine, and I can also unhide > > it. However, after that, I get errors like > > Isn't this the job of narrowing and widening? Though I guess this could > only show one verse block at the time. > > I.e. use something like this: > > (defun narrow-to-next-verse () > (interactive) > (widen) > (let ((next-elm (search-forward-regexp "^#\\+BEGIN_VERSE" nil t))) > (when next-elm > (widen) > (goto-char next-elm) > (org-narrow-to-element) > (goto-char (point-min)) > (forward-line)))) > > Rasmus > > -- > Hooray! > > > --001a114b243c138a7b053167b836 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
normally I would use narrowing, but I want to see all the = verses in the document at once., so I was going to make all the other text = temporarily invisible.

Jo= hn

-----------------------------------
Professor John Kitchin=C2= =A0
Doherty Hall A207F
Department of Chemical Engineering
Carnegie= Mellon University
Pittsburgh, PA 15213
412-268-7803
=

On Tue, Apr 26, 2016 at 2:36 PM, Rasmus <rasmus= @gmx.us> wrote:
John Kitchin <jkitchin@= andrew.cmu.edu> writes:

> Hi, I am trying to use this code to make parts of an org-file that are=
> not a verse block invisible. That part works fine, and I can also unhi= de
> it. However, after that, I get errors like

Isn't this the job of narrowing and widening?=C2=A0 Though I gue= ss this could
only show one verse block at the time.

I.e. use something like this:

(defun narrow-to-next-verse ()
=C2=A0 (interactive)
=C2=A0 (widen)
=C2=A0 (let ((next-elm (search-forward-regexp "^#\\+BEGIN_VERSE" = nil t)))
=C2=A0 =C2=A0 (when next-elm
=C2=A0 =C2=A0 =C2=A0 (widen)
=C2=A0 =C2=A0 =C2=A0 (goto-char next-elm)
=C2=A0 =C2=A0 =C2=A0 (org-narrow-to-element)
=C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))
=C2=A0 =C2=A0 =C2=A0 (forward-line))))

Rasmus

--
Hooray!



--001a114b243c138a7b053167b836--