From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (=?iso-8859-1?q?Johan_Bockg=E5rd?=) Newsgroups: gmane.emacs.help Subject: Re: Persisting centered cursor with Scroll Lock key Date: Sat, 08 May 2004 21:32:57 +0200 Organization: Chalmers University of Technology, Sweden Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1084045671 4333 80.91.224.253 (8 May 2004 19:47:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 8 May 2004 19:47:51 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 08 21:47:45 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BMXnU-0008Vd-00 for ; Sat, 08 May 2004 21:47:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.33) id 1BMXm7-00031h-UE for geh-help-gnu-emacs@m.gmane.org; Sat, 08 May 2004 15:46:20 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.sunet.se!news01.sunet.se!dd.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 17 Original-NNTP-Posting-Host: frealaf.dd.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.2 (usg-unix-v) Cancel-Lock: sha1:UPtMvgl8t3UvR35ITEDiU7bJKIY= Original-Xref: shelby.stanford.edu gnu.emacs.help:123081 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:18368 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18368 Torsten Bronger 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