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: Miles Bader
Subject: Re: ruler-mode is broken
Date: 15 Oct 2003 11:11:38 +0900

address@hidden (Kim F. Storm) 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,
> (setq header-line-format
>       '(
>         (:eval (if (HAS-SCROLL-BARS-ON-LEFT-P)
>                    (:propertize "s" display (space :width scroll-bar))
>                   ""))
...

I was thinking of the `when' display-property attribute, e.g.:

   (setq header-line-format
         (list (propertize
                "s"
                'display
                '(when (eq scroll-bar-mode 'left) space :width ...))
               ...))

This is presumably a bit more efficient that repeatedly calling
propertize or whatever.  Looking at the manual, I see that the problem
with this is that the display-property `when' operator has no notion of
`else'!  However maybe that would be easy to add; perhaps a `cond'
operator would be the most useful.  If the else case was just "", then
presumably you could avoid the minimum pixel restrictions.

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

Right, I wasn't suggesting that.

-Miles
-- 
`To alcohol!  The cause of, and solution to,
 all of life's problems' --Homer J. Simpson




reply via email to

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