首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Emacs php-mode:删除php文件头行中重复的<?php

Emacs php-mode:删除php文件头行中重复的<?php
EN

Stack Overflow用户
提问于 2010-01-13 22:04:56
回答 1查看 378关注 0票数 2

我使用emacs php-mode.el和php-electric.el。我想去掉显示在任何<?php文件顶部的重复的php覆盖。

额外的<?php实际上并不在文件中,而是emacs添加的一个半透明的可视覆盖。我做了一些研究,我认为改变这一点可能涉及到emacs lisp header-line-format变量。但我在php-mode中找不到它。

也找不到任何关于人们删除额外<?php的帖子。谢谢你的帮助!

EN

回答 1

Stack Overflow用户

发布于 2010-01-14 05:29:23

我想通了。在我的.emacs中添加(header-line-format 0)到我的php-mode钩子中就可以解决这个问题。所以综合起来看起来是这样的:

代码语言:javascript
复制
(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)
             ))
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2057141

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档