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

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

Why would a minor mode work in all modes but java-mode?


From: Chris Seberino
Subject: Why would a minor mode work in all modes but java-mode?
Date: Fri, 27 Mar 2009 20:47:24 -0700 (PDT)
User-agent: G2/1.0

I made a simple minor mode below that highlights TABs and chars beyond
column 79.

Why would it work (seemingly) everywhere except java-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)


reply via email to

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