[ESS] Sent lines (through C-c C-n) are not written in the history

Vitalie Spinu spinuvit at gmail.com
Sat Nov 30 07:10:27 CET 2013


 >>> Sebastien Vauban on Fri, 29 Nov 2013 12:08:12 +0100 wrote:

 > Hello,
 > If I send lines from my R buffer to the iESS process with commands such as `C-c
 > C-c' or `C-c C-n', these are NOT copied to the history -- while I'd find that
 > very useful: I can update some commands and test them before editing the code.

Yes, intentional. It is not that convenient as it might look at first
glance. I played with that (if you search ess-help you will find the
relevant code) and most of the time the history becomes kludged with
useless stuff.

Even if you put one-liners as sent with C-RET (or C-c C-n) into the
history, most of the time it won't be what you need for two
reasons. First, multi-line commands will end up as separate lines in the
history which is completely useless. Second, you often send to process
more complex tasks composed of several separate commands (even if you
send them with C-RET). Such commands you want to execute all together
instead of separately, but they end up as separate entities in the
history.

----

I have two not yet ripe ideas. First is to make an option to put
selected evaluations into the history. So that only non-functions and
non-buffers end up into the history. This would directly address your
issue.

Second idea is to keep a separate history of previously executed
commands. Then have a special key to send one of the previous commands
to the process: ess-eval-from-history. This one should work both from
script and process buffers.

Here is the workflow. Press a key, a minibuffer would display most
recent previous command. You can either press RET to send it to the
process, or M-p or M-n to navigate through the previous history.

You often need this during the debugging, when you execute again and
again the same thing, and you don't want to navigate to the *R* buffer
or script buffer to re-execute it again and again.

Any ideas for a handy key? M-p might be good, because it parallels
comint-previous-matching-input-from-input in *R* buffers, but I think
most people bind it to something useful.


    Vitalie



More information about the ESS-help mailing list