From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: Delete (kill) entire line at cursor - how? Date: Tue, 06 Mar 2007 23:00:03 +0200 Organization: SunSITE.dk - Supporting Open source Message-ID: <87vehe1418.fsf@kobe.laptop> References: <1173165762.936371.202290@q40g2000cwq.googlegroups.com> <1173200295.212027.291640@v33g2000cwv.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173217339 21979 80.91.229.12 (6 Mar 2007 21:42:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Mar 2007 21:42:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 06 22:42:12 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HOhQB-0007Na-Qm for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Mar 2007 22:42:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOhQC-000546-MB for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Mar 2007 16:42:12 -0500 Original-Path: shelby.stanford.edu!newshub.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!news.net.uni-c.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (berkeley-unix) Cancel-Lock: sha1:HoX5qmGSiorY92Mip9e/OlzUNO4= Original-Lines: 37 Original-NNTP-Posting-Host: 62.103.39.229 Original-X-Trace: news.sunsite.dk DXC=l_eiN>SN:LeOHBD=iT>F; gYSB=nbEKnkkML^Mjg2:ak; I7eU]gGb30c[>DY7k[X\aQn`W8bm Original-X-Complaints-To: staff@sunsite.dk Original-Xref: shelby.stanford.edu gnu.emacs.help:146129 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:41733 Archived-At: cmr.Pent@gmail.com writes: >> 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. It was introduced in Emacs 22, that's why :) > Maybe it does exactly what Matt suggested ;-) It does. You can also bind it to any key you want, instead of the default . So if you like hitting C-k to use it, instead of the default, you can bind it to this key in your ~/.emacs file with: (global-set-key (kbd "C-k") 'kill-whole-line) Have fun, Giorgos