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 15:40:59 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Miles Bader <address@hidden> writes:

> There _are_ conditionals of some sort in display properties; can't they be
> used instead?
> 

They can be used as an alternate way of specifying the predicates in my example,
e.g.  [[untested code follows]]

(setq header-line-format
      '(
        (:eval (if (HAS-SCROLL-BARS-ON-LEFT-P)
                   (:propertize "s" display (space :width scroll-bar))
                  ""))
        (:eval (if (HAS-LEFT-FRINGE-OUTSIDE-MARGIN-P)
                   (:propertize "f" display (space :width left-fringe))
                  ""))
        (:eval (if (HAS-LEFT-DISPLAY-MARGIN-P)
                   (:propertize "m" display (space :width left-margin))
                  ""))
        (:eval (if (HAS-LEFT-FRINGE-INSIDE-MARGIN-P)
                   (:propertize "f" display (space :width left-fringe))
                  ""))
        "hello world"))


The drawback / advantage of this is that we need to evalute those
predicates every time we redraw the header line, rather than only once
when we set it up [which is much more efficient, but doesn't always
work if one later changes some of the window decorations, like moving
the scroll-bar to the other side of the window, or adding a display
margin].


In any case, they are not an alternative to the :width WINDOW-ELEMENT
that I proposed.

-- 
Kim F. Storm  http://www.cua.dk





reply via email to

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