[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Should substitute-command-keys remove text properties of strings contain
From: |
Clément Pit--Claudel |
Subject: |
Should substitute-command-keys remove text properties of strings containing quotes? |
Date: |
Mon, 21 Dec 2015 11:38:59 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
In Emacs 25, substitute-command-keys removes text properties of strings
containing quotes. Is this expected?
> In Emacs 25:
(substitute-command-keys (propertize "`a'" 'prop 'val))
"‘a’"
> In Emacs 24.5:
(substitute-command-keys (propertize "`a'" 'prop 'val))
#("`a'" 0 3 (prop val))
For more context, here is how I came across this issue (slightly edited example
from a package with defcustoms with large `set's of options):
(defcustom my/pretty/set/option nil
"Demo text properties in customize."
:group 'emacs
:type `(set (const :tag ,(concat (propertize "Title of option 1 (bold on both
24.5 and 25)" 'face '(:weight bold))
"\n "
(propertize "Docs of option 1, in a smaller
font on both 24.5 and 25." 'face '(:height 0.9))))
(const :tag ,(concat (propertize "Title of option 2 (`bold' on
24.5 but not 25)" 'face '(:weight bold))
"\n "
(propertize "Docs of option 2, in a smaller
font on 24.5, but not 25." 'face '(:height 0.9))))))
This example uses text properties on `:tag's to make the customize buffer more
readable. This works fine in GNU Emacs 24.5, but it stopped working on master
(and emacs-25), because of substitute-command-keys replacing quotes and as a
side effect dropping text properties.
Is this change expected (making the example above a misuse of text properties),
or is it accidental? If it is not expected, I can open a bug report.
Thanks,
Clément.
- Should substitute-command-keys remove text properties of strings containing quotes?,
Clément Pit--Claudel <=