help-gnu-emacs
[Top][All Lists]
Advanced

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

Syntax highlighting fails on copy-paste


From: Deniz Dogan
Subject: Syntax highlighting fails on copy-paste
Date: Fri, 13 May 2011 14:27:37 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

I've started writing my first "real" major mode, which I call guitar-mode. The code in its entirety can be viewed here: http://paste.lisp.org/display/121977

This is how I have implemented some basic syntax highlighting for chords (@L78):

(defvar guitar-font-lock-keywords
  '((guitar-chord-matcher . ((1 'guitar-note-face)
                             (2 'guitar-chord-variation-face))))
  "Font lock keywords for guitar-mode.")

This works pretty well when _writing_ in a guitar-mode buffer but when I paste something from e.g. the web browser, not everything gets syntax highlighted until I edit the content around the chords. The chords/lyrics I've tested this with are these: http://tabs.ultimate-guitar.com/r/red_hot_chili_peppers/under_the_bridge_crd.htm

So to summarize: when I copy-paste those chords/lyrics into a buffer with guitar-mode, not everything gets syntax highlighted until I edit the content around the chords.

Why is this?

Thanks,
Deniz Dogan



reply via email to

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