all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Unwanted highlighting after cross-buffer paste
@ 2008-12-24 17:46 kj
  2008-12-25  3:18 ` Joe Casadonte
  2008-12-25  4:13 ` Andreas Politz
  0 siblings, 2 replies; 6+ messages in thread
From: kj @ 2008-12-24 17:46 UTC (permalink / raw)
  To: help-gnu-emacs



When I do a cross-buffer cut-and-paste from a buffer with syntax
highlighting to one that doesn't have any highlighting I find that
the highlighting from the source buffer is preserved, which I don't
want.

I have not been able to find a way to get rid of this "imported"
highlighting, other than killing the buffer and revisiting the
file, which is pretty annoying.  E.g. "M-x fundamental-mode" won't
do it.

Is there a simpler way of getting rid of this unwanted highlighting
(or of avoiding it in the first place)?

TIA!

Kynn
-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Unwanted highlighting after cross-buffer paste
  2008-12-24 17:46 Unwanted highlighting after cross-buffer paste kj
@ 2008-12-25  3:18 ` Joe Casadonte
  2008-12-25  4:24   ` Samuel Wales
  2008-12-25 18:03   ` Barry Margolin
  2008-12-25  4:13 ` Andreas Politz
  1 sibling, 2 replies; 6+ messages in thread
From: Joe Casadonte @ 2008-12-25  3:18 UTC (permalink / raw)
  To: help-gnu-emacs

On 24 Dec 2008, kj wrote:

> Is there a simpler way of getting rid of this unwanted highlighting

`font-lock-fontify-buffer' should re-fontify the whole buffer,
stripping out the unneeded bits.

> (or of avoiding it in the first place)?

Take a look at what it is that's killing the text in the first place;
if it's `copy-region-as-kill', you may want to re-write it to use
buffer-string-no-properties instead of buffer-string (or use some
around advice that temporarily fsets buffer-string to be
buffer-string-no-properties, but I'm not sure how to un-fset it).

--
Regards,


joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
    Ramblings of a Gay Man => http://www.northbound-train.com/ramblings
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Unwanted highlighting after cross-buffer paste
  2008-12-24 17:46 Unwanted highlighting after cross-buffer paste kj
  2008-12-25  3:18 ` Joe Casadonte
@ 2008-12-25  4:13 ` Andreas Politz
  2009-01-04 16:37   ` kj
  1 sibling, 1 reply; 6+ messages in thread
From: Andreas Politz @ 2008-12-25  4:13 UTC (permalink / raw)
  To: help-gnu-emacs

kj wrote:
> When I do a cross-buffer cut-and-paste from a buffer with syntax
> highlighting to one that doesn't have any highlighting I find that
> the highlighting from the source buffer is preserved, which I don't
> want.
> 
> I have not been able to find a way to get rid of this "imported"
> highlighting, other than killing the buffer and revisiting the
> file, which is pretty annoying.  E.g. "M-x fundamental-mode" won't
> do it.
> 
> Is there a simpler way of getting rid of this unwanted highlighting
> (or of avoiding it in the first place)?
> 

(add-to-list 'yank-excluded-properties 'face)

-ap
> TIA!
> 
> Kynn


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Unwanted highlighting after cross-buffer paste
  2008-12-25  3:18 ` Joe Casadonte
@ 2008-12-25  4:24   ` Samuel Wales
  2008-12-25 18:03   ` Barry Margolin
  1 sibling, 0 replies; 6+ messages in thread
From: Samuel Wales @ 2008-12-25  4:24 UTC (permalink / raw)
  To: Joe Casadonte; +Cc: help-gnu-emacs

On Wed, Dec 24, 2008 at 20:18, Joe Casadonte
<jcasadonte@northbound-train.com> wrote:
> ... I'm not sure how to un-fset it).

flet?

-- 
Myalgic encephalomyelitis denialists are knowingly causing further
suffering and death by opposing biomedical research on this serious
infectious disease.  Do you care about the world?
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Unwanted highlighting after cross-buffer paste
  2008-12-25  3:18 ` Joe Casadonte
  2008-12-25  4:24   ` Samuel Wales
@ 2008-12-25 18:03   ` Barry Margolin
  1 sibling, 0 replies; 6+ messages in thread
From: Barry Margolin @ 2008-12-25 18:03 UTC (permalink / raw)
  To: help-gnu-emacs

In article <ur63xrlgo.fsf@terrapin.northbound-train.com>,
 "Joe Casadonte" <jcasadonte@northbound-train.com> wrote:

> On 24 Dec 2008, kj wrote:
> 
> > Is there a simpler way of getting rid of this unwanted highlighting
> 
> `font-lock-fontify-buffer' should re-fontify the whole buffer,
> stripping out the unneeded bits.
> 
> > (or of avoiding it in the first place)?
> 
> Take a look at what it is that's killing the text in the first place;
> if it's `copy-region-as-kill', you may want to re-write it to use
> buffer-string-no-properties instead of buffer-string (or use some
> around advice that temporarily fsets buffer-string to be
> buffer-string-no-properties, but I'm not sure how to un-fset it).

It sounded like he's just using C-w or M-w, not a command of his own.

I also find it annoying.  I frequently like to cut and paste from 
*Occurs* or *grep* buffers, and the attributes are out of place in the 
new buffer.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Unwanted highlighting after cross-buffer paste
  2008-12-25  4:13 ` Andreas Politz
@ 2009-01-04 16:37   ` kj
  0 siblings, 0 replies; 6+ messages in thread
From: kj @ 2009-01-04 16:37 UTC (permalink / raw)
  To: help-gnu-emacs

In <1230178467.934601@arno.fh-trier.de> Andreas Politz <politza@fh-trier.de> writes:

>(add-to-list 'yank-excluded-properties 'face)

Thanks, that did the trick perfectly.

Kynn
-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-01-04 16:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-24 17:46 Unwanted highlighting after cross-buffer paste kj
2008-12-25  3:18 ` Joe Casadonte
2008-12-25  4:24   ` Samuel Wales
2008-12-25 18:03   ` Barry Margolin
2008-12-25  4:13 ` Andreas Politz
2009-01-04 16:37   ` kj

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.