[ESS] How to move to start of previous command, but not start of line?

William Denton wtd @end|ng |rom pobox@com
Sat Aug 28 02:48:52 CEST 2021


Let's say I enter the following keystrokes:

1 + 1 RET M-p C-a

This adds 1+1, gets the result, then runs comint-previous-input and reenters the 
previous command.  C-a moves to the start of the line ... but puts the point 
before the prompt, where the | is below.

# ———
> 1+1
[1] 2
|> 1 + 1
# ———

Is there a way to go to the start of the command, not the line?  I'm often in a 
situation where I get something working and then want to assign it to a 
variable, and it would be nice to run M-p C-a and be able to type "foo <-" with 
everything in place.  (Thereby saving me all the trouble of hitting the right 
arrow twice, which I know is trivial, but this is Emacs so I bet someeone has 
got this working, unless I missed it in the docs.)


Thanks,

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada


More information about the ESS-help mailing list