From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: Copying preserves font-lock-face Date: Mon, 25 Sep 2006 16:32:45 -0600 Organization: IHS Message-ID: References: <17684.33575.513181.276604@kahikatea.snap.net.nz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1159223752 20461 80.91.229.2 (25 Sep 2006 22:35:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Sep 2006 22:35:52 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 26 00:35:50 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GRz2x-0008WD-4j for ged-emacs-devel@m.gmane.org; Tue, 26 Sep 2006 00:35:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GRz2w-0001tG-KL for ged-emacs-devel@m.gmane.org; Mon, 25 Sep 2006 18:35:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GRz1Q-0000TQ-O2 for emacs-devel@gnu.org; Mon, 25 Sep 2006 18:33:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GRz1P-0000Rw-37 for emacs-devel@gnu.org; Mon, 25 Sep 2006 18:33:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GRz1O-0000Rl-Nf for emacs-devel@gnu.org; Mon, 25 Sep 2006 18:33:54 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GRz5t-00063U-R0 for emacs-devel@gnu.org; Mon, 25 Sep 2006 18:38:34 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GRz1C-0008C2-2d for emacs-devel@gnu.org; Tue, 26 Sep 2006 00:33:42 +0200 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Sep 2006 00:33:42 +0200 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Sep 2006 00:33:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 24 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) In-Reply-To: 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:60219 Archived-At: Richard Stallman wrote: > If I copy text with a font-lock-face it keeps that property and doesn't acquire > the face appropriate to it's new location e.g text from the grep buffer with > font-lock-face `match' looks the same after being copied into a C file. I > realise that I can remove font-lock-face with facemenu-remove-all but I don't > see why I should need to. > > Is there a reason why font-lock-face should be preserved on copying? > > Perhaps it should be preserved when copying into a non-font-lock > buffer, but discarded when copying into a buffer with font-lock > enabled. On the topic of yanking fontified text into non-font-lock buffers, I became annoyed when any following keyed text would inherit those properties, so I put this in my .emacs file: (defadvice yank (after rear-nonsticky activate) "Make all yanked text properties rear-nonsticky, unless Font Lock is on." (unless font-lock-mode (put-text-property (region-beginning) (region-end) 'rear-nonsticky t))) -- Kevin