Killing Sentences

Recently I’ve had several occasions where I wanted to kill to the beginning of the current sentence. No problem, I thought, I’ll just write a quick bit of Elisp like

(push-mark nil nil t)
(backward-sentence)
(kill-region)

and bind it to some convenient key. After a little investigation I discovered that Emacs already provided backward-kill-sentence and that it was bound to【Ctrl+x Delete】 so there was nothing to do—the functionality was already there.

That got me thinking about killing to the end of the current sentence. To do that I’ve just always used 【Meta+z .】 but it turns out that Emacs also has a kill-sentence to do the job. It’s bound to 【Meta+k】, which makes sense since you use 【Meta+a】 and 【Meta+e】 to move to the beginning and end of a sentence.

Emacs really is the journey that never ends. There’s always something else to learn.

This entry was posted in General and tagged . Bookmark the permalink.

2 Responses to Killing Sentences

  1. fidlx says:

    Good to learn about Meta-k!
    I like to think of the bindings Meta-a, Meta-e and Meta-k as “parallel” to C-a, C-e, C-k. The former act on sentences and the latter on lines.
    Something similar occurs with Meta-b, Meta-d, Meta-f and Meta-t and C-b, C-d, C-f and C-t. The former act on words and the latter on chars.
    There might be even more such “parallel” bindings :)

  2. mbork says:

    Now that’s funny. I’ve been using Emacs for some 10+ years, but still consider myself more of a beginner – only recently have I started to tinker with my own elisp functions etc. But I’ve been using M-k for years. And yes, I trained myself to put two spaces after a period at the end of the sentence. (And I’m also using also C-t, which swaps characters around the point, and M-t, which does an (almost) identical thing with words, and C-x t which does it to lines – very handy with short LaTeX itemizations;). And M-u, M-l and M-c, also with negative prefix arguments. But I’m not a programmer, and I use Emacs heavily to edit texts in natural languages, so I have probably a different bias.)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>