From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: line numbers in org src blocks? Date: Tue, 13 Oct 2015 10:23:15 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlwk8-0004mA-6q for emacs-orgmode@gnu.org; Tue, 13 Oct 2015 06:23:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zlwk5-0000Ic-Jx for emacs-orgmode@gnu.org; Tue, 13 Oct 2015 06:23:40 -0400 Received: from plane.gmane.org ([80.91.229.3]:39324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlwk5-0000IH-DA for emacs-orgmode@gnu.org; Tue, 13 Oct 2015 06:23:37 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zlwjr-0002x2-5t for emacs-orgmode@gnu.org; Tue, 13 Oct 2015 12:23:23 +0200 Received: from pool-108-20-41-232.bstnma.fios.verizon.net ([108.20.41.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 13 Oct 2015 12:23:23 +0200 Received: from ndokos by pool-108-20-41-232.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 13 Oct 2015 12:23:23 +0200 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 John Kitchin andrew.cmu.edu> writes: > > Does anyone know if it is possible to get line numbering only in code > blocks in an org-file? > When exporting? Or in the buffer? If the latter, I don't know. If the former, -n does that but it is position-sensitive I think: --8<---------------cut here---------------start------------->8--- * A code block for exporting with line number #+BEGIN_SRC python -n :exports code import sys sys.exit(0) #+END_SRC #+BEGIN_EXAMPLE -n import sys sys.exit(0) #+END_EXAMPLE --8<---------------cut here---------------end--------------->8--- works, but putting it at the end of the BEGIN_SRC line does not. See (info "(org) Literal examples") for more. -- Nick