From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alex Schroeder Newsgroups: gmane.emacs.devel Subject: don't yank keymap text properties Date: Sun, 12 Oct 2003 15:23:12 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87d6d2zj27.fsf@emacswiki.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1065965273 31226 80.91.224.253 (12 Oct 2003 13:27:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 12 Oct 2003 13:27:53 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Oct 12 15:27:51 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A8gGF-0007fQ-00 for ; Sun, 12 Oct 2003 15:27:51 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A8gGF-0001ai-00 for ; Sun, 12 Oct 2003 15:27:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A8gCS-0000Op-Bv for emacs-devel@quimby.gnus.org; Sun, 12 Oct 2003 09:23:56 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1A8gCO-0000OU-3Z for emacs-devel@gnu.org; Sun, 12 Oct 2003 09:23:52 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1A8gBr-0000NC-9D for emacs-devel@gnu.org; Sun, 12 Oct 2003 09:23:51 -0400 Original-Received: from [62.2.95.247] (helo=smtp.hispeed.ch) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1A8gBq-0000Mw-Rh for emacs-devel@gnu.org; Sun, 12 Oct 2003 09:23:19 -0400 Original-Received: from confusibombus.emacswiki.org (dclient80-218-249-50.hispeed.ch [80.218.249.50]) by smtp.hispeed.ch (8.12.6/8.12.6/tornado-1.0) with ESMTP id h9CDNBLe030024 for ; Sun, 12 Oct 2003 15:23:11 +0200 Original-To: emacs-devel@gnu.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACkElEQVR42s1a0bLsIAgzjv// y7kPd9pVKxKVdk6fzux2C4EAwR6QZBpcQEopIf3Fq3a52Lfh0Mjjk99zcWYBwA2ihEen9jVxfAf/ u0+Y2HQwNoVw4Dx34trRV6NSjiLPmfPt77jwiBxB/3PnZ3B2AGxzHnGu0wcBwAIAyQwZGvQhiFcy YLOFQcSB/MS82n3ec37vykNqRFTX9rVWR2U5+pZNIggll0CUOQN9BDdm1LfBmcZxIEqjL6r2JU/D galaB7Zg4jlY2ulnIx9OR4iMRl38CAFyKaA8jAxE7lNn650VKMULZ/54crqn0YQCJGQliebXkFIK hwqmGm28cgsSjz/hzRCMneQEwMjVoH3gWTtMPgIslJUV5uIluvUEkyzU+gUGQO62e9NuSdZCzNOM fDPC87iCqfE9gHinsIrSL16TPBfrYIeHzqKU90a50jCh54EcrgAUFo5ibzvebgr/I66USQ0CspQp IVSoBQK3WswDDIndIraHxoglqOjM1d044PQvu1NY0EHtqQR/XwJ+PeCs0x2dSlApZVw4MPER23PD 7JekoHxrqTRod/2Gx5nhx5dfAJhqPt7tDMIZxNN/7lOIaparPn7ZQ88drlORC2eLWXowxIq4gHTh VN1BSmsHoxYAbPWDTuGQuuecS+aYQUYpfr0YqPQOuuUk5tApK077+2xfOYP+XyWEIwPcE49lvT9N y2+wU2KylGGp4yxlALcm6fSlmgk62yfSsfNunDl5d6W91MBUoZw679YAJoMMkhijuXdFOL+khaL2 s+g3zy4APQuQvSc/BNAYnkl6E8ivYtEHJXa1dihE3zgnKMdNgN8DiIwgA17NykUMvFDQ+LALvXXI BuBLAHv/DvBmc/0HzR03PqXmLcQAAAAASUVORK5CYII= User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17039 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17039 I can't remember whether Kim Storm implemented something like this or not. Jorgen Schaefer sent me the following patch to simple.el. What do you think? I think it makes sense. Having keymap properties yanked has bothered me on several occasions. The patch is small, should I apply it? I don't think we need papers for it. Alex. A little patch to allow me to do (setq yank-remove-text-properties '(read-only nil keymap nil local-map nil)) to get rid of all those pasted buttons :) Might even be a more sensible default. Greetings, -- Jorgen P.S. You might want to change the :version in the defcustom. --- simple.el.old 2003-10-11 15:31:16.000000000 +0200 +++ simple.el 2003-10-11 15:33:36.000000000 +0200 @@ -1881,6 +1881,12 @@ ;; Yanking. +(defcustom yank-remove-text-properties '(read-only nil) + "*Which text properties to remove on a `yank'." + :group 'killing + :type 'plist + :version "21.3") + (defun yank-pop (arg) "Replace just-yanked stretch of killed text with a different stretch. This command is allowed only immediately after a `yank' or a `yank-pop'. @@ -1905,7 +1911,7 @@ (let ((opoint (point))) (insert (current-kill arg)) (let ((inhibit-read-only t)) - (remove-text-properties opoint (point) '(read-only nil)))) + (remove-text-properties opoint (point) yank-remove-text-properties))) (if before ;; This is like exchange-point-and-mark, but doesn't activate the mark. ;; It is cleaner to avoid activation, even though the command @@ -1933,7 +1939,7 @@ ((eq arg '-) -1) (t (1- arg))))) (let ((inhibit-read-only t)) - (remove-text-properties opoint (point) '(read-only nil)))) + (remove-text-properties opoint (point) yank-remove-text-properties))) (if (consp arg) ;; This is like exchange-point-and-mark, but doesn't activate the mark. ;; It is cleaner to avoid activation, even though the command