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

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

[debbugs-tracker] bug#23254: closed (25.0.90; substitute-command-keys do


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#23254: closed (25.0.90; substitute-command-keys does not preserve text properties)
Date: Thu, 14 Apr 2016 15:29:01 +0000

Your message dated Thu, 14 Apr 2016 08:28:25 -0700
with message-id <address@hidden>
and subject line Re: 25.0.90; substitute-command-keys does not preserve text 
properties
has caused the debbugs.gnu.org bug report #23254,
regarding 25.0.90; substitute-command-keys does not preserve text properties
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
23254: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23254
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 25.0.90; substitute-command-keys does not preserve text properties Date: Sat, 9 Apr 2016 14:58:29 -0400 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
In Emacs 25, substitute-command-keys removes text properties of strings 
containing quotes:

> 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))

As Eli pointed out on the mailing list,

> Anything that is substituted has its test properties removed:
> 
>   (substitute-command-keys (propertize "\\[forward-char]" 'prop 'val))
>    => "C-f"
> 
> The above is from Emacs 24.5.
> 
> I think patches are welcome to reinstate the properties.

This is an issue in particular for docstrings:

(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.

Clément.

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message --- Subject: Re: 25.0.90; substitute-command-keys does not preserve text properties Date: Thu, 14 Apr 2016 08:28:25 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 Although substitute-command-keys has never kept text properties when it makes a change, it is annoying that merely substituting quotes strips the properties, so I installed the attached patch into emacs-25 to fix this particular problem. Thanks for reporting it.

Attachment: 0001-substitute-command-keys-keeps-quotes-text-props.patch
Description: Source code patch


--- End Message ---

reply via email to

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