help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Delete (kill) entire line at cursor - how?


From: Matthew Flaschen
Subject: Re: Delete (kill) entire line at cursor - how?
Date: Tue, 06 Mar 2007 18:05:43 -0500
User-agent: Thunderbird 1.5.0.9 (X11/20070104)

cmr.Pent@gmail.com wrote:
>> I just made the below hack. Add it to your ~/.emacs file.  Then, restart
>> emacs and, C-x y will do what you ask (I think).  There's probably a
>> better way to do it:
>>
>> Matt Flaschen
>>
>> (defun kill-entire-line ()
>> "Kills the whole line, including terminating newline, and moves the
>> cursor directly down"
>> (interactive)
>> (next-line 1)
>> (save-excursion
>>   (previous-line 1)
>>   (beginning-of-line)
>>   (kill-line 1)))
>>
>> (global-set-key [?\C-x ?y] 'kill-entire-line)
> 
> Just checked it, works like a champ! Thanks.

Sure. :)

> And I use stable version (21.4 that is), so the `kill-whole-line'
> command is unavailable to me.

Same.  I chose the name kill-entire-line because I did notice a
kill-whole-line variable (which still doesn't allow the kill-entire-line
behavior); it's good because there aren't conflicts on upgrade.

> Maybe it does exactly what Matt suggested ;-)

Quite possibly.  That seems to happen a fair amount...

Matt Flaschen




reply via email to

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