unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Matthew Flaschen <matthew.flaschen@gatech.edu>
To: cmr.Pent@gmail.com, emacs <help-gnu-emacs@gnu.org>
Subject: Re: Delete (kill) entire line at cursor - how?
Date: Tue, 06 Mar 2007 03:34:15 -0500	[thread overview]
Message-ID: <45ED2787.7030700@gatech.edu> (raw)
In-Reply-To: <1173165762.936371.202290@q40g2000cwq.googlegroups.com>


[-- Attachment #1.1: Type: text/plain, Size: 1322 bytes --]

cmr.Pent@gmail.com wrote:
> I've been a Windows user for years, but recently I began to feel that
> my usual work (mostly R scripts and scientific articles) could be done
> much more efficiently in text-oriented environment, which Linux is. So
> I've installed Linux and tried some editors like Kate, but they didn't
> suit my needs 100% (for example, I don't know how to switch between
> text file and console using keyboard, keeping console open; plus Kate
> loads like ages). Now I'm studying Emacs.
> 
> Well, Emacs has this kewl psychotherapist and Conway's life built in,

Thanks.  I didn't know it had life. :)

> I believe the Emacs is powerful enough to emulate such a feature, so
> please, Emacs gurus, point me out how to create a _simple_ shortcut
> (like C-y) which would kill line at cursor not moving the cursor
> itself.

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)


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

  reply	other threads:[~2007-03-06  8:34 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=45ED2787.7030700@gatech.edu \
    --to=matthew.flaschen@gatech.edu \
    --cc=cmr.Pent@gmail.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).