Vitalie,

You need to think about what happens when you run multiple R's with
different working directories.  I do that frequently.

Kasper

On Wed, Aug 22, 2012 at 10:26 AM, Vitalie Spinu <spinuvit@gmail.com> wrote:

>   >> "Carslaw, David" <david.carslaw@kcl.ac.uk>
>   >> on Wed, 22 Aug 2012 14:46:01 +0100 wrote:
>
>   > Hello all
>   > I wondered if anyone knows how to show the working directory path in
> the emacs
>   > mode-line i.e. in the inferior ESS buffer?  I would find it a useful
> visual clue
>   > as I often find myself typing getwd().
>
> There are two different working directories. One, that of emacs, (C-h v
> default-directory), which is associated with every buffer, and R working
> directory.
>
> The two directories are synchronized in the beginning. So if you know
> the emacs dir, that is also the R's one. To see the directory associated
> with the emacs buffer just press [C-x C-f] or do [M-x pwd].  This, being so
> easy, there is not point in putting it in the modeline. But if you still
> want, Rodney's answer gives the hint.
>
> To place the R's directory in the mode-line would be much more
> difficult, and effectively would mean querying process every time emacs
> re-displays it's modeline (very often). This is possible, but is a bad
> idea. Another approach, is to query the process in the background during
> an idle time and cache the wd value.
>
> ---
>
> What ESS can potentially do, is to reset on idle time the emacs's wd to
> that of R. I guess, this would be useful in general, and is pretty easy,
> as ESS has to synchronize some other stuff as well. So if there are no
> objections, I will implement that.
>
> Vitalie.
>
>   > Any help or suggestions would be appreciated!
>
>   > Thanks
>
>   > David Carslaw
>
>   > Science Policy Group
>   > Environmental Research Group
>   > MRC-HPA Centre for Environment and Health
>   > King's College London
>   > Room 4.129 Franklin Wilkins Building
>   > Stamford Street
>   > London SE1 9NH
>   > david.carslaw@kcl.ac.uk<mailto:david.carslaw@kcl.ac.uk>
>
>   >     [[alternative HTML version deleted]]
>
>   > ______________________________________________
>   > ESS-help@r-project.org mailing list
>   > https://stat.ethz.ch/mailman/listinfo/ess-help
>
> ______________________________________________
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

	[[alternative HTML version deleted]]

