From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: mus5mk2ly001@sneakemail.com (Lee) Newsgroups: gmane.emacs.help Subject: Re: Can header-line track a row in my file? Date: 27 Oct 2002 06:13:47 -0800 Organization: http://groups.google.com/ Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <5lpttyz0ux.fsf@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035733584 13138 80.91.224.249 (27 Oct 2002 15:46:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 27 Oct 2002 15:46:24 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 185pcK-0003PG-01 for ; Sun, 27 Oct 2002 16:46:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 185pcx-0007N8-00; Sun, 27 Oct 2002 10:46:59 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Original-NNTP-Posting-Host: 68.12.230.116 Original-X-Trace: posting.google.com 1035728027 3624 127.0.0.1 (27 Oct 2002 14:13:47 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 27 Oct 2002 14:13:47 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:106434 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2984 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2984 "Stefan Monnier " wrote in message news:<5lpttyz0ux.fsf@rum.cs.yale.edu>... > >>>>> "Lee" == Lee writes: > > I have a file in a large table that I have to scroll around in. It > > would be nice to hang the first row of the table, which tells me what > > is in what column, at the top of the buffer and have it update as I > > scroll horizontally through the table. > > Try something like > > (set (make-local-variable 'header-line-format) > '(:eval (save-excursion > (goto-char (point)) > (move-to-column (window-hscroll)) > (buffer-substring (point) (line-end-position))))) Awesome, thanks! In my case I want to track a particular line, so it would be (set (make-local-variable 'header-line-format) '(:eval (save-excursion (goto-line 18) (move-to-column (window-hscroll)) (buffer-substring (point) (line-end-position))))) Thanks again, Lee