From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Adding source location information when tangling Date: Sat, 07 Jun 2014 11:28:40 -0400 Message-ID: <878up8d9cj.fsf@gmail.com> References: <87zji5bz6s.fsf@azha.ziiuu.com> <87r43d7ey0.fsf@azha.ziiuu.com> <87d2emezan.fsf@gmail.com> <87wqcts5yn.fsf@azha.ziiuu.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtIbe-0000qn-F2 for emacs-orgmode@gnu.org; Sat, 07 Jun 2014 11:32:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WtIbY-0007yx-0O for emacs-orgmode@gnu.org; Sat, 07 Jun 2014 11:32:30 -0400 Received: from mail-qg0-x234.google.com ([2607:f8b0:400d:c04::234]:57944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtIbX-0007ye-Sx for emacs-orgmode@gnu.org; Sat, 07 Jun 2014 11:32:23 -0400 Received: by mail-qg0-f52.google.com with SMTP id a108so7000891qge.11 for ; Sat, 07 Jun 2014 08:32:23 -0700 (PDT) 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: Thomas Morgan Cc: "emacs-orgmode@gnu.org" , Rainer M Krug >> Hi Thomas, >> >> I believe the `org-babel-tangle-comment-format-beg' and >> `org-babel-tangle-comment-format-end' variable should provide the >> functionality you desire. > > Hi, Eric, > > Thank you, though I'm afraid I'm still having trouble getting > the right result. The closest I've come is with this setting: > > (setq org-babel-tangle-comment-format-beg > "\\sourcefilename \"%file\"\n\\sourcefileline %start-line") > > But this adds comment characters before the commands. > > It also adds a blank line after the comment, throwing line numbers > off by one. (Actually they are off by two; maybe LilyPond needs > \sourcefileline to be on the same line as the beginning of the code.) > Yes, these will be inserted as comments, not directly into the file. I've just added a new customization variable which will allow you turn off the automated commenting and trailing newline insertion. Set `org-babel-tangle-uncomment-comments' to a non-nil value. Best, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D (see https://u.fsf.org/yw)