emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103444: * lisp/facemenu.el (list


From: Eli Zaretskii
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103444: * lisp/facemenu.el (list-colors-display): Use with-help-window (Bug#8048).
Date: Tue, 01 Mar 2011 21:00:40 +0200

> Date: Tue, 01 Mar 2011 10:47:16 +0100
> From: martin rudalics <address@hidden>
> Cc: address@hidden
> 
>  >>     (insert (propertize
>  >>              " " 'display
>  >>              '(space :align-to (- text 8))) "#123456")
>  >
>  > Ah yes, I think this will work.  Thanks.
>  >
>  > In the general case, the stuff after stretch glyph could have arbitrary
>  > width, so this wouldn't work; but it's certainly good enough for what
>  > list-colors-display needs.
> 
> But for one minor detail.  `list-colors-print' produces output of the
> form
> 
> ghost white          ghost white, GhostWhite               #f8f8ff
> 
> where the number of color aliases listed in the middle is currently
> adjusted according to the actual window width.  If the window is wide
> enough, more aliases are displayed.  So we'd still need to know the
> width of the window _before_ filling the buffer in order to emulate the
> old behavior faithfully (personally I don't think we should care much).

Couldn't you try adding more aliases until the gap between the color
name on the left and the first alias in the middle is small enough?
You could use current-column to measure the gap.  Would that work?

> Maybe we could provide a display specificier, say "truncate", so we
> could do something like
> 
> (insert (propertize string 'display '(truncate (- text 9))))
> 
> to assert that any such string never extends past the ninth column
> before the end of the text area.

But that's not what we want here.  We don't want to truncate, we want
to insert text that fits without truncation.



reply via email to

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