unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: David De La Harpe Golden <david@harpegolden.net>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: 8384@debbugs.gnu.org
Subject: bug#8384: 24.0.50; Yanking and text properties
Date: Mon, 04 Apr 2011 21:53:39 +0100	[thread overview]
Message-ID: <4D9A2FD3.5050802@harpegolden.net> (raw)
In-Reply-To: <8762r0utx5.fsf@escher.fritz.box>

On 30/03/11 23:26, Stephen Berman wrote:
> 1. emacs -Q
> 2. Enter text in a buffer and select it, e.g.: `C-x b a RET test C-SPC C-a'
> 3. Put a face or display text property on the selected text, e.g.: `M-o b'
> 4. Put the propertized text on the kill ring: `C-SPC C-e M-w'.
> 5. Yank it in another buffer: `C-x b b RET C-y'
> =>  The yanked text in buffer b is propertized as in buffer a.
>
> Now repeat steps 2 and 3, and instead of repeating step 4, double-click
> on the text with mouse-1 to make it the primary selection, and instead
> of repeating step 5, do `C-x b b RET<mouse-2>' to yank that selection.
> =>  The yanked text in buffer b is not propertized.
>
> Is this difference between the two types of yanking a programming bug or
> a feature (of the primary selection?) that is AFAICS undocumented and
> hence a doc bug?

Hmm. I'd be inclined to consider the inconsistency a bug, - if C-w/M-y 
sequences are property-preserving intraprocess*, so too should be 
select/middleclick sequences, really.

* properties were always lost AFAIK once the data went "all the way 
outside" to other processes, though technically emacs Could Do Better 
there on several platforms via the multi-format support in relevant 
window system clipboad and selection protocols.

> The comment by Glenn Morris in bug#8376
> (http://permalink.gmane.org/gmane.emacs.bugs/45480) suggests the former,
> namely, that yanking by C-y should also not preserve text properties.
> Note, however, that mouse-yank-at-click behaves like C-y and not like
> mouse-yank-primary.  (Or is it only font-locking, not face and display
> properties,

I think it's only the font-locking if I'm understanding the arguments 
correctly (which I may presently not), the font-locking properties are 
after all dynamic things, not something the user sets - i.e. if you 
yanked some python code into a python docstring (or some entirely 
separate sphinx rst file) you presumably wouldn't want them preserved, 
the correct thing to do is let the inserted text be rehighlighted 
according to the locally applicable rules if any.

I guess it would also be possible to "freeze" font-locking into static 
face properties. Not something I'd personally want to happen unless I 
asked for it - though consider too the way word processors now tend to 
offer "paste special..." options (related to the aforementioned multi 
format support), i.e. there are nowadays established ways for apps to 
offer both formatted and unformatted variants of text to paste in on our 
three major window systems.  The development work involved is nontrivial 
though, at least in my estimation.








  reply	other threads:[~2011-04-04 20:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 22:26 bug#8384: 24.0.50; Yanking and text properties Stephen Berman
2011-04-04 20:53 ` David De La Harpe Golden [this message]
2011-04-05  5:16   ` Eli Zaretskii
2012-08-07  4:53     ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D9A2FD3.5050802@harpegolden.net \
    --to=david@harpegolden.net \
    --cc=8384@debbugs.gnu.org \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).