all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Syntax highlighting fails on copy-paste
@ 2011-05-13 12:27 Deniz Dogan
  2011-05-13 21:31 ` Alp Aker
  0 siblings, 1 reply; 3+ messages in thread
From: Deniz Dogan @ 2011-05-13 12:27 UTC (permalink / raw)
  To: help-gnu-emacs

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



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

end of thread, other threads:[~2011-05-14  8:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13 12:27 Syntax highlighting fails on copy-paste Deniz Dogan
2011-05-13 21:31 ` Alp Aker
2011-05-14  8:21   ` Deniz Dogan

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.