[ESS] Open .R files from backtrace as read-only?

Vitalie Spinu spinuvit at gmail.com
Wed Jun 5 13:10:16 CEST 2013

 >> Rainer M Krug <Rainer at krugs.de>
 >> on Wed, 5 Jun 2013 12:53:42 +0200 wrote:

 > Vitalie Spinu <spinuvit at gmail.com> writes:
 >> >> Rainer M Krug <Rainer at krugs.de>
 >> >> on Wed, 5 Jun 2013 11:52:14 +0200 wrote:
 >> [...]
 >> > But then it would be executed each time. Would work, but definitely
 >> > not elegant.
 >> What do you mean? Don't you always want this behavior when a reference
 >> points to a tangled file?

 > Yes - but isn't this hook called each time a file is visited? So even
 > when I open e.g. an .org file? The function would handle this, but it
 > would still be called.

Yes it is, but you should action only on tangled files which you detect
by regexp on a file name, or some other way. But I don't know what I am
talking about right now as I cannot actually run org-babel-tangle with
org dev.

 > Thinking about it - the cursor needs to be at the location of the error
 > before and then org-babel-tangle-jump-to-org should be called - I assume
 > (sorry - haven't tried it out yet) that find-file-hook is called when
 > the file is visited / opened and the positioning of the cursor takes
 > place afterwards. So this shouldn't work.

It will also not work if the file is already visited. So the best you
can do right now is to set it read only. 


More information about the ESS-help mailing list