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

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

bug#17052: substitute-command-keys strips text properties


From: Stefan Kangas
Subject: bug#17052: substitute-command-keys strips text properties
Date: Mon, 16 Nov 2020 17:24:03 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

close 17052 28.1
thanks

Glenn Morris <rgm@gnu.org> writes:

>> Looks like this has been fixed sometime in the intervening years?
>>
>> (substitute-command-keys (propertize "foo" 'face 'bold))
>> => #("foo" 0 3 (face bold))
>
> Nope, you need to use an example which does a substitution, eg
>
> (substitute-command-keys (propertize "foo \\[find-file]" 'face 'bold))

This was fixed by the recent rewrite of substitute-command-keys in Lisp.
I've added a test for this in commit 27655f9f38, and am therefore
closing this bug.

(For posterity, the root cause for this was that `princ' does not
preserve text properties.  The code now uses `insert' instead.)





reply via email to

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