emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying preserves font-lock-face


From: Kevin Rodgers
Subject: Re: Copying preserves font-lock-face
Date: Mon, 25 Sep 2006 16:32:45 -0600
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]