all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: anoop aryal <aaryal@foresightint.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Delete (kill) entire line at cursor - how?
Date: Mon, 26 Mar 2007 10:07:05 -0500	[thread overview]
Message-ID: <200703261007.05960.aaryal@foresightint.com> (raw)
In-Reply-To: <46034572.9040806@gatech.edu>

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

  reply	other threads:[~2007-03-26 15:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-06  7:22 Delete (kill) entire line at cursor - how? cmr.Pent
2007-03-06  8:34 ` Matthew Flaschen
2007-03-06  9:30 ` thorne
2007-03-06  9:28   ` cmr.Pent
2007-03-06 13:01   ` Johan Bockgård
2007-03-06 20:45     ` thorne
     [not found] ` <mailman.505.1173170070.7795.help-gnu-emacs@gnu.org>
2007-03-06 16:58   ` cmr.Pent
2007-03-06 21:00     ` Giorgos Keramidas
2007-03-06 23:05     ` Matthew Flaschen
2007-03-07  6:35     ` Dave Benjamin
2007-03-07  7:29       ` Matthew Flaschen
     [not found]       ` <mailman.573.1173252572.7795.help-gnu-emacs@gnu.org>
2007-03-07 10:13         ` cmr.Pent
2007-03-07 11:28           ` Matthew Flaschen
2007-03-14 16:38           ` anoop aryal
2007-03-23  1:29             ` Matthew Flaschen
2007-03-23  2:43               ` David Hansen
2007-03-23  3:11                 ` Matthew Flaschen
2007-03-26 15:07                   ` anoop aryal [this message]
2007-03-27  3:09                     ` Matthew Flaschen
     [not found]                     ` <mailman.1478.1174965095.7795.help-gnu-emacs@gnu.org>
2007-03-27  9:54                       ` Giorgos Keramidas
2007-03-27 10:46                         ` Matthew Flaschen
     [not found]               ` <mailman.1286.1174618530.7795.help-gnu-emacs@gnu.org>
2007-03-26 21:55                 ` Mathias Dahl
2007-03-26 22:48                   ` anoop aryal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200703261007.05960.aaryal@foresightint.com \
    --to=aaryal@foresightint.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.