GNU bug report logs - #17052
substitute-command-keys strips text properties

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Thu, 20 Mar 2014 16:23:01 UTC

Severity: wishlist

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #48 received at 17052 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 17052 <at> debbugs.gnu.org
Subject: Re: bug#17052: substitute-command-keys strips text properties
Date: Mon, 16 Nov 2020 17:24:03 -0800
close 17052 28.1
thanks

Glenn Morris <rgm <at> 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.)




This bug report was last modified 4 years and 192 days ago.

Previous Next


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