[ESS] show wd in mode-line?

Vitalie Spinu spinuvit at gmail.com
Wed Aug 22 16:26:38 CEST 2012

  >> "Carslaw, David" <david.carslaw at 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

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.


  > 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 at kcl.ac.uk<mailto:david.carslaw at kcl.ac.uk>

  > 	[[alternative HTML version deleted]]

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

More information about the ESS-help mailing list