[ESS] history button in ESS

Kasper Daniel Hansen khansen at stat.Berkeley.EDU
Thu Jan 5 01:02:24 CET 2006

On Jan 4, 2006, at 5:05 PM, Paul Johnson wrote:

> 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.

I thin it is good. Really good.

The idea is that if you submit say an entire function, you do not  
want to use M-p to recall all the individual lines of the function.

You can always keep track of your Emacs session: just look in the  
command window. If you want it to be easier to see what happens, use  
the clean transcript commands which strips the buffer of everything  
but the commands.


> 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
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

More information about the ESS-help mailing list