[Top][All Lists]

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

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

From: cmr . Pent
Subject: Re: Delete (kill) entire line at cursor - how?
Date: 6 Mar 2007 08:58:15 -0800
User-agent: G2/1.0

> 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.

And I use stable version (21.4 that is), so the `kill-whole-line'
command is unavailable to me.
Maybe it does exactly what Matt suggested ;-)

reply via email to

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