From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Berry Subject: Re: line numbers in a code block? Date: Sat, 27 Sep 2014 15:57:51 +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]:60402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXuNy-0000ge-Hj for emacs-orgmode@gnu.org; Sat, 27 Sep 2014 11:58:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXuNs-0005Tt-GI for emacs-orgmode@gnu.org; Sat, 27 Sep 2014 11:58:14 -0400 Received: from plane.gmane.org ([80.91.229.3]:49831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXuNs-0005Si-9W for emacs-orgmode@gnu.org; Sat, 27 Sep 2014 11:58:08 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XXuNm-0005sm-1W for emacs-orgmode@gnu.org; Sat, 27 Sep 2014 17:58:02 +0200 Received: from 137.110.37.92 ([137.110.37.92]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Sep 2014 17:58:02 +0200 Received: from ccberry by 137.110.37.92 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Sep 2014 17:58:02 +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 a way to get dedicate line numbers in an org code > block? > > I know how to get buffer code lines, but when we run a code block and > there is an error, the error line number is relative to line 1 of the > code block. Currently, we type C-c ' to get a code buffer, and navigate > to the line. I would like to see code block numbers on the right hand > side of the buffer, and only inside the code block. Any ideas? You mean like (org-add-hook 'org-src-mode-hook 'linum-mode) only with line numbers on the right side? (linum puts them on the left) Or did you mean in the org-mode buffer itself? Maybe (just a guess) hack `linum-update-window' to reset `line' to 0 whenever `(forward-line))'gives you a line that matches `#+begin_src'. HTH, Chuck