2010-11-22 83 views

回答

4

nXhtml支持經典的ASP JavaScript,經常更新並且不是很麻煩。它比當前版本的Visual Studio IMO有更好的ASP支持(調試除外);必要時我只是使用VS2010進行服務器端調試。

這裏是我的.emacs相關章節:

(load "autostart" t) 
(eval-after-load "mumamo-fun" 
    '(define-mumamo-multi-major-mode asp-html-mumamo-mode 
    "Turn on multiple major modes for ASP with main mode `nxhtml-mode'. 
This also covers inlined style and JavaScript." 
    ("ASP Html Family" nxhtml-mode 
     (mumamo-chunk-asp% 
     mumamo-asp-chunk-inlined-script 
     mumamo-chunk-inlined-script 
     mumamo-chunk-style= 
     mumamo-chunk-onjs= 
     )))) 
(add-to-list 'auto-mode-alist '("\\.inc$" . asp-html-mumamo-mode)) 

; XXX this is a total hack, see: 
; http://www.mail-archive.com/[email protected]/msg00197.html 
(defun tab-width-4() 
    (setq tab-width 4)) 
(add-hook 'mumamo-after-change-major-mode-hook 'tab-width-4 t) 

更新:對於nXhtml有更新版本,您可能需要更改mumamo-asp-chunk-inlined-scriptmumamo-chunk-asp-server-script

(最後一位是必要的,因爲ASP代碼我工作的假設4維空間中的標籤;隨意忽略它,如果這不是你的問題)

如果您的ASP除了.asp.inc之外的任何其他結尾,您需要進一步編輯auto-mode-alist

0

自2.0版本web-mode.el(可在http://web-mode.org上獲得)與ASPX兼容。這種主要模式也與JSP和PHP兼容。

相關問題