From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Copying preserves font-lock-face Date: Sat, 23 Sep 2006 18:12:16 +0200 Message-ID: <45155CE0.6040200@gmx.at> 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 1159028137 14407 80.91.229.2 (23 Sep 2006 16:15:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 23 Sep 2006 16:15:37 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 23 18:15:36 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 1GRAAB-0002VX-Uq for ged-emacs-devel@m.gmane.org; Sat, 23 Sep 2006 18:15:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GRAAB-0003cM-95 for ged-emacs-devel@m.gmane.org; Sat, 23 Sep 2006 12:15:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GRA8e-0002KU-CA for emacs-devel@gnu.org; Sat, 23 Sep 2006 12:14:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GRA8c-0002Ie-Jr for emacs-devel@gnu.org; Sat, 23 Sep 2006 12:13:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GRA8c-0002IX-98 for emacs-devel@gnu.org; Sat, 23 Sep 2006 12:13:58 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1GRACb-0001Zn-Mz for emacs-devel@gnu.org; Sat, 23 Sep 2006 12:18:06 -0400 Original-Received: (qmail invoked by alias); 23 Sep 2006 16:13:56 -0000 Original-Received: from N898P010.adsl.highway.telekom.at (EHLO [62.47.56.42]) [62.47.56.42] by mail.gmx.net (mp036) with SMTP; 23 Sep 2006 18:13:56 +0200 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: Nick Roberts In-Reply-To: <17684.33575.513181.276604@kahikatea.snap.net.nz> X-Y-GMX-Trusted: 0 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:60139 Archived-At: > If I copy text with a face into a fontified buffer it gets a face according > to it's context e.g a word in a comment in c-mode to a keyword location > (face goes from font-lock-comment-face to font-lock-keyword-face) > > 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. Does this happen with emacs -Q too? (defun font-lock-default-unfontify-region (beg end) (remove-list-of-text-properties beg end (append font-lock-extra-managed-props (if font-lock-syntactic-keywords '(syntax-table face font-lock-multiline) '(face font-lock-multiline))))) removes _all_ face properties. Hence, either the properties you mention are not face properties or something goes wrong with fontification after a buffer change. > Is there a reason why font-lock-face should be preserved on copying? In some rare cases, I find it useful to see remnants of faces assigned by font-lock when I copy a stretch of code to a plain text buffer. Hence, in principle, preserving such face properties does not seem wrong. I do think, however, that, copying the `fontified' property by default can be confusing. Hence, I'd prefer something like (defcustom yank-excluded-properties '(read-only invisible intangible field mouse-face help-echo local-map keymap yank-handler follow-link fontified)