[ESS] history button in ESS

Paul Johnson pauljohn32 at gmail.com
Wed Jan 4 17:05:25 CET 2006


If I type Control-Up at the > prompt, the history of commands is
shown.  Same as M-p, and more fun.

I thought this thread would touch on the more difficult question that
arises sometimes.  If send commands to the R session through ESS,
those commands do not appear in the history when you type Control-Up. 
I think that's really bad. Bad.  Because it is very easy to lose track
of what exactly has been done in an R session.

pj

On 1/4/06, Stephen Eglen <S.J.Eglen at damtp.cam.ac.uk> wrote:
> Barry Rowlingson writes:
>  > Stephen Eglen wrote:
>  >
>  > > Try M-p (the meta key and p at the same time, or press Escape and then
>  > > p). M-p / M-n will move you through the history, and will do the same
>  > > thing e.g. in M-x shell
>  >
>  >
>  > If you want the arrow keys to recall commands, then add this bit of lisp
>  > to either your .emacs or site-start.el files:
>  >
>  > (eval-after-load
>  >   "comint"
>  >   '(progn
>  >      (define-key comint-mode-map [up]
>  > 'comint-previous-matching-input-from-input
>  > )
>  >      (define-key comint-mode-map [down]
>  > 'comint-next-matching-input-from-input)
>  >      (define-key comint-mode-map [?\C-a]  'comint-bol)
>  >      (define-key comint-mode-map [?\C-c ?\C-a] 'beginning-of-line)))
>  >
>  >   - actually I'm not sure what the last two bits do exactly, but the
>  > first two 'define-key' things do the command recall thing.
>  >
>  > Barry
>
> Thanks barry.  The last two lines:
>
>  >      (define-key comint-mode-map [?\C-a]  'comint-bol)
>  >      (define-key comint-mode-map [?\C-c ?\C-a] 'beginning-of-line)))
>
> should define the following:
>
> C-a to go the beginning of the line (but after any prompt), so cursor
> will be at the asterisk
>
> R> *  some text on the current line
>
> whereas C-c C-a will then go to the "real" start of line, i.e. before
> the prompt:
>
> *R> some text on the current line
>
> S
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>


--
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas




More information about the ESS-help mailing list