emacs-pretest-bug
[Top][All Lists]
Advanced

[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





reply via email to

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