all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Difficulties with `purecopy' discarding text properties from strings
@ 2017-05-19 18:55 Alan Mackenzie
  2017-05-19 19:11 ` Daniel Colascione
  2017-05-19 19:22 ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Alan Mackenzie @ 2017-05-19 18:55 UTC (permalink / raw)
  To: emacs-devel

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?

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-05-20 10:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-19 18:55 Difficulties with `purecopy' discarding text properties from strings Alan Mackenzie
2017-05-19 19:11 ` Daniel Colascione
2017-05-19 20:04   ` Alan Mackenzie
2017-05-19 19:22 ` Stefan Monnier
2017-05-19 19:54   ` Alan Mackenzie
2017-05-19 21:04     ` Eli Zaretskii
2017-05-20 10:29       ` Alan Mackenzie
2017-05-20  2:58     ` Stefan Monnier
2017-05-20 10:40       ` Alan Mackenzie

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.