From: Eli Zaretskii <eliz@gnu.org>
To: Oleh Krehel <ohwoeowho@gmail.com>
Cc: 20872@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 [thread overview]
Message-ID: <831th3ixtd.fsf@gnu.org> (raw)
In-Reply-To: <87zj3s0zvu.fsf@gmail.com>
> From: Oleh Krehel <ohwoeowho@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.
next prev parent reply other threads:[~2015-06-22 15:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-22 11:02 bug#20872: 24.5; add-face-text-property doesn't work for :height Oleh Krehel
2015-06-22 15:10 ` Eli Zaretskii [this message]
2015-06-22 15:31 ` Wolfgang Jenkner
2015-06-22 15:30 ` Oleh Krehel
2015-06-22 16:06 ` Stefan Monnier
2015-06-23 9:20 ` Oleh Krehel
2015-06-23 13:38 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=831th3ixtd.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=20872@debbugs.gnu.org \
--cc=ohwoeowho@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.