1

The case I am presenting right here isn't reproducible everywhere in Emacs but the where I was able reproduce it was in nav when telling it the path of a location to jump to, in both Emacs 24.1.x and 24.3.x.

So the question is why is it that when killing/copying a text, say from the python comments (buffer in python-mode), and yanking/pasting it elsewhere, say the minibuffer, the font-face is also yanked? And why is it that in most cases this is not the case, i.e. the yanked text adopts the font-face of the location where it is yanked?

Another related question: how can we find out which things(meta-data too) were actually killed/copied?

Drew
  • 29,895
  • 7
  • 74
  • 104
Bleeding Fingers
  • 6,993
  • 7
  • 46
  • 74
  • 1
    I think it's similar to how in general computer clipboard works. It normally has the content in some format (some times more then one). So that when pasting, some times the environment may get more insight into what kind of thing was pasted. Not sure where would this be useful in Emacs, but, in Gmail, for example, if you copy an image from HTML page elsewhere and then paste it into HTML email editor, it will insert the image too. http://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Properties.html here it explains how Emacs represents the additional info of the text. –  Jul 07 '13 at 13:54

1 Answers1

2

It happens because text color and font are just like any other text property. And properties are copied along with their text by default (simply because they could contain information you DO want to copy).

Don't worry too much about it, this information doesn't get saved into the file, and, in the case of font locking, it's usually overridden quite quickly.

For your last question, you can check the detailed contents of any killed string by looking at the kill ring M-x describe-variable RET kill-ring RET.

Malabarba
  • 4,473
  • 2
  • 30
  • 49
  • and what goes in the clipboard of the OS? just the text or the properties too? – Bleeding Fingers Jul 07 '13 at 20:01
  • Just the text as far as I know. I've never been able to copy text properties from emacs to another application, though I've tried. – Malabarba Jul 07 '13 at 20:24
  • I think there is an agreed standard for the format in which text and its associated properties are copied. Because say you copy a formatted string from a webpage and paste it MS Word, it will associate with the text the formatting too(as close it can) and then try to yank the same in Emacs you'll only get the text. Meaning Emacs knows, based, maybe, standard that MS Word knows too, that which part is text and which is just its property(metadata) – Bleeding Fingers Jul 07 '13 at 20:35