[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ruler-mode is broken
From: |
Kim F. Storm |
Subject: |
Re: ruler-mode is broken |
Date: |
14 Oct 2003 14:37:12 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
Lute Kamstra <address@hidden> writes:
> Mwah, this seems to work:
>
> (setq header-line-format
> (concat "ss" ; To cover my scrollbar.
> (propertize "f" ; To cover the fringe.
> 'display
> `(space :width ,(/ (float (car (window-fringes)))
> (frame-char-width))))
> "hello world"))
>
I have patches to CVS emacs that allows you to write something like
(setq header-line-format
(concat
(propertize "s" 'display (space :width scroll-bar))
(propertize "f" 'display (space :width left-fringe))
(propertize "m" 'display (space :width left-margin))
"hello world"))
as well as recognizing :pixel-width NUM and a :pixel-height NUM
properties.
This still isn't completely perfect as the minimum width of any
stretch glyph is 1 pixel so if there is, say, no left scroll-bar
and no left margin, the above will be off by 2 pixels.
So it should be written along these lines to produce correct results:
(setq header-line-format
(concat
(if (HAS-SCROLL-BARS-ON-LEFT-P)
(propertize "s" 'display (space :width scroll-bar))
"")
(if (HAS-LEFT-FRINGE-OUTSIDE-MARGIN-P)
(propertize "f" 'display (space :width left-fringe))
"")
(if (HAS-LEFT-DISPLAY-MARGIN-P)
(propertize "m" 'display (space :width left-margin))
"")
(if (HAS-LEFT-FRINGE-INSIDE-MARGIN-P)
(propertize "f" 'display (space :width left-fringe))
"")
"hello world"))
You need to fill in the proper predicates of course...
Would that be helpful ?
--
Kim F. Storm http://www.cua.dk
Re: ruler-mode is broken, David PONCE, 2003/10/08
Re: ruler-mode is broken, David PONCE, 2003/10/08
- Re: ruler-mode is broken, Lute Kamstra, 2003/10/10
- Re: ruler-mode is broken, Miles Bader, 2003/10/10
- Re: ruler-mode is broken, Lute Kamstra, 2003/10/10
- Re: ruler-mode is broken,
Kim F. Storm <=
- Re: ruler-mode is broken, Miles Bader, 2003/10/14
- Re: ruler-mode is broken, Kim F. Storm, 2003/10/14
- Re: ruler-mode is broken, Miles Bader, 2003/10/14
- Re: ruler-mode is broken, Kim F. Storm, 2003/10/15
- Re: ruler-mode is broken, Miles Bader, 2003/10/15
- Re: ruler-mode is broken, Kim F. Storm, 2003/10/15
- Re: ruler-mode is broken, Miles Bader, 2003/10/15
- Re: ruler-mode is broken, Kim F. Storm, 2003/10/16
- Re: ruler-mode is broken, Miles Bader, 2003/10/16
- Re: ruler-mode is broken, Kim F. Storm, 2003/10/16