unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* define-generic-mode multiline regexp for highlighting not work if edit highlighted text.
@ 2011-09-04 19:50 Oleksandr Gavenko
  0 siblings, 0 replies; only message in thread
From: Oleksandr Gavenko @ 2011-09-04 19:50 UTC (permalink / raw)
  To: help-gnu-emacs

dict -c5 source file format:

FILE is formatted with headwords preceded by 5 or more underscore
characters (_) and a blank line.

I write:

(define-generic-mode
   'dict-c5-mode
   nil
   nil
   '(
     ("^\\(_____+\\)

\\([^[:blank:]].*\\)$" (1 font-lock-function-name-face) (2 
font-lock-keyword-face))
     )
   '("\\.c5$" "\\.dict-c5$")
   nil
   nil
   )

If open file or M-x revert-buffer then all highlighted correctly.

If I edit highlighted text (add underscores to 'first 5' or chars to
'headword' or delete chars from 'headword') highlighting disappier.

-- 
Best regards!




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-04 19:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-04 19:50 define-generic-mode multiline regexp for highlighting not work if edit highlighted text Oleksandr Gavenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).