2010-01-13 19 views
2

我使用emacs php-mode.el和php-electric.el。我想擺脫出現在任何php文件頂部的重複<?php疊加層。Emacs php-mode:在php文件的標題行中刪除重複的<?php

額外的<?php實際上並不在文件中,而是emacs添加的半透明可視覆蓋圖。我做了一些研究,我認爲改變這可能涉及到emacs lisp header-line-format變量。但是我無法在php模式下找到任何地方。

也找不到任何關於刪除額外<?php的人的文章。謝謝你的幫助!

回答

1

找出來。在我的.emacs中將(header-line-format 0)添加到我的php模式鉤子中就可以實現。所以一起看起來像:

(autoload 'php-mode "php-mode" "Major mode for editing php scripts." t) 
(setq auto-mode-alist (cons '(".php$" . php-mode) auto-mode-alist)) 
(require 'php-mode) 
(load-file "~/.emacs.d/emacs_includes/plugins/php-mode/php-electric.el") 
(add-hook 'php-mode-hook 
      '(lambda() 
      (define-abbrev php-mode-abbrev-table "ex" "extends") 
      (define-key php-mode-map '[M-S-up] 'flymake-goto-prev-error) 
      (define-key php-mode-map '[M-S-down] 'flymake-goto-next-error) 
      (require 'php-electric) 
      (php-electric-mode t) 
      (tabbar-local-mode 1) 
      (header-line-format 0) 
      (semantic-show-unmatched-syntax-mode 0) 
      ))