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

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

Minor mode doesn't work in java-mode....How fix?


From: cseberino
Subject: Minor mode doesn't work in java-mode....How fix?
Date: Fri, 27 Mar 2009 10:54:26 -0700 (PDT)
User-agent: G2/1.0

I created a simple minor mode that highlights TABs and characters
beyond column 79.
It works everwhere except java-mode.  Is there an easy way to fix
this?

Here is the baby minor mode...

(define-globalized-minor-mode global-warning79-mode
                              warning79-mode
                              (lambda ()(warning79-mode t)))
(define-minor-mode warning79-mode
      " " nil " W79" nil
      (if warning79-mode
             (font-lock-add-keywords    nil warning79-keyword)
             (font-lock-remove-keywords nil warning79-keyword))
      (font-lock-fontify-buffer))
(setq warning79-keyword '(("\t+"                0 'highlight)
                          ("^.\\{79\\}\\(.*\\)" 1 'highlight)))
(global-warning79-mode)

cs


reply via email to

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