* Extra empty line at the top of the page when tangling.
@ 2014-10-22 4:53 Ivanov Dmitry
2014-10-22 6:26 ` Daimrod
0 siblings, 1 reply; 2+ messages in thread
From: Ivanov Dmitry @ 2014-10-22 4:53 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 467 bytes --]
Code:
#+BABEL: :cache yes :tangle yes :noweb yes
#+NAME: top_block
#+begin_src perl :tangle "test.pl" :noweb tangle
#!/usr/bin/perl
use strict;
use warnings;
open(my $fh, "<", "test.txt")
or die "cannot open < file name: $!";
<<output-all>>
close($fh);
#+end_src
#+NAME: output-all
#+begin_src perl
while (my $line = <$fh>) {
print $line;
}
#+end_src
Outputs a perl file, where the 1-st line is blank. What should I do to
remove it?
[-- Attachment #2: Type: text/html, Size: 687 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Extra empty line at the top of the page when tangling.
2014-10-22 4:53 Extra empty line at the top of the page when tangling Ivanov Dmitry
@ 2014-10-22 6:26 ` Daimrod
0 siblings, 0 replies; 2+ messages in thread
From: Daimrod @ 2014-10-22 6:26 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]
Ivanov Dmitry <usr345@gmail.com> writes:
Hi,
> Code:
>
> #+BABEL: :cache yes :tangle yes :noweb yes
>
> #+NAME: top_block
> #+begin_src perl :tangle "test.pl" :noweb tangle
From (info "(org) padline"):
> 14.8.2.10 ‘:padline’
> ....................
>
> Control in insertion of padding lines around code block bodies in
> tangled code files. The default value is ‘yes’ which results in
> insertion of newlines before and after each tangled code block. The
> following arguments are accepted.
>
> • ‘yes’ Insert newlines before and after each code block body in
> tangled code files.
> • ‘no’ Do not insert any newline padding in tangled output.
You can use the following block declaration:
#+begin_src perl :tangle "test.pl" :noweb tangle :padline no
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> open(my $fh, "<", "test.txt")
> or die "cannot open < file name: $!";
> <<output-all>>
> close($fh);
> #+end_src
>
> #+NAME: output-all
> #+begin_src perl
> while (my $line = <$fh>) {
> print $line;
> }
> #+end_src
>
> Outputs a perl file, where the 1-st line is blank. What should I do to remove it?
--
Daimrod/Greg
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-22 6:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22 4:53 Extra empty line at the top of the page when tangling Ivanov Dmitry
2014-10-22 6:26 ` Daimrod
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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).