Re: How to move to start of previous command, but not start of line?

Dirk Eddelbuettel via ESS-help <[email protected]>
Newsgroups gmane.emacs.ess.general
Message-ID <[email protected]>
On 27 August 2021 at 20:48, William Denton via ESS-help wrote:
| 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.)

When I do
   foo <- 1 + 1 RET M-p C-a
my cursor is on f.

And always has been. Vanilla Emacs, currently 27.1, though I started using it
just before the 20s if memory serves, vanilla ESS most of those years, and no
fanyc prompt inside R. Just a a standar '> ' as

  > getOption("prompt")
  [1] "> "
  > 

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | [email protected]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.