blinky
blinky

Reputation: 3

How to move cursor diagonally in Emacs?

I am trying to write functions that move cursor diagonally, for example:

(defun leftUp ()
    (backward-char)
    (previous-line))

but it works only once. On next calls cursor just moves straight up. Any advice?

Upvotes: 0

Views: 65

Answers (1)

Lindydancer
Lindydancer

Reputation: 26164

previous-line always tries to place the cursor on the same column as the cursor movement originally started in. See the variable goal-column for more information.

Upvotes: 1

Related Questions