[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to select line?
From: |
Xah Lee |
Subject: |
Re: how to select line? |
Date: |
Wed, 08 Dec 2010 15:28:00 -0000 |
User-agent: |
G2/1.0 |
On Sep 9, 12:11 pm, "a.efremov" <a.efre...@javasmith.org> wrote:
> Hello,
>
> How I can select line in emacs. Not to select a region with C-space
> but just one line. Something similar to C-k to delete line.
>
emacs: select current line with single command
Previously, we've covered Single Command to Delete Whole Line and How
to Copy/Cut Current Line. But what if you want to select the current
line with a single command? Very short, like this:
(transient-mark-mode 1)
(defun select-current-line ()
"Select the current line"
(interactive)
(end-of-line) ; move to end of line
(set-mark (line-beginning-position)))
This is added to Emacs Lisp Examples, check it out for other useful
exmaples.
http://xahlee.blogspot.com/2010/09/emacs-select-current-line-with-single.html
Xah