From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivanov Dmitry Subject: How to show/hide the snippet block in org-babel when the cursor is inside the snippet text Date: Tue, 16 Dec 2014 14:33:26 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1cde0397ba0050a53bac1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0qNf-00068L-B0 for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 06:33:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0qNb-0000SX-QZ for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 06:33:31 -0500 Received: from mail-ob0-x229.google.com ([2607:f8b0:4003:c01::229]:64123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0qNb-0000SK-KI for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 06:33:27 -0500 Received: by mail-ob0-f169.google.com with SMTP id vb8so22404133obc.0 for ; Tue, 16 Dec 2014 03:33:26 -0800 (PST) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --e89a8ff1cde0397ba0050a53bac1 Content-Type: text/plain; charset=UTF-8 I would like to implement the following. Suppose, we have this org file: #+BABEL: :cache yes :tangle yes :noweb yes #+NAME: top_block#+begin_src perl :tangle "test.pl" :noweb tangle :shebang #!/usr/bin/perl use strict; use warnings; open(my $fh, "<", "test.txt") or die "cannot open < file name: $!"; <> close($fh);#+end_src #+NAME: output-all#+begin_src perl while (my $line = <$fh>) { print $line; }#+end_src I can expand/collapse src blocks only when the cursor is on the top lines: #+NAME: top_block#+begin_src perl ... But when it is inside any text in the scr block, expand/collapse doesn't work. How can I add this functionality as moving the cursor every time is not nice. --e89a8ff1cde0397ba0050a53bac1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I would like to implement the following. Suppose, we have = this org file:

#+BABEL: :cache yes :tangle yes :<=
span class=3D"">noweb yes

#+NAME: top_block
#+begin_src perl :tangle "=
;test.pl" :noweb tangle :shebang #!/usr/bin/perl
  use strict;
  use warnings;

  open(my $fh, "<",<=
/span> "test.txt"=
)
      or die "cannot open < file name: $!&q=
uot;;
  <<output-all=
>>
  close($fh);
#+end_src

#+NAME: output-all
#+begin_src perl
  while (my $line =3D <$fh>) <=
/span>{
      print $line;
  }
#+end_src

I can expand/collapse src blocks only wh=
en the cursor is on the top lines:

#+NAME: top_block
#+begin_src perl ...
But when =
it is inside any text in the scr block, expand/collapse doesn't 
work. How can I add this functionality as moving the c= ursor every time is
not nice.
--e89a8ff1cde0397ba0050a53bac1--