emacs-devel
[Top][All Lists]
Advanced

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

Re: Difficulties with `purecopy' discarding text properties from strings


From: Daniel Colascione
Subject: Re: Difficulties with `purecopy' discarding text properties from strings
Date: Fri, 19 May 2017 12:11:58 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 05/19/2017 11:55 AM, Alan Mackenzie wrote:
Hello, Emacs.

The context is my implementing of new mode-line %-constructs.  I want a
customisable user option whose values will be things like ("%o"), with
text properties on the string (for things like help strings and mouse
action key bindings).

I naively constructed such a defcustom, with text properties on the
value option strings.  After some debugging, I discover that defcustom
strips those text properties off the strings.  It does this by using
`purecopy' on these strings (in the function `custom-declare-variable').

(Yes, the variable I'm trying to declare is in bindings.el along with
all the other mode-line stuff, and this is preloaded stuff.)

So, I'm a little bit stuck.

Presumably there are good reasons for discarding text properties when
purecopying strings.  Or, maybe, there was just no particular reason to
amend the workings of `purecopy' when text properties came into
existence.

How does this sound for a solution to the problem?  In `defcustom',
introduce a new keyword `impure:' which, when placed early enough in the
defcustom would inhibit the `purecopy' action.

Or should I work at amending `purecopy' also to copy text properties?

When we move to the new dumper (whatever it is), I don't think we'll have a conventional purespace at all anymore. In my system, text properties are just automatically preserved along with everything else and don't get special treatment.



reply via email to

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