From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: M-w, then C-y. C-y inserts text properties that aren't on original. Date: Sat, 20 Feb 2010 11:02:39 +0200 Message-ID: <83r5ogwa8g.fsf@gnu.org> References: <20100218202902.GE2671@muc.de> <838wapy3yo.fsf@gnu.org> <20100219122419.GA918@muc.de> <20100219143513.GC918@muc.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1266656686 4387 80.91.229.12 (20 Feb 2010 09:04:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Feb 2010 09:04:46 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 20 10:04:44 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NilGT-0004s1-Oz for ged-emacs-devel@m.gmane.org; Sat, 20 Feb 2010 10:04:42 +0100 Original-Received: from localhost ([127.0.0.1]:49375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NilGT-0001zC-2K for ged-emacs-devel@m.gmane.org; Sat, 20 Feb 2010 04:04:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NilGO-0001z5-4L for emacs-devel@gnu.org; Sat, 20 Feb 2010 04:04:36 -0500 Original-Received: from [140.186.70.92] (port=46287 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NilGN-0001yq-D1 for emacs-devel@gnu.org; Sat, 20 Feb 2010 04:04:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NilGN-0008S6-1p for emacs-devel@gnu.org; Sat, 20 Feb 2010 04:04:35 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:41850) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NilGM-0008Rj-Qh for emacs-devel@gnu.org; Sat, 20 Feb 2010 04:04:35 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0KY400200UEYP500@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 20 Feb 2010 11:04:32 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.228.213.68]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KY400LJGUJHW7D0@a-mtaout20.012.net.il>; Sat, 20 Feb 2010 11:04:30 +0200 (IST) In-reply-to: <20100219143513.GC918@muc.de> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:121238 Archived-At: > Date: Fri, 19 Feb 2010 14:35:13 +0000 > Cc: emacs-devel@gnu.org > From: Alan Mackenzie > > `insert-for-yank' carries on, and calls `remove-yank-excluded-properties' > which deliberately changes 'category properties into other properties. > > Presumably there was some special case in the distant past which required > this transformation. It is surely wrong in the general case - yanking > into a buffer shouldn't add text properties which weren't in the > original - surely? > > I'm going to try and track down that special case. It looks like I'll > have to fix the inserted string in CC Mode by hand. The reason for this behavior is this change: 2002-04-27 Richard M. Stallman * subr.el (insert-for-yank): Replace `category' property with whatever properties it stands for. The discussion that led to this change starts here: http://lists.gnu.org/archive/html/emacs-devel/2002-04/msg00648.html You will find there the reason for the change (buttons in *Help* buffers, and the way we put the mouse-face property on them). I wonder if we could make the code which replaces `category' with what it stands for, with a slightly less general code that replaces only those values of `category' that are used for buttons. Or some similar change which will make that feature more focused on the problem it needs to solve. I added a comment in `remove-yank-excluded-properties' explaining what do we do that for and pointing to the above URL for details.