From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: anoop aryal Newsgroups: gmane.emacs.help Subject: Re: Delete (kill) entire line at cursor - how? Date: Mon, 26 Mar 2007 10:07:05 -0500 Organization: Foresight International Message-ID: <200703261007.05960.aaryal@foresightint.com> References: <1173165762.936371.202290@q40g2000cwq.googlegroups.com> <87y7loy90q.fsf@localhorst.mine.nu> <46034572.9040806@gatech.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1174921674 15896 80.91.229.12 (26 Mar 2007 15:07:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Mar 2007 15:07:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 26 17:07:38 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 1HVqn8-00061P-FQ for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Mar 2007 17:07:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HVqpN-0007de-Tf for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Mar 2007 10:09:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HVqp8-0007bB-83 for help-gnu-emacs@gnu.org; Mon, 26 Mar 2007 11:09:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HVqp7-0007Yz-8y for help-gnu-emacs@gnu.org; Mon, 26 Mar 2007 11:09:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HVqp7-0007Yn-6W for help-gnu-emacs@gnu.org; Mon, 26 Mar 2007 10:09:29 -0500 Original-Received: from mail.foresightint.com ([65.42.205.140]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HVqmr-0001E5-0m for help-gnu-emacs@gnu.org; Mon, 26 Mar 2007 11:07:09 -0400 Original-Received: from thewolf.foresightint.com (thewolf.foresightint.com [192.168.15.126]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.foresightint.com (Postfix) with ESMTP id 1A368978092 for ; Mon, 26 Mar 2007 10:07:04 -0500 (CDT) User-Agent: KMail/1.9.5 In-Reply-To: <46034572.9040806@gatech.edu> Content-Disposition: inline X-detected-kernel: Linux 2.4-2.6 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:42205 Archived-At: On Thursday 22 March 2007 22:11, Matthew Flaschen wrote: > David Hansen wrote: > > On Thu, 22 Mar 2007 21:29:42 -0400 Matthew Flaschen wrote: > >> anoop aryal wrote: > >>> i use C-M-k to delete sexps, C-c-C-o to delete multiple consequitive > >>> blank lines etc. and therefore find that kill-entire-line is something > >>> i'll use only when none of the other constructs are available. not to > >>> say that i don't use C-k, it's just that given a bunch of other higher > >>> level constructs and functions to operate on those constructs, C-k has > >>> limited use. > >> > >> Is there such a construct for deleting the current statement in > >> C/C++/Java? If not, I could see using kill-entire-line often for that. > > > > There are `c-beginning-of-statement' and `c-end-of-statement'. The > > rest is left as an exercise to the reader. > > So in other words "no, but you can make it". I knew that; that's the > answer to every question about emacs. :) i'm sure it could be done better but here's something you can put in your .emacs file: (defun c-kill-statement () "a handy way to kill a statement even when it spans multiple lines." (interactive) (save-excursion (c-beginning-of-statement-1) (let ((start (point))) (c-end-of-statement) (let ((end (point))) (kill-region start end))))) you can then type M-x c-kill-statement to try it out to make sure that's what you really want. if it is what you want, assign a key binding to it and you're off to the races. > > Matt Flaschen > > > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs -- anoop aryal aaryal@foresightint.com