MMM-mode 사용시 버그가 있습니다. 저는 php-mode 와 혼용시 발생했는데요. 일본분이 픽스해주셨는데. 성함까지는 기억이 안나는군요. 웹브라우저를 실수로 꺼버려서.. 

mmm-mode-0.4.8/mmm-utils.el 을 열어서 

(defun mmm-format-string (string arg-pairs)
  "Format STRING by replacing arguments as specified by ARG-PAIRS.
Each element of ARG-PAIRS is \(REGEXP . STR) where each STR is to be
substituted for the corresponding REGEXP wherever it matches."
  (let ((case-fold-search nil))
    (save-match-data
      (dolist (pair arg-pairs)
        (while (string-match (car pair) string)
;;          (setq string (replace-match (cdr pair) t t string))))))
 (setq string (replace-match (format-mode-line (cdr pair)) t t string))))))
  string)



다음 부분을 찾아서 위와 똑같이 처리해 주면 됩니다. 기존 코드   

(setq string (replace-match (cdr pair) t t string))))))



에 주석처리를 해주고 

 (setq string (replace-match (format-mode-line (cdr pair)) t t string))))))

 
이 부분을 대신 넣어줍니다.


 
Emacs 로 PHP 프로그래밍을 하다 보면 일반적인 통합 GUI 에서 제공하는 php 파일에서 HTML 태그에 관한 기능이 부러울 때가 있습니다. 


이러한 사진처럼 말이죠. 이것은 php 파일을 열었을 때 보이는 것인데요. 쉽게 말해서 php-mode 와 html-mode 가 섞여 있는 것입니다. 

이것을 가능하게 해 주는 것이 MMM-mode 라는 것입니다. 그리고 PHP-mode 도 받아서 설치해 줍니다. 

설정하는 방법이 그리 쉽지는 않았는데요. 간단하게 정리해서 올립니다. 

php-mode.el (위에서 링크한 곳에서 받아서 압축을 풀면 나오는 파일 입니다) 은 ~/.emacs.d 에 설치해 줬습니다. 그리고 mmm-mode-0.4.8 또한 ~/.emacs.d 에 설치해 줬습니다. 

.emacs 파일에 다음과 같이 설정해 주면 됩니다. 

(setq load-path (cons (expand-file-name "~/.emacs.d/") load-path))
(require 'php-mode)

(add-to-list 'load-path (expand-file-name "~/.emacs.d/mmm-mode-0.4.8"))
(require 'mmm-mode)

(setq mmm-global-mode 'maybe)
(mmm-add-mode-ext-class nil "\\.php3?\\'" 'html-php)
(mmm-add-classes
 '((html-php
    :submode php-mode
    :front "<\\?\\(php\\)?"
    :back "\\?>")))
(autoload 'php-mode "php-mode" "PHP editing mode" t)
(add-to-list 'auto-mode-alist '("\\.php3?\\'" . html-mode))




+ Recent posts