sabof
sabof

Reputation: 8192

Emacs mode for "free" cursor positioning

Is there a mode that would allow me to place the cursor anywhere on the screen (including after a line end), either by a mouse click or through keys?

Edit:

A minor mode based on picture-mode, which does exactactly what the question asked.

(define-minor-mode free-point-mode
    "Place the cursor anywhere on the screen, irrespective of linebreaks, by clicking or using the arrow keys"
  nil nil
  `((,(kbd "<mouse-1>") . picture-mouse-set-point)
    (,[remap right-char] . picture-forward-column)
    (,[remap left-char] . picture-backward-column)
    (,[remap previous-line] . picture-move-up)
    (,[remap next-line] . picture-move-down))
  (require 'picture))

(defadvice picture-mouse-set-point (after no-region activate)
  (deactivate-mark))

Upvotes: 5

Views: 1213

Answers (1)

Miserable Variable
Miserable Variable

Reputation: 28761

picture-mode lets you position cursor anywhere on the screen. Don't let the name fool you, it's not about images:

To edit a picture made out of text characters (for example, a picture of the division of a register into fields, as a comment in a program), use the command M-x picture-mode to enter Picture mode.

Upvotes: 8

Related Questions