all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

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.