[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ruler support in hexl mode
From: |
Kim F. Storm |
Subject: |
Re: ruler support in hexl mode |
Date: |
12 Mar 2004 00:56:29 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
Stefan Monnier <address@hidden> writes:
> > You can drop all of that ruler-mode- stuff if you use the advanced
> > pixel-alignment form of :align-to (see xdisp.c around line 17990):
>
> Hey neat. When was this added?
>
> > (let ((s " 87654321 0011 2233 4455 6677 8899 aabb ccdd eeff
> > 0123456789abcdef")
> > (pos 0))
> > ;; Turn spaces in the header into stretch specs so they work
> > ;; regardless of the header-line face.
> > (while (string-match "[ \t]+" s pos)
> > (setq pos (match-end 0))
> > (put-text-property (match-beginning 0) pos 'display
> > ;; Assume fixed-size chars
> > `(space :align-to (+ (scroll-bar . left)
> > left-fringe left-margin
> > ,(1- pos)))
> > s))
>
> Note that if there's no margin (i.e. 99% of the time) this will not align
> things properly on a text terminal. This is the reason why I do
> a `make-string' for the leading space: the size of the string is used
> for alignment in text-terminals while the `display' prop is used otherwise.
Clever! I didn't consider that.
>
> Of course, the text-terminal display engine should ideally be improved to
> understand :align-to and such things, but I won't be the one to implement it.
I can give it a try.
>
> Also, how about adding a `text-start' special case which would stand for
> (+ (scroll-bar . left) left-fringe left-margin) so that we don't have to
> remember all the possible display elements and so that when we decide to
> add yet another display element we won't have to update the code.
That's a good idea. I'll do that.
--
Kim F. Storm <address@hidden> http://www.cua.dk
- ruler support in hexl mode, Masatake YAMATO, 2004/03/08
- Re: ruler support in hexl mode, Stefan Monnier, 2004/03/10
- Re: ruler support in hexl mode, Masatake YAMATO, 2004/03/10
- Re: ruler support in hexl mode, Kim F. Storm, 2004/03/12
- Re: ruler support in hexl mode, Stefan Monnier, 2004/03/12
- Re: ruler support in hexl mode,
Kim F. Storm <=
- Re: ruler support in hexl mode, Masatake YAMATO, 2004/03/12
- Re: ruler support in hexl mode, Stefan Monnier, 2004/03/12
- Re: ruler support in hexl mode, Masatake YAMATO, 2004/03/13
- Re: ruler support in hexl mode, Masatake YAMATO, 2004/03/15
- Re: ruler support in hexl mode, Richard Stallman, 2004/03/15
- Re: ruler support in hexl mode, Kim F. Storm, 2004/03/15
- Re: ruler support in hexl mode, Richard Stallman, 2004/03/16
- Re: ruler support in hexl mode, Kim F. Storm, 2004/03/16
- Re: ruler support in hexl mode, Stefan Monnier, 2004/03/16
- Re: ruler support in hexl mode, Kim F. Storm, 2004/03/16