From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Re: Question about copy-region-as-kill Date: Sat, 06 Apr 2002 13:38:39 -0700 Sender: emacs-devel-admin@gnu.org Message-ID: <87k7rkmuk0.fsf@alice.dynodns.net> References: <87ofh09xjq.fsf@alice.dynodns.net> <200204050602.g3562Dl18586@aztec.santafe.edu> <87bscx7rlf.fsf@alice.dynodns.net> <200204061732.g36HWSb19584@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1018125808 23409 127.0.0.1 (6 Apr 2002 20:43:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 6 Apr 2002 20:43:28 +0000 (UTC) Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16tx20-00065S-00 for ; Sat, 06 Apr 2002 22:43:28 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16txFc-0007Dc-00 for ; Sat, 06 Apr 2002 22:57:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16tx0g-0007oJ-00; Sat, 06 Apr 2002 15:42:06 -0500 Original-Received: from mail.gci-net.com ([216.183.68.100] helo=gci-net.com) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16twxl-0007hg-00 for ; Sat, 06 Apr 2002 15:39:05 -0500 Original-Received: from [216.183.69.157] (HELO aris) by gci-net.com (CommuniGate Pro SMTP 3.5b8) with ESMTP id 457241 for emacs-devel@gnu.org; Sat, 06 Apr 2002 13:25:03 -0700 Original-Received: from johnw by aris with local (Exim 3.35 #1 (Debian)) id 16twxL-0003cn-00 for ; Sat, 06 Apr 2002 13:38:39 -0700 Original-To: emacs-devel@gnu.org X-Home-Page: http://www.gci-net.com/users/j/johnw/ X-Public-Key: http://pgp5.ai.mit.edu:11371/pks/lookup?op=get&search=0xF40524D0 In-Reply-To: <200204061732.g36HWSb19584@aztec.santafe.edu> (Richard Stallman's message of "Sat, 6 Apr 2002 10:32:28 -0700 (MST)") Original-Lines: 41 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2426 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2426 >>>>> On Sat Apr 6, RMS writes: > Text properties are part of the text. Aside from special cases > there is no reason not to copy them. Yet there DO exist reasons to avoid doing so, which at present force people to resort to overlays. I think there is sufficient evidence to show that not copying text properties in certain buffers is a good thing. We're talking about such a small change here (see below). I can't believe there is a valid philosophical reason to _deny_ such configurability, forcing an entirely different paradigm (overlays) just to avoid the copy. And whether these are stripped at kill or yank, I don't care. I just don't want read-only copied around when I kill text from Eshell, and then yank it into an e-mail message! John ---------------------------------------------------------------------- (defvar copy-properties-on-kill t) (make-variable-buffer-local 'copy-properties-on-kill)) (defun copy-region-as-kill (beg end) "Save the region as if killed, but don't kill it. In Transient Mark mode, deactivate the mark. If `interprogram-cut-function' is non-nil, also save the text for a window system cut and paste." (interactive "r") (let ((str (if copy-properties-on-kill (buffer-substring beg end) (buffer-substring-no-properties beg end)))) (if (eq last-command 'kill-region) (kill-append str (< end beg)) (kill-new str))) (if transient-mark-mode (setq deactivate-mark t)) nil)