From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Carlson Subject: Re: PATCH: ox: Starting source code export at non-zero (-n value) Date: Sun, 29 May 2016 22:45:06 -0400 Message-ID: <574BA932.20203@abutilize.com> References: <573A9100.3020503@abutilize.com> <87k2iobglr.fsf@saiph.selenimh> <57428051.4000103@abutilize.com> <87zirf9r5w.fsf@saiph.selenimh> <87bn3v9oxp.fsf@saiph.selenimh> <57466847.3010507@abutilize.com> <87eg8pb9au.fsf@saiph.selenimh> Reply-To: hacker@abutilize.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080608040206050307070109" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7DHM-00081q-IE for emacs-orgmode@gnu.org; Sun, 29 May 2016 22:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7DHI-0003UY-5n for emacs-orgmode@gnu.org; Sun, 29 May 2016 22:50:07 -0400 Received: from gateway21.websitewelcome.com ([192.185.45.212]:38235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7DHH-0003UR-R4 for emacs-orgmode@gnu.org; Sun, 29 May 2016 22:50:04 -0400 Received: from cm3.websitewelcome.com (unknown [108.167.139.23]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 00639AC928EE7 for ; Sun, 29 May 2016 21:50:02 -0500 (CDT) Received: from pool-173-76-187-225.bstnma.fios.verizon.net ([173.76.187.225]:34806 helo=[192.168.1.11]) by gator3208.hostgator.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1b7DCN-000HfH-LP for emacs-orgmode@gnu.org; Sun, 29 May 2016 21:44:59 -0500 In-Reply-To: <87eg8pb9au.fsf@saiph.selenimh> 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: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------080608040206050307070109 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 2016-05-26 02:52, Nicolas Goaziou wrote: >> I realize that the org texinfo manual probably needs to be updated, as well. I'll take a stab at updating that unless >> someone else wants to take that on. > > You're right. You can merge ORG-NEWS modifications into the > documentation patch. Here is the patch for both doc/org.texi and etc/ORG-NEWS. I apologize for the delay in getting this to the list. Thanks! ;-b --------------080608040206050307070109 Content-Type: text/x-patch; name="0001-org.texi-Updated-doc-for-n-in-SRC-EXAMPLE-export.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-org.texi-Updated-doc-for-n-in-SRC-EXAMPLE-export.patch" >From 466f0c755180f7475484abc6715accdf74a8a0f3 Mon Sep 17 00:00:00 2001 From: "Brian J. Carlson" Date: Sun, 29 May 2016 22:37:18 -0400 Subject: [PATCH] org.texi: Updated doc for [+-]n in SRC/EXAMPLE export * doc/org.texi (Timers): Added information about optional argument to -n/+n line-numbering * etc/ORG-NEWS: Added infomation for "Provide offset to [+-]n in SRC/EXAMPLE export" (commit af8e3d8) --- doc/org.texi | 29 ++++++++++++++++++++++------- etc/ORG-NEWS | 16 ++++++++++++++++ 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 9d89975..0d0d30f 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -10045,13 +10045,28 @@ shortcuts to easily insert code blocks. Both in @code{example} and in @code{src} snippets, you can add a @code{-n} switch to the end of the @code{BEGIN} line, to get the lines of the example -numbered. If you use a @code{+n} switch, the numbering from the previous -numbered snippet will be continued in the current one. In literal examples, -Org will interpret strings like @samp{(ref:name)} as labels, and use them as -targets for special hyperlinks like @code{[[(name)]]} (i.e., the reference name -enclosed in single parenthesis). In HTML, hovering the mouse over such a -link will remote-highlight the corresponding code line, which is kind of -cool. +numbered. The @code{-n} takes an optional numeric argument specifying the starting +line number of the block. If you use a @code{+n} switch, the numbering from +the previous numbered snippet will be continued in the current one. The +@code{+n} can also take a numeric argument. The value of the argument will be +added to the last line of the previous block to determine the starting line +number. +@example +#+BEGIN_SRC emacs-lisp -n 20 + ;; this will export with line number 20 + (message "This is line 21") +#+END_SRC +#+BEGIN_SRC emacs-lisp +n 10 + ;; This will be listed as line 31 + (message "This is line 32") +#+END_SRC +@end example + +In literal examples, Org will interpret strings like @samp{(ref:name)} as +labels, and use them as targets for special hyperlinks like @code{[[(name)]]} +(i.e., the reference name enclosed in single parenthesis). In HTML, hovering +the mouse over such a link will remote-highlight the corresponding code line, +which is kind of cool. You can also add a @code{-r} switch which @i{removes} the labels from the source code@footnote{Adding @code{-k} to @code{-n -r} will @i{keep} the diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 72f8d5c..34eb9ab 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -159,6 +159,22 @@ If the block has a =#+NAME:= attribute assigned, then the HTML element will have an ~id~ attribute with that name in the HTML export. This enables one to create links to these elements in other places, e.g., ~text~. +**** Line Numbering in SRC/EXAMPLE blocks support arbitrary start number +The ~-n~ option to ~SRC~ and ~EXAMPLE~ blocks can now take a numeric +argument to specify the staring line number for the source or example +block. The ~+n~ option can now take a numeric argument that will be +added to the last line number from the previous block as the starting +point for the SRC/EXAMPLE block. +#+BEGIN_SRC org + ,#+BEGIN_SRC emacs-lisp -n 20 + ;; this will export with line number 20 + (message "This is line 21") + ,#+END_SRC + ,#+BEGIN_SRC emacs-lisp +n 10 + ;; This will be listed as line 31 + (message "This is line 32") + ,#+END_SRC +#+END_SRC *** Babel **** Support for SLY in Lisp blocks -- 2.8.3 --------------080608040206050307070109--