From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#17052: substitute-command-keys strips text properties Date: Mon, 16 Nov 2020 17:24:03 -0800 Message-ID: References: <871rxns0vz.fsf@mouse.gnus.org> <1xh86jb494.fsf@fencepost.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38794"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Juanma Barranquero , Lars Ingebrigtsen , 17052@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 17 02:25:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kepk6-0009uV-3w for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Nov 2020 02:25:10 +0100 Original-Received: from localhost ([::1]:51406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kepk5-0008HP-60 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Nov 2020 20:25:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kepjy-0008HC-Ne for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2020 20:25:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kepjy-0002CN-E4 for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2020 20:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kepjy-0001p9-8x for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2020 20:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Nov 2020 01:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17052 X-GNU-PR-Package: emacs Original-Received: via spool by 17052-submit@debbugs.gnu.org id=B17052.16055762526950 (code B ref 17052); Tue, 17 Nov 2020 01:25:02 +0000 Original-Received: (at 17052) by debbugs.gnu.org; 17 Nov 2020 01:24:12 +0000 Original-Received: from localhost ([127.0.0.1]:57868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kepjA-0001nx-1T for submit@debbugs.gnu.org; Mon, 16 Nov 2020 20:24:12 -0500 Original-Received: from mail-ej1-f53.google.com ([209.85.218.53]:35270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kepj7-0001nc-SE for 17052@debbugs.gnu.org; Mon, 16 Nov 2020 20:24:10 -0500 Original-Received: by mail-ej1-f53.google.com with SMTP id f23so27201464ejk.2 for <17052@debbugs.gnu.org>; Mon, 16 Nov 2020 17:24:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=iw3CZpwJLbiWqnJCjgfGWi3Vff9ilcyo4yETYT80ARE=; b=coDwbsNS1pDiyhSSUXlHiGWlfqZULEZU4ozeAW/I8l3ADwCeevKSTcDtucHAZ48Aiu UARtglgDaYETa2iQSW0oei9tewV1ndG/pWTLrrvSwsZfQ+uWphM43gsy3RJWJq0wo1y0 HOnV1A8h15LvZ46iUthK6TrH53HFWPorLC7IesAyLyHFeiW1dNgsENl6Hlv6iCrlngJ5 fM1ZpjbRAeZ9+ycPvSMmNeQKd10khICscbOHZt2FMNfxc8qqop447/o5KTcfGJExyeGV 3HHgpfHF16X/u+MJbgHTSf9wwQ0AGT+XC+ohCroF9jWRwcc8UThd5Z0ueSh00vuEDgTI HE5A== X-Gm-Message-State: AOAM530JI7lMkttzs+0Womh9QKActSyoBE5LXgOmuFB3cQdp6ucce3iw EvFW5TdOrGvPzMNxuIVf3H//Ofbys810p8eQKD0= X-Google-Smtp-Source: ABdhPJw2LfX9CSEVHwYUbgz2FrQ7r0dHzNKDPeasS1nrVrepGUXwO0X/11aqw0NlYxMc0M031vMinwZ1oincguOwsp4= X-Received: by 2002:a17:906:519b:: with SMTP id y27mr16713374ejk.25.1605576244007; Mon, 16 Nov 2020 17:24:04 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 16 Nov 2020 17:24:03 -0800 In-Reply-To: <1xh86jb494.fsf@fencepost.gnu.org> (Glenn Morris's message of "Wed, 14 Aug 2019 21:34:47 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193509 Archived-At: close 17052 28.1 thanks Glenn Morris 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.)