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

Rainer M Krug Rainer at krugs.de
Wed Jun 5 11:32:59 CEST 2013

Vitalie Spinu <spinuvit at gmail.com> writes:

>  >> Rainer M Krug <Rainer at krugs.de>
>  >> on Mon, 03 Jun 2013 13:53:00 +0200 wrote:
>  > Hi
>  > I am using org-mode for programming, therefore editing my .R files
>  > directly is futile, as the edits will be overwritten by the next
>  > tangle. Nevertheless, it happens to me from time to time, mainly when I
>  > am debugging and open the .R file from the ess-traceback buffer.
>  > Would it be possible, to have an option to open the .R file from the
>  > ess-tracebak buffer as read-only?
> And how to distinguish which files you want read only and which you
> don't. This doesn't look to me like a very useful features. 
> Would it be feasible to redirect source references to original org file?

That would be the best option. At the moment I am using the function
org-babel-tangle-jump-to-org (I bound it to C-c T)after the backtrace appears, but I
sometimes forget it. It would be great if this function could be called
upon opening the R file, which then would jump to the location of the
code in the org file. There are problems at the moment with putting the
cursor at the exact location, but I think Eric Schulte is looking into this.

> Something of that kind now works with org's C-c '. If you evaluated
> functions in org edit buffer. You will be redirected to original org
> file on errors or debug. It doesn't work with org's C-c C-c as yet, but
> I am looking into it.
>  > Or is there another way of achieving this?
> There is visit-file-hook. You can add to it a simple function that
> checks for a file name and marks buffer read only.

I can't find this hook - is it an emacs or ess specific hook?


>     Vitalie
> ______________________________________________
> ESS-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

Rainer M. Krug

email: RMKrug<at>gmail<dot>com

More information about the ESS-help mailing list