help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set mark and point around current line


From: Kevin Rodgers
Subject: Re: set mark and point around current line
Date: Mon, 25 Jul 2005 11:46:53 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Baloff wrote:
> how can I find out what is the command to do somthing.

M-x apropos RET do-something RET

> say I want to select "highlight" the current line to copy it to
> another window.

I tried `M-x apropos RET current-line' and didn't find anything that
does the job.

> do I (Set the mark and point around the current line) > M-w > change
> window > C-y?

Yes.  Of course setting the mark and moving point changes the point,
which you may not want, and involves a 3-key sequence: C-a C-@ C-e.
So you might want to define a keyboard macro, e.g.

(global-set-key "\C-cl" "\C-a\C-@\C-e\M-w")

or bind a key to a new command:

(defun copy-current-line-as-kill ()
  "Save the current line as if killed, but don't kill it.
See `copy-region-as-kill'."
  (interactive)
  (kill-ring-save (point-at-bol) (point-at-eol)))

(global-set-key "\C-cl" 'copy-current-line-as-kill)

> and btw, when you have many windows open, aren't they numbered so that
> you can issue a command to go to a spacific window instead of what I am
> doing C-x o and watch the pointer move randomly till it gets to the
> window of my choice.

You can give a prefix arg to other-window (which is what `C-x o' is
bound to), e.g. `C-u 3 C-x o' or `M-3 C-x o'.

--
Kevin Rodgers





reply via email to

[Prev in Thread] Current Thread [Next in Thread]