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: martin rudalics
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103444: * lisp/facemenu.el (list-colors-display): Use with-help-window (Bug#8048).
Date: Sat, 05 Mar 2011 13:00:10 +0100
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> For my presentation program, I would like to be able to center some
> text.  I'd like to do this in the display spec, so that I don't have to
> write code to do anything special if, say, the user changes the font or
> the text, or resizes the frame, during the presentation.
>
> I don't think this is doable today.  One way would be to allow a string
> in a pixel specification, and take that to mean the pixel width of the
> string using the font/etc of the propertized character.
>
> That is:
>
>     (insert (propertize " " 'display '(space (- center (0.5 . "the text"))))
>             "the text")

This seems hardly practical.  What would happen when the window must be
scrolled to bring `point' back to it?  How would you show a buffer
containing such a specification in two windows?

You should be able to visualize the effect by putting a marker on that
text and adding a `recenter' call with `point' temporarily set to that
marker in your `post-command-hook'.

martin



reply via email to

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