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

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

Re: Persisting centered cursor with Scroll Lock key


From: Johan Bockgård
Subject: Re: Persisting centered cursor with Scroll Lock key
Date: Sat, 08 May 2004 21:32:57 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.2 (usg-unix-v)

Torsten Bronger <address@hidden> writes:

> but what is the most elegant/safest way to keep the cursor in the
> center of the window, no matter how the position is changed (arrow
> keys, control key sequences, mouse wheel etc)?

This might work:

(defun my-recenter ()
  (recenter '(4)))

;; buffer local hook, excute in the buffers where you want it to be
;; active
(add-hook 'post-command-hook 'my-recenter t t)

-- 
Johan Bockgård


reply via email to

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