Take the 2-minute tour ×

Standard C-k is kill-line function-> delete line and put it into kill-ring, I want use only something like 'delete-line'. Have any ideas?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You can define a delete-line function like this:

(defun delete-line ()

The function above mimics the behaviour of the function kill-line called without argument on a line with remaining non-blanks characters after point. You'll have to elaborate a bit if you want the exact behaviour of kill-line.

share|improve this answer
Thanks! It works! –  Rustem Apr 12 '12 at 7:30
Rustem: You should accept the answer, then. See the FAQ on asking questions: stackoverflow.com/faq#howtoask –  phils Apr 12 '12 at 9:33
add comment

This might be what you want. Place this line into your .emacs.

(global-set-key "\C-k" 'delete-line)

You can also try it out in your current session with M-: and then type it in and see if that's what you really want.

share|improve this answer
I'm running and I don't have delete-line. –  Ben Apr 12 '12 at 2:28
Sure, but there are no same function. Symbol's function definition is void: delete-line –  Rustem Apr 12 '12 at 5:13
add comment

Your Answer


