bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#20872: 24.5; add-face-text-property doesn't work for :height


From: Oleh Krehel
Subject: bug#20872: 24.5; add-face-text-property doesn't work for :height
Date: Mon, 22 Jun 2015 13:02:45 +0200

Here's a code that works for setting a string foreground:

    (defface test-face
      '((t (:height 1.2 :foreground "green")))
      "doc.")
    (setq asdf (propertize "asdf" 'face 'test-face))
    (add-face-text-property 0 (length asdf) '(:foreground "red") nil asdf)

`asdf' will still have the height 1.2 through `test-face' while gaining
a red foreground, instead of green.

But this doesn't work:

    (add-face-text-property 0 (length asdf) '(:height 1.0) nil asdf)

While the text properties will change, when inserting `asdf' into a
`fundamental-mode' buffer, it will still have the height 1.2. How can I
set the height to 1.0, while preserving the face?

The actual use case is to offer propertized strings a choices in the
minibuffer. In that case, I want to keep all face properties, except the
height. Since extra height messes up the trimming of strings to
`window-width'.





reply via email to

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