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

Previous Next

Package: emacs;

Reported by: Oleh Krehel <ohwoeowho <at> gmail.com>

Date: Mon, 22 Jun 2015 11:10:03 UTC

Severity: normal

Tags: notabug

Found in version 24.5

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Oleh Krehel <ohwoeowho <at> gmail.com>
Cc: 20872 <at> debbugs.gnu.org
Subject: bug#20872: 24.5; add-face-text-property doesn't work for :height
Date: Mon, 22 Jun 2015 18:10:06 +0300
> From: Oleh Krehel <ohwoeowho <at> gmail.com>
> Date: Mon, 22 Jun 2015 13:02:45 +0200
> 
>     (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?

Untested: copy the face using copy-face, then change ':height'
attribute of the copied face using set-face-attribute, and finally
apply the modified face to the string.




This bug report was last modified 9 years and 337 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.