;;************************************************************ ;; configure HTML editing ;;************************************************************ ;; (require 'php-mode) ;; ;; configure css-mode (autoload 'css-mode "css-mode") (add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode)) (setq cssm-indent-function #'cssm-c-style-indenter) (setq cssm-indent-level '2) ;; (add-hook 'php-mode-user-hook 'turn-on-font-lock) ;; (require 'mmm-mode) (setq mmm-global-mode 'maybe) ;; ;; set up an mmm group for fancy html editing (mmm-add-group 'fancy-html '( (html-php-tagged :submode php-mode :face mmm-code-submode-face :front "<[?]php" :back "[?]>") (html-css-attribute :submode css-mode :face mmm-declaration-submode-face :front "style=\"" :back "\""))) ;; ;; What files to invoke the new html-mode for? (add-to-list 'auto-mode-alist '("\\.inc\\'" . html-mode)) (add-to-list 'auto-mode-alist '("\\.phtml\\'" . html-mode)) (add-to-list 'auto-mode-alist '("\\.php[34]?\\'" . html-mode)) (add-to-list 'auto-mode-alist '("\\.[sj]?html?\\'" . html-mode)) (add-to-list 'auto-mode-alist '("\\.jsp\\'" . html-mode)) ;; ;; What features should be turned on in this html-mode? (add-to-list 'mmm-mode-ext-classes-alist '(html-mode nil html-js)) (add-to-list 'mmm-mode-ext-classes-alist '(html-mode nil embedded-css)) (add-to-list 'mmm-mode-ext-classes-alist '(html-mode nil fancy-html)) ;; ;; Not exactly related to editing HTML: enable editing help with mouse-3 in all sgml files (defun go-bind-markup-menu-to-mouse3 () (define-key sgml-mode-map [(down-mouse-3)] 'sgml-tags-menu)) ;; (add-hook 'sgml-mode-hook 'go-bind-markup-menu-to-mouse3)