From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: cmr.Pent@gmail.com Newsgroups: gmane.emacs.help Subject: Re: Delete (kill) entire line at cursor - how? Date: 6 Mar 2007 08:58:15 -0800 Organization: http://groups.google.com Message-ID: <1173200295.212027.291640@v33g2000cwv.googlegroups.com> References: <1173165762.936371.202290@q40g2000cwq.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1173202926 28021 80.91.229.12 (6 Mar 2007 17:42:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Mar 2007 17:42:06 +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 18:41:55 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 1HOdfd-00020U-8I for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Mar 2007 18:41:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOdfX-0005Ci-0T for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Mar 2007 12:41:47 -0500 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!v33g2000cwv.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: 195.98.167.2 Original-X-Trace: posting.google.com 1173200302 30291 127.0.0.1 (6 Mar 2007 16:58:22 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 6 Mar 2007 16:58:22 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.10 (X11; Linux i686; U; en),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: v33g2000cwv.googlegroups.com; posting-host=195.98.167.2; posting-account=OUbbXw0AAADs1NYyXuDd-yGYsBpwSzOe Original-Xref: shelby.stanford.edu gnu.emacs.help:146116 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:41720 Archived-At: > 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 ;-)