From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [BABEL] BUG - error on tangling - disappears when changing the filename Date: Mon, 30 Sep 2013 09:30:40 +0200 Message-ID: References: <877ge1w22e.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQXwU-0003gA-OK for emacs-orgmode@gnu.org; Mon, 30 Sep 2013 03:31:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQXwO-0007NU-Bv for emacs-orgmode@gnu.org; Mon, 30 Sep 2013 03:30:54 -0400 Received: from plane.gmane.org ([80.91.229.3]:52516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQXwO-0007Mv-5K for emacs-orgmode@gnu.org; Mon, 30 Sep 2013 03:30:48 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VQXwM-0005DG-Hs for emacs-orgmode@gnu.org; Mon, 30 Sep 2013 09:30:46 +0200 Received: from arn78-1-88-186-171-7.fbx.proxad.net ([88.186.171.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Sep 2013 09:30:46 +0200 Received: from Rainer by arn78-1-88-186-171-7.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Sep 2013 09:30:46 +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 Eric Schulte writes: > Rainer M Krug writes: > >> OK - narrowed it down to a post tangle hook which I need for proper >> debugging of R (jumping to source line in org file and not tangled R file): >> >> ,---- >> | #+begin_src emacs-lisp >> | (defvar org-babel-tangled-file nil >> | "If non-nill, current file was tangled with org-babel-tangle") >> | (put 'org-babel-tangled-file 'safe-local-variable 'booleanp) >> | >> | (defun org-babel-mark-file-as-tangled () >> | (when (string-match "[.]R" (buffer-file-name)) >> | (add-file-local-variable 'org-babel-tangled-file t) >> | (add-file-local-variable 'buffer-read-only t) >> | (add-file-local-variable 'eval: '(auto-revert-mode)) >> | (basic-save-buffer))) >> | >> | (add-hook 'org-babel-post-tangle-hook 'org-babel-mark-file-as-tangled) >> | #+end_src >> `---- >> >> The question is now why is this function org-babel-mark-file-as-tangled >> receives NULL as a buffer-file-name? > > I'm not sure, but perhaps you could wrap the body of buffer-file-name in > a (when (buffer-file-name) ...) form to protect against null files. Sounds reasonable and I'll put it in to have properly tangled files when this happens - but then the file-local-variables would not be added if the file name is null. Is there any way that I could find out why this is happening (or under which conditions)? Thanks, Rainer > > Hope this helps, > >> >> I can't remove the "when" as I am also tangling some files which do >> not have any comment characters (DESCRIPTION file in R packages). >> >> Any suggestions welcome, >> >> Rainer >> >> >> Rainer M Krug writes: >> >>> Forgot: tried with 8.2 stable release and with version from git - both >>> the same. >>> >>> Rainer M Krug writes: >>> >>>> Hi >>>> >>>> I have a strange error when tangling. [snip: Now irrlevant stuff (156 lines)] -- Rainer M. Krug email: RMKruggmailcom