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

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

Re: Need Emacs command


From: Dan Davison
Subject: Re: Need Emacs command
Date: Sat, 24 Apr 2010 13:48:47 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

gmspro <address@hidden> writes:

> What's the command to move the cursor

As far as I know you have to define your own commands for these. In
other words there are elisp functions which do these things or which can
be combined to do them, but they are not "commands" in the sense that
you cannot use M-x to call them and they are not bound to keys. You only
have to do a little bit of work to make commands for what you want:

> 1.in the middle column of a line?

See below, and the function point-at-eol

> 2.at the beginning line/middle line/end line of a page,(the document was 
> scrolled down before)not this M-< or M->

First see the command recenter-top-bottom (C-l) if you haven't
already. If I've understood right, your middle line command could be
something like this.

(defun my/goto-mid-window-line ()
  (interactive)
  (goto-char (/ (+ (window-start) (window-end)) 2))
  (beginning-of-line))

The others should be easy to make by altering it. Once you define
functions like these (they must use the (interactive) expression), you
can bind them to keys.

> 3.What's the command to get the cursor position?

The function is called point.

dan

>
>
>       




reply via email to

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