perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Chamas <>
Subject Re: emacs mode for ASP?
Date Sun, 17 Jun 2001 22:57:56 GMT
Philip Mak wrote:
> Does anyone have a good emacs mode file for editing Apache::ASP scripts
> with? One that takes into account things like perl code is inside <% %>,
> and individual <% %> sections in a document must be linked to each other
> when calculating proper indentation values, etc.
> -Philip Mak (

I have personally used html-mode & perl-mode and just switch
when I need to do heavy editing in one block or another.  
But how good to have both.  Well today we have it, because
I have put together a simple Apache::ASP subclass for mmm-mode
inspired by others using it for Emperl, Mason, JSP...

You can get mmm-mode here:

The subclass is a simple:

;; create asp-perl mmm-mode subclass 
(mmm-add-group 'asp-perl '((asp-perl-blocks
			    :submode perl-mode
			    :match-face (("<%" . mmm-code-submode-face)
					 ("<%=" . mmm-output-submode_face))
			    :front "<%=?"
			    :back "%>"

Below is the full config for Apache::ASP ...


;;; Apache::ASP mmm-mode config, by Joshua Chamas, 6/17/2001
(require 'mmm-auto)
(require 'mmm-compat)
(require 'mmm-vars)
(setq mmm-global-mode 'maybe)

; sets meta-p to reparse buffer in case the buffer does
; no update automatically while typing
(global-set-key "\M-p"  'mmm-parse-buffer)

;; create asp-perl mmm-mode subclass 
(mmm-add-group 'asp-perl '((asp-perl-blocks
			    :submode perl-mode
			    :match-face (("<%" . mmm-code-submode-face)
					 ("<%=" . mmm-output-submode_face))
			    :front "<%=?"
			    :back "%>"

; .asp, .htm, .inc files will be parsed with mmm-mode
(add-to-list 'mmm-mode-ext-classes-alist '(nil "\\.\\(asp\\|htm\\|inc\\)" asp-perl))
(add-hook 'mmm-major-mode-hook 'turn-on-auto-fill)

; turn off background color for code blocks, may set it if you like
(set-face-background 'mmm-default-submode-face nil)
;(set-face-background 'mmm-default-submode-face "gray")

; set major mode for these files to HTML mode, except global.asa which you 
; want to treat as a pure perl file
(setq auto-mode-alist (append '(
				("\\.pm$" . cperl-mode)
				("\\.asa$" . cperl-mode)
				("\\.inc$" . html-mode)
				("\\.htm" . html-mode)
				("\\.asp$" . html-mode)
				) auto-mode-alist))

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message