From unknown Sat Aug 16 22:43:11 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#8384 <8384@debbugs.gnu.org> To: bug#8384 <8384@debbugs.gnu.org> Subject: Status: 24.0.50; Yanking and text properties Reply-To: bug#8384 <8384@debbugs.gnu.org> Date: Sun, 17 Aug 2025 05:43:11 +0000 retitle 8384 24.0.50; Yanking and text properties reassign 8384 emacs submitter 8384 Stephen Berman severity 8384 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 30 18:26:31 2011 Received: (at submit) by debbugs.gnu.org; 30 Mar 2011 22:26:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q53qQ-000444-Sk for submit@debbugs.gnu.org; Wed, 30 Mar 2011 18:26:31 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q53qO-00043r-Nn for submit@debbugs.gnu.org; Wed, 30 Mar 2011 18:26:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q53qI-0001nM-Mr for submit@debbugs.gnu.org; Wed, 30 Mar 2011 18:26:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:51330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q53qI-0001nI-Js for submit@debbugs.gnu.org; Wed, 30 Mar 2011 18:26:22 -0400 Received: from [140.186.70.92] (port=39275 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q53qH-0005wm-Dz for bug-gnu-emacs@gnu.org; Wed, 30 Mar 2011 18:26:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q53qF-0001mg-B1 for bug-gnu-emacs@gnu.org; Wed, 30 Mar 2011 18:26:21 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:42097) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Q53qF-0001mG-0P for bug-gnu-emacs@gnu.org; Wed, 30 Mar 2011 18:26:19 -0400 Received: (qmail invoked by alias); 30 Mar 2011 22:26:15 -0000 Received: from i59F5412C.versanet.de (EHLO escher.home) [89.245.65.44] by mail.gmx.net (mp006) with SMTP; 31 Mar 2011 00:26:15 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1+mMRp10lambTzn3dH+6Z02/28ZLZfUMndDyC1oub BSf825j6UKffg4 Received: by escher.home (Postfix, from userid 1000) id 038FE62965; Thu, 31 Mar 2011 00:26:14 +0200 (CEST) From: Stephen Berman To: bug-gnu-emacs@gnu.org Subject: 24.0.50; Yanking and text properties Date: Thu, 31 Mar 2011 00:26:14 +0200 Message-ID: <8762r0utx5.fsf@escher.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) 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 ' 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? 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, that aren't supposed to be preserved any more? Note also that if other text properties, e.g. invisible or intangible, are applied in the first recipe, yanking with C-y does not preserve these.) In GNU Emacs 24.0.50.1 (i686-suse-linux-gnu, GTK+ Version 2.20.1) of 2011-03-30 on escher Windowing system distributor `The X.Org Foundation', version 11.0.10800000 configured using `configure '--without-toolkit-scroll-bars' 'CFLAGS=-g -O2 -fno-optimize-sibling-calls'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=local locale-coding-system: utf-8-unix default enable-multibyte-characters: t From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 04 16:53:54 2011 Received: (at 8384) by debbugs.gnu.org; 4 Apr 2011 20:53:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6qmY-0003pS-JD for submit@debbugs.gnu.org; Mon, 04 Apr 2011 16:53:54 -0400 Received: from harpegolden.net ([65.99.215.13]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6qmU-0003pC-Ss for 8384@debbugs.gnu.org; Mon, 04 Apr 2011 16:53:52 -0400 Received: from [87.198.55.209] (87-198-55-209.ptr.magnet.ie [87.198.55.209]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 3" (verified OK)) by harpegolden.net (Postfix) with ESMTPSA id 02085683D9; Mon, 4 Apr 2011 21:53:40 +0100 (IST) Message-ID: <4D9A2FD3.5050802@harpegolden.net> Date: Mon, 04 Apr 2011 21:53:39 +0100 From: David De La Harpe Golden User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11 MIME-Version: 1.0 To: Stephen Berman Subject: Re: bug#8384: 24.0.50; Yanking and text properties References: <8762r0utx5.fsf@escher.fritz.box> In-Reply-To: <8762r0utx5.fsf@escher.fritz.box> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 8384 Cc: 8384@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) 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' 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 05 01:16:50 2011 Received: (at 8384) by debbugs.gnu.org; 5 Apr 2011 05:16:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6ydF-0006Bu-QV for submit@debbugs.gnu.org; Tue, 05 Apr 2011 01:16:50 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6ydE-0006Bf-7w for 8384@debbugs.gnu.org; Tue, 05 Apr 2011 01:16:49 -0400 Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Q6yd8-0001Cp-Ei; Tue, 05 Apr 2011 01:16:42 -0400 Date: Tue, 05 Apr 2011 01:16:42 -0400 Message-Id: From: Eli Zaretskii To: David De La Harpe Golden In-reply-to: <4D9A2FD3.5050802@harpegolden.net> (message from David De La Harpe Golden on Mon, 04 Apr 2011 21:53:39 +0100) Subject: Re: bug#8384: 24.0.50; Yanking and text properties References: <8762r0utx5.fsf@escher.fritz.box> <4D9A2FD3.5050802@harpegolden.net> X-Spam-Score: -6.5 (------) X-Debbugs-Envelope-To: 8384 Cc: 8384@debbugs.gnu.org, stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.5 (------) > Date: Mon, 04 Apr 2011 21:53:39 +0100 > From: David De La Harpe Golden > Cc: 8384@debbugs.gnu.org > > > 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' 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. It could be a bug, or it could be a side effect of the implementation, because the text we select with a mouse is treated very differently from the text we put on the kill ring. However, since we have an internal alist where we store all our selections, we should be able in principle to paste local selections with all their text properties. Would someone please trace through x-own-selection-internal when selecting, and then through x-get-selection-internal when pasting with the mouse, and see why the local selections we store in Vselection_alist lose their text properties? > * 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. Right, but since we keep our local copy of the selection, which in this case should be a string, we don't necessarily _need_ to lose the text properties. > > 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 It's only about font-lock, and thus not relevant to this discussion. > I guess it would also be possible to "freeze" font-locking into static > face properties. At first glance, this doesn't make sense to me. If the target buffer has font-lock enabled, it will delete/override such faces on the spot anyway. So to support such a feature, someone should first present a convincing use case. > though consider too the way word processors now tend to offer "paste > special..." options AFAIU, "Paste special" options are for _reformatting_ the selection into an equivalent (for some value of ``equivalent''), but different formatting. E.g., reformat text with colors into the equivalent HTML representation. That includes stripping all the formatting as one of the possibilities. But it does not include _addition_ of formatting, so seems unrelated to converting the fontification properties to hard-coded colors. Anyway, this last issue is not related to this bug report, so it should get its own thread. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 07 01:01:58 2012 Received: (at 8384) by debbugs.gnu.org; 7 Aug 2012 05:01:58 +0000 Received: from localhost ([127.0.0.1]:38563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sybva-0004HX-5p for submit@debbugs.gnu.org; Tue, 07 Aug 2012 01:01:58 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:44881) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SybvY-0004HQ-BS for 8384@debbugs.gnu.org; Tue, 07 Aug 2012 01:01:57 -0400 Received: by pbbrr4 with SMTP id rr4so5075565pbb.3 for <8384@debbugs.gnu.org>; Mon, 06 Aug 2012 21:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=MeLWSdgjbSfNzWyBNig6JTXEudbe6cg8PXF5y9l4sBE=; b=I3IhwAiKeeqlOyeKhH2s6KEddhHa0pJ3vw3YCDmx2n0rf/7+nxaiM/JKHS/rCWbjAR wX9OE8jZyoSpkX2Io7xf5Qmla7ESJxszmodmPlDs7QHyqUXSo4O8aFwIv4eVgtgCtqhw RtTbjs51fXQJOpIcQJ+EGep6M05JkXIvgGn4NxxHqk9h+RMjvA6axH3MqZoYevDzFIag 74LTny2ABw5wUvYhGgSxki+d/SSkN4XsSn5RcicHsAq+H4qWrt889zbwJjmZTwmr8Vdm CgauAHieNQWtEip5pW3T4/wKX3sPeJ0J1UmH8SPsVPz1vvKBz9vEcOqK5fsDUyfI/LBb 1m9w== Received: by 10.68.219.226 with SMTP id pr2mr24516507pbc.1.1344315239054; Mon, 06 Aug 2012 21:53:59 -0700 (PDT) Received: from ulysses ([155.69.17.229]) by mx.google.com with ESMTPS id ob9sm10366340pbb.28.2012.08.06.21.53.55 (version=SSLv3 cipher=OTHER); Mon, 06 Aug 2012 21:53:58 -0700 (PDT) From: Chong Yidong To: Eli Zaretskii Subject: Re: bug#8384: 24.0.50; Yanking and text properties References: <8762r0utx5.fsf@escher.fritz.box> <4D9A2FD3.5050802@harpegolden.net> Date: Tue, 07 Aug 2012 12:53:53 +0800 In-Reply-To: (Eli Zaretskii's message of "Tue, 05 Apr 2011 01:16:42 -0400") Message-ID: <87vcgvb8v2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8384 Cc: 8384@debbugs.gnu.org, stephen.berman@gmx.net, David De La Harpe Golden X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: >> > 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. > > It could be a bug, or it could be a side effect of the implementation, > because the text we select with a mouse is treated very differently > from the text we put on the kill ring. It just involves replacing buffer-substring-no-properties with buffer-substring in deactivate-mark. I agree that this inconsistency with C-w/M-w might as well be fixed, so I did that in the trunk. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 07 01:02:07 2012 Received: (at control) by debbugs.gnu.org; 7 Aug 2012 05:02:07 +0000 Received: from localhost ([127.0.0.1]:38567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sybvj-0004IB-Dt for submit@debbugs.gnu.org; Tue, 07 Aug 2012 01:02:07 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:44881) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sybvi-0004HQ-5h for control@debbugs.gnu.org; Tue, 07 Aug 2012 01:02:06 -0400 Received: by mail-pb0-f44.google.com with SMTP id rr4so5075565pbb.3 for ; Mon, 06 Aug 2012 21:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=rRnF7ubuCP+VDI7TrvK4EeDv1VfNl0x/A+SEf+mK/dQ=; b=WwBtE2gFvytIDT7e6h1oowzK3XB6E4BWaU+Il+3/oqwf4gaSqv6qj7WYWTuiSYAlMR x511QlHyJIEY6gGn7ldVj7s3v0eA5ms1ja/IYO/x9TCcs3KfaHbXev/ygOndwkaN9s8B L6/raKrfRDClrWqGzBwu6DFj6d3fSvV7umAq2QIZ6uaJv4lKtgLl3fvBHScP+hGbV4mj NISEcSdXCfMi2sHq3TVh8m0HDsohWraxcMmxZWTtg4ZKdy++wwb0unnjcG7JDQLnqi3r v2DiBCojeDJV3WGxgSOK24LD/3NxosNYnQzgxNmP7CuznRZRHcKEv9n1TCwvvYUU2ya0 D/Ow== Received: by 10.68.130.37 with SMTP id ob5mr24404937pbb.62.1344315249417; Mon, 06 Aug 2012 21:54:09 -0700 (PDT) Received: from ulysses ([155.69.17.229]) by mx.google.com with ESMTPS id qt6sm3424109pbb.9.2012.08.06.21.54.07 (version=SSLv3 cipher=OTHER); Mon, 06 Aug 2012 21:54:08 -0700 (PDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 8384 Date: Tue, 07 Aug 2012 12:54:04 +0800 Message-ID: <878vdrl2tv.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) close 8384 thanks From unknown Sat Aug 16 22:43:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 04 Sep 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator