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

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

Re: Can header-line track a row in my file?


From: Lee
Subject: Re: Can header-line track a row in my file?
Date: 27 Oct 2002 06:13:47 -0800

"Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> 
wrote in message news:<5lpttyz0ux.fsf@rum.cs.yale.edu>...
> >>>>> "Lee" == Lee  <mus5mk2ly001@sneakemail.com> 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


reply via email to

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