emacs 설정 - php 코딩
글쓴이: esrevinu / 작성시간: 월, 2008/05/26 - 4:02오후
현재 php 코딩을 할 때 html 코드와 php 코드가 섞여 있어서
indentation에 문제가 있네요. (php-mode 사용)
아래와 같은 Warning이 발생하고
Warning (php-indent): Indentation fails badly with mixed HTML and PHP. Look for an Emacs Lisp library that supports "multiple major modes" like mumamo, mmm-mode or multi-mode.
mmm-mode 같은 거 써 봤는데도 잘 안 되네요.
mumamo인가 하는 것은 nxhtml-mode를 받으라고 되어 있는데
받을 수가 없어서...
mmm-mode 관련 설정은 다음과 같습니다.
(require 'mmm-mode) (setq mmm-global-mode 'maybe) ;;;; Different Background Coloring for javascript and php in mmm-mode (setq mmm-submode-decoration-level '2) (mmm-add-mode-ext-class nil "\\.php?\\'" 'html-php) (mmm-add-classes '( (html-php :submode php-mode :face mmm-code-submode-face :front "<\\?\\(php\\)?" :back "\\?>" ) (html-js :submode javascript-generic-mode :face mmm-declaration-submode-face ;:front "<script language=\"javascript\"" :front "<script " :back "</script>" ) (html-css :submode css-mode :face mmm-cleanup-submode-face :front "<style " :back "</style>" ) (html-css-inline :submode css-mode :face mmm-cleanup-submode-face :front "style=\"" :back "\"" ) ) ) (autoload 'php-mode "php-mode" "PHP editing mode" t) (add-to-list 'auto-mode-alist '("\\.php?\\'" . php-mode))
마지막 줄에는 sgml-html-mode로 되어
있었는데 잘 안 되어서 php-mode, html-mode, html-helper-mode 등으로 바꿔
봤는데 indentation과 syntax highlighting에 문제가 있네요.
nxml-mode로 하면 한글이 깨져 나오는 문제가 있습니다.
Forums:
댓글 달기