emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: C-k must be repeated in shell to kill a line that ha


From: Miles Bader
Subject: Re: address@hidden: C-k must be repeated in shell to kill a line that has a prompt]
Date: 02 Nov 2001 16:26:30 +0900

Richard Stallman <address@hidden> writes:
> I see now that the input fields to not have this property.
> But I think they should.  Users are already complaining that C-a
> does not move to the real beginning of the line.

Which users are complaining?  I've seen one complaint (compared to the
presumably large number of people who use shell mode, and who either
like the current behavior, or who haven't noticed).

Historically, C-a in a shell-buffer ignored the prompt.  But I think
that is a mis-feature, not a feature; consider --

  (1) Most command-line systems with emacs-like keybindings have `C-a'
      stop after the prompt (the minibuffer, bash, etc).  [the old
      behavior of] comint is the odd man out.

  (2) Doing so breaks one of the most common idioms in emacs-like input
      systems, `C-a C-k' to delete a line.  When you want to delete a
      line in a shell buffer, do you usually want to delete the prompt
      too?  I didn't think so.

  (3) It's basically only useful to go to the beginning of the prompt in
      one situation: to copy part of a shell buffer to save it.
      However, if you think the _frequency_ of doing this, as opposed to
      simply wanting to erase your input, it seems pretty obvious that
      you should optimize for the common case, not the uncommon one.

My experience with the old behavior of `C-a' was that for normal usage
(inputting commands and executing), it was basically useless -- doing
C-a and then manually skipping the prompt usually takes a fair number of
keystrokes -- so I never used it.

I suspect this is the reason why some people who are used to the old
behavior see the new behavior as a misfeature -- they've trained
themselves to never use C-a except in the rare case of copying part of
their session, so they only notice the drawbacks of the current
behavior.

But I'll bet anyone who actually gives themselves time to adapt, as
well as new users, will like the new behavior better; it simply makes
more sense.

> The reason fields are used is so that comint can figure out
> what is a prompt, not to affect cursor motion.

Both are valuable.

-Miles
-- 
`...the Soviet Union was sliding in to an economic collapse so comprehensive
 that in the end its factories produced not goods but bads: finished products
 less valuable than the raw materials they were made from.'  [The Economist]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]