emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [BABEL] BUG - error on tangling - disappears when changing the f


From: Rainer M Krug
Subject: Re: [O] [BABEL] BUG - error on tangling - disappears when changing the filename
Date: Mon, 30 Sep 2013 09:30:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)

Eric Schulte <address@hidden> writes:

> Rainer M Krug <address@hidden> 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 <address@hidden> writes:
>>
>>> Forgot: tried with 8.2 stable release and with version from git - both
>>> the same.
>>>
>>> Rainer M Krug <address@hidden> writes:
>>>
>>>> Hi
>>>>
>>>> I have a strange error when tangling.
[snip:  Now irrlevant stuff (156 lines)]

-- 
Rainer M. Krug

email: RMKrug<at>gmail<dot>com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]