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

Miles Bader <address@hidden> writes:

> 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 ...))
>                ...))


I don't see how that will work (I never really understood how that is useful
at all)?

If the predicate is false, this simply mean that "s" is shown as-is
(which isn't what we want).  For example,

  (insert "<" (propertize "s" 'display '(when (eq 1 1) space :width 3)) ">")

inserts (what looks like):

        <   >

while

  (insert "<" (propertize "s" 'display '(when (eq 0 1) space :width 3)) ">")

inserts

        <s>


It would make a lot more sense if we could do something like:

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


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





reply via email to

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