[Ilugc] Emacs question

  • From: linux@xxxxxxxxxxxxxxxx (Suresh Ramasubramanian)
  • Date: Tue Aug 3 11:25:44 2004

Vamsee Kanakala wrote:

Hi Luggers,

   If there are any Emacs fans out here, I have a doubt: How do you 
force a file to be syntax-highlighted? Suppose, I'm setting up my jsp 
files to be loaded in sgml-mode like this:

(setq auto-mode-alist
     (append '(("\.jsp$"  . sgml-mode))
               auto-mode-alist))

try this -

;;jsp/html multi-mode
(autoload 'multi-mode
   "multi-mode"
   "Allowing multiple major modes in a buffer."
   t)

(defun jsp-mode () (interactive)
   (multi-mode 1
              'html-helper-mode
              '("<%" java-mode)
              '("%>" html-helper-mode)))

(setq auto-mode-alist
       (cons '("\\.jsp$" . jsp-mode)
            auto-mode-alist))
;
(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
(setq auto-mode-alist (cons '("\\.s?html?\\'" . html-helper-mode)
                            auto-mode-alist))
(add-hook 'html-helper-load-hook
     (function (lambda ()
                (require 'html-font)
                (require 'browse-url)
                (setq tempo-interactive t)))
     )
(require 'htmlize)                ;make HTML out of buffer
;(load "tables")

Other related posts: