* Why does Emacs lack `backward-delete-word`?
@ 2016-03-06 11:20 egarrulo
2016-03-06 11:27 ` Lars Magne Ingebrigtsen
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: egarrulo @ 2016-03-06 11:20 UTC (permalink / raw)
To: help-gnu-emacs
I know how to define `backward-delete-word`, but if such a basic command
were deemed useful by power users, it would ship with Emacs by now.
Do Emacs power users prefer to fix a typo by deleting one char at a
time? Or is it because they don't mind polluting the kill ring with
typos? Anything else?
Thanks.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-06 11:20 Why does Emacs lack `backward-delete-word`? egarrulo
@ 2016-03-06 11:27 ` Lars Magne Ingebrigtsen
2016-03-06 11:37 ` egarrulo
2016-03-06 14:31 ` egarrulo
2016-03-07 4:12 ` Yeechang Lee
2 siblings, 1 reply; 17+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-03-06 11:27 UTC (permalink / raw)
To: help-gnu-emacs
egarrulo <egarrulo@gmail.com> writes:
> I know how to define `backward-delete-word`, but if such a basic
> command were deemed useful by power users, it would ship with Emacs by
> now.
M-DEL (translated from <M-backspace>) runs the command
backward-kill-word (found in global-map), which is an interactive
compiled Lisp function in ‘simple.el’.
It is bound to <C-backspace>, M-DEL.
(backward-kill-word ARG)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-06 11:27 ` Lars Magne Ingebrigtsen
@ 2016-03-06 11:37 ` egarrulo
2016-03-06 12:30 ` tomas
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: egarrulo @ 2016-03-06 11:37 UTC (permalink / raw)
To: help-gnu-emacs
On 06/03/16 12:27, Lars Magne Ingebrigtsen wrote:
> egarrulo <egarrulo@gmail.com> writes:
>
>> I know how to define `backward-delete-word`, but if such a basic
>> command were deemed useful by power users, it would ship with Emacs by
>> now.
>
> M-DEL (translated from <M-backspace>) runs the command
> backward-kill-word (found in global-map), which is an interactive
> compiled Lisp function in ‘simple.el’.
>
> It is bound to <C-backspace>, M-DEL.
>
> (backward-kill-word ARG)
>
I should have been clearer, sorry. `backward-kill-word` kills. I
wonder why there is no corresponding command to delete instead.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-06 11:37 ` egarrulo
@ 2016-03-06 12:30 ` tomas
2016-03-06 13:12 ` Edward Knyshov
2016-03-06 15:44 ` Stefan Monnier
[not found] ` <mailman.6881.1457279069.843.help-gnu-emacs@gnu.org>
2 siblings, 1 reply; 17+ messages in thread
From: tomas @ 2016-03-06 12:30 UTC (permalink / raw)
To: help-gnu-emacs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sun, Mar 06, 2016 at 12:37:24PM +0100, egarrulo wrote:
> On 06/03/16 12:27, Lars Magne Ingebrigtsen wrote:
> >egarrulo <egarrulo@gmail.com> writes:
> >
> >>I know how to define `backward-delete-word`, but if such a basic
> >>command were deemed useful by power users, it would ship with Emacs by
> >>now.
> >
> >M-DEL (translated from <M-backspace>) runs the command
> >backward-kill-word (found in global-map), which is an interactive
> >compiled Lisp function in ‘simple.el’.
> >
> >It is bound to <C-backspace>, M-DEL.
> >
> >(backward-kill-word ARG)
> >
>
> I should have been clearer, sorry. `backward-kill-word` kills. I
> wonder why there is no corresponding command to delete instead.
Is there any `forward-delete-word'?
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlbcIsoACgkQBcgs9XrR2kaTfwCeNApBJJTZhBfJjkjpkhBAYQ1f
V3cAniF+AwYjAFjCgcWxpQKeP2p7KzqF
=m5bF
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-06 12:30 ` tomas
@ 2016-03-06 13:12 ` Edward Knyshov
2016-03-06 13:16 ` Marcin Borkowski
0 siblings, 1 reply; 17+ messages in thread
From: Edward Knyshov @ 2016-03-06 13:12 UTC (permalink / raw)
To: tomas, help-gnu-emacs
M-d
On Sun, Mar 6, 2016 at 8:05 PM <tomas@tuxteam.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sun, Mar 06, 2016 at 12:37:24PM +0100, egarrulo wrote:
> > On 06/03/16 12:27, Lars Magne Ingebrigtsen wrote:
> > >egarrulo <egarrulo@gmail.com> writes:
> > >
> > >>I know how to define `backward-delete-word`, but if such a basic
> > >>command were deemed useful by power users, it would ship with Emacs by
> > >>now.
> > >
> > >M-DEL (translated from <M-backspace>) runs the command
> > >backward-kill-word (found in global-map), which is an interactive
> > >compiled Lisp function in ‘simple.el’.
> > >
> > >It is bound to <C-backspace>, M-DEL.
> > >
> > >(backward-kill-word ARG)
> > >
> >
> > I should have been clearer, sorry. `backward-kill-word` kills. I
> > wonder why there is no corresponding command to delete instead.
>
> Is there any `forward-delete-word'?
>
> - -- t
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAlbcIsoACgkQBcgs9XrR2kaTfwCeNApBJJTZhBfJjkjpkhBAYQ1f
> V3cAniF+AwYjAFjCgcWxpQKeP2p7KzqF
> =m5bF
> -----END PGP SIGNATURE-----
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-06 13:12 ` Edward Knyshov
@ 2016-03-06 13:16 ` Marcin Borkowski
0 siblings, 0 replies; 17+ messages in thread
From: Marcin Borkowski @ 2016-03-06 13:16 UTC (permalink / raw)
To: Edward Knyshov; +Cc: help-gnu-emacs
On 2016-03-06, at 14:12, Edward Knyshov <edvorg@gmail.com> wrote:
> M-d
No, it kills, too.
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-06 11:20 Why does Emacs lack `backward-delete-word`? egarrulo
2016-03-06 11:27 ` Lars Magne Ingebrigtsen
@ 2016-03-06 14:31 ` egarrulo
2016-03-06 16:37 ` Drew Adams
2016-03-07 4:12 ` Yeechang Lee
2 siblings, 1 reply; 17+ messages in thread
From: egarrulo @ 2016-03-06 14:31 UTC (permalink / raw)
To: help-gnu-emacs
I have also noticed that `delete-region` is not on any key. This could
mean that -- before Transient Mark Mode became default --
`delete-region` was intentionally kept out of easy reach. If this is
the case, was it because the earliest Emacs versions lacked undo?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-06 11:37 ` egarrulo
2016-03-06 12:30 ` tomas
@ 2016-03-06 15:44 ` Stefan Monnier
2016-03-07 3:21 ` Robert Thorpe
[not found] ` <mailman.6881.1457279069.843.help-gnu-emacs@gnu.org>
2 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2016-03-06 15:44 UTC (permalink / raw)
To: help-gnu-emacs
> I should have been clearer, sorry. `backward-kill-word` kills. I wonder
> why there is no corresponding command to delete instead.
Emacs's UI generally assumes that the difference between "delete" and
"kill" is sufficiently minor that the trouble of providing both versions
is higher than the gain.
IOW, use M-y (or a prefix arg to C-y) to get to the kill you care about.
Stefan
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: Why does Emacs lack `backward-delete-word`?
2016-03-06 14:31 ` egarrulo
@ 2016-03-06 16:37 ` Drew Adams
0 siblings, 0 replies; 17+ messages in thread
From: Drew Adams @ 2016-03-06 16:37 UTC (permalink / raw)
To: egarrulo, help-gnu-emacs
> I have also noticed that `delete-region` is not on any key. This
> could mean that -- before Transient Mark Mode became default --
> `delete-region` was intentionally kept out of easy reach. If this
> is the case, was it because the earliest Emacs versions lacked undo?
I don't think it was "intentionally kept out of easy reach" but
rather, as Stefan suggested, because interactively most people
want to kill text most of the time, instead of just deleting it.
It is trivial to define your own command `backward-kill-word'
and bind it to `M-<backspace>' or whatever.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
[not found] ` <mailman.6881.1457279069.843.help-gnu-emacs@gnu.org>
@ 2016-03-06 19:12 ` Barry Margolin
0 siblings, 0 replies; 17+ messages in thread
From: Barry Margolin @ 2016-03-06 19:12 UTC (permalink / raw)
To: help-gnu-emacs
In article <mailman.6881.1457279069.843.help-gnu-emacs@gnu.org>,
Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> > I should have been clearer, sorry. `backward-kill-word` kills. I wonder
> > why there is no corresponding command to delete instead.
>
> Emacs's UI generally assumes that the difference between "delete" and
> "kill" is sufficiently minor that the trouble of providing both versions
> is higher than the gain.
If we had key bindings for all the "delete" operations, in addition to
all the kills that we already have, it would take up lots of keys that
are more useful for other things.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-06 15:44 ` Stefan Monnier
@ 2016-03-07 3:21 ` Robert Thorpe
2016-03-07 15:02 ` Eric Abrahamsen
0 siblings, 1 reply; 17+ messages in thread
From: Robert Thorpe @ 2016-03-07 3:21 UTC (permalink / raw)
To: help-gnu-emacs
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I should have been clearer, sorry. `backward-kill-word` kills. I wonder
>> why there is no corresponding command to delete instead.
>
> Emacs's UI generally assumes that the difference between "delete" and
> "kill" is sufficiently minor that the trouble of providing both versions
> is higher than the gain.
>
> IOW, use M-y (or a prefix arg to C-y) to get to the kill you care about.
As Stefan says, it's not usually necessary. M-y can skip past
irrelevant kills. Also, if you know you're going to add something
useless to the kill ring, then you can just use backspace. Getting rid
of a word with backspace, in the few occasions when it's necessary,
isn't that slow.
But, in keyboard macros it can be troublesome. If M-y has to be used in
a macro that generally spells trouble. Also, kills are slower than
deletes. For those reasons I define delete-word in the obvious way,
like kill-word but using delete-region instead of kill-region. I don't
bind it to a key though, I just use M-x when I need it, which is only
when using keyboard macros.
BR,
Robert Thorpe
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-06 11:20 Why does Emacs lack `backward-delete-word`? egarrulo
2016-03-06 11:27 ` Lars Magne Ingebrigtsen
2016-03-06 14:31 ` egarrulo
@ 2016-03-07 4:12 ` Yeechang Lee
2016-03-07 9:02 ` Marcin Borkowski
2 siblings, 1 reply; 17+ messages in thread
From: Yeechang Lee @ 2016-03-07 4:12 UTC (permalink / raw)
To: help-gnu-emacs
egarrulo wrote:
> I know how to define `backward-delete-word`, but if such a basic
> command were deemed useful by power users, it would ship with Emacs
> by now.
I sometimes wonder if Emacs users have so many commands they defined
long ago in ~/.emacs that they don't realize that they might be useful
for others in the stock code.
Example: I only realized/remembered the other day that my ~/.emacs has
(global-set-key (kbd "C-x p") 'previous-multiframe-window)
(global-set-key (kbd "C-x n") 'next-multiframe-window)
I almost certainly put it in almost immediately after starting with
Emacs more than two decades ago. Certainly, for the vast majority of
those two decades, I would have sworn that being able to move to the
next and previous window (as opposed to 'other-window, which is stock
on C-x o) is bound to keys by default.
--
geo:37.783333,-122.416667
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-07 4:12 ` Yeechang Lee
@ 2016-03-07 9:02 ` Marcin Borkowski
0 siblings, 0 replies; 17+ messages in thread
From: Marcin Borkowski @ 2016-03-07 9:02 UTC (permalink / raw)
To: Yeechang Lee; +Cc: help-gnu-emacs
On 2016-03-07, at 05:12, Yeechang Lee <ylee@columbia.edu> wrote:
> (global-set-key (kbd "C-x n") 'next-multiframe-window)
Of course, the above makes you miss the (extremely useful) narrowing
commands.
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
[not found] <mailman.6942.1457320905.843.help-gnu-emacs@gnu.org>
@ 2016-03-07 12:08 ` egarrulo
2016-03-07 15:37 ` Marcin Borkowski
0 siblings, 1 reply; 17+ messages in thread
From: egarrulo @ 2016-03-07 12:08 UTC (permalink / raw)
To: help-gnu-emacs
On 07/03/16 04:21, Robert Thorpe wrote:
> As Stefan says, it's not usually necessary. M-y can skip past
> irrelevant kills. Also, if you know you're going to add something
> useless to the kill ring, then you can just use backspace. Getting rid
> of a word with backspace, in the few occasions when it's necessary,
> isn't that slow.
>
> But, in keyboard macros it can be troublesome. If M-y has to be used in
> a macro that generally spells trouble. Also, kills are slower than
> deletes. For those reasons I define delete-word in the obvious way,
> like kill-word but using delete-region instead of kill-region. I don't
> bind it to a key though, I just use M-x when I need it, which is only
> when using keyboard macros.
Your indirect explanation for the lack of a key for `delete-region`
sounds plausible.
Maybe my question is a symptom of a more general problem: inexperienced
Emacs users, don't know how to edit effectively with vanilla Emacs,
especially when they come from mainstream editors. The manual explains
Emacs commands, but not how they "work" together. For example, I
remember a Emacs user commenting that it is often quicker to kill and
yank some text, than to copy it. Not very intuitive, I would say.
Therefore, some users might feel frustrated because they are trying to
accomplish something by unknowingly "going against the grain" of Emacs.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-07 3:21 ` Robert Thorpe
@ 2016-03-07 15:02 ` Eric Abrahamsen
2016-03-07 23:15 ` Robert Thorpe
0 siblings, 1 reply; 17+ messages in thread
From: Eric Abrahamsen @ 2016-03-07 15:02 UTC (permalink / raw)
To: help-gnu-emacs
Robert Thorpe <rt@robertthorpeconsulting.com> writes:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>> I should have been clearer, sorry. `backward-kill-word` kills. I wonder
>>> why there is no corresponding command to delete instead.
>>
>> Emacs's UI generally assumes that the difference between "delete" and
>> "kill" is sufficiently minor that the trouble of providing both versions
>> is higher than the gain.
>>
>> IOW, use M-y (or a prefix arg to C-y) to get to the kill you care about.
>
> As Stefan says, it's not usually necessary. M-y can skip past
> irrelevant kills. Also, if you know you're going to add something
> useless to the kill ring, then you can just use backspace. Getting rid
> of a word with backspace, in the few occasions when it's necessary,
> isn't that slow.
>
> But, in keyboard macros it can be troublesome. If M-y has to be used in
> a macro that generally spells trouble. Also, kills are slower than
> deletes. For those reasons I define delete-word in the obvious way,
> like kill-word but using delete-region instead of kill-region. I don't
> bind it to a key though, I just use M-x when I need it, which is only
> when using keyboard macros.
This is what registers are good for!
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-07 12:08 ` egarrulo
@ 2016-03-07 15:37 ` Marcin Borkowski
0 siblings, 0 replies; 17+ messages in thread
From: Marcin Borkowski @ 2016-03-07 15:37 UTC (permalink / raw)
To: egarrulo; +Cc: help-gnu-emacs
On 2016-03-07, at 13:08, egarrulo <egarrulo@gmail.com> wrote:
> On 07/03/16 04:21, Robert Thorpe wrote:
>> As Stefan says, it's not usually necessary. M-y can skip past
>> irrelevant kills. Also, if you know you're going to add something
>> useless to the kill ring, then you can just use backspace. Getting rid
>> of a word with backspace, in the few occasions when it's necessary,
>> isn't that slow.
>>
>> But, in keyboard macros it can be troublesome. If M-y has to be used in
>> a macro that generally spells trouble. Also, kills are slower than
>> deletes. For those reasons I define delete-word in the obvious way,
>> like kill-word but using delete-region instead of kill-region. I don't
>> bind it to a key though, I just use M-x when I need it, which is only
>> when using keyboard macros.
>
> Your indirect explanation for the lack of a key for `delete-region`
> sounds plausible.
>
> Maybe my question is a symptom of a more general problem: inexperienced
> Emacs users, don't know how to edit effectively with vanilla Emacs,
> especially when they come from mainstream editors. The manual explains
> Emacs commands, but not how they "work" together. For example, I
> remember a Emacs user commenting that it is often quicker to kill and
> yank some text, than to copy it. Not very intuitive, I would say.
> Therefore, some users might feel frustrated because they are trying to
> accomplish something by unknowingly "going against the grain" of Emacs.
0. Good points.
1. Mickey Petersen's blog and book.
2. M-w.
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Why does Emacs lack `backward-delete-word`?
2016-03-07 15:02 ` Eric Abrahamsen
@ 2016-03-07 23:15 ` Robert Thorpe
0 siblings, 0 replies; 17+ messages in thread
From: Robert Thorpe @ 2016-03-07 23:15 UTC (permalink / raw)
To: Eric Abrahamsen; +Cc: help-gnu-emacs
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>> But, in keyboard macros it can be troublesome. If M-y has to be used in
>> a macro that generally spells trouble. Also, kills are slower than
>> deletes. For those reasons I define delete-word in the obvious way,
>> like kill-word but using delete-region instead of kill-region. I don't
>> bind it to a key though, I just use M-x when I need it, which is only
>> when using keyboard macros.
>
> This is what registers are good for!
I should have thought of that.
BR,
Robert Thorpe
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2016-03-07 23:15 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-06 11:20 Why does Emacs lack `backward-delete-word`? egarrulo
2016-03-06 11:27 ` Lars Magne Ingebrigtsen
2016-03-06 11:37 ` egarrulo
2016-03-06 12:30 ` tomas
2016-03-06 13:12 ` Edward Knyshov
2016-03-06 13:16 ` Marcin Borkowski
2016-03-06 15:44 ` Stefan Monnier
2016-03-07 3:21 ` Robert Thorpe
2016-03-07 15:02 ` Eric Abrahamsen
2016-03-07 23:15 ` Robert Thorpe
[not found] ` <mailman.6881.1457279069.843.help-gnu-emacs@gnu.org>
2016-03-06 19:12 ` Barry Margolin
2016-03-06 14:31 ` egarrulo
2016-03-06 16:37 ` Drew Adams
2016-03-07 4:12 ` Yeechang Lee
2016-03-07 9:02 ` Marcin Borkowski
[not found] <mailman.6942.1457320905.843.help-gnu-emacs@gnu.org>
2016-03-07 12:08 ` egarrulo
2016-03-07 15:37 ` Marcin Borkowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).