默认情况下,mumamo alt php标记模式
我昨天刚开始玩emacs,我正在做一个项目。无论如何,我已经开始在web开发工作中使用NXHTMLMumamo,并且一切正常,除了HTML属性包含的内容是这样写的默认情况下,mumamo alt php标记模式,php,html,emacs,Php,Html,Emacs,我昨天刚开始玩emacs,我正在做一个项目。无论如何,我已经开始在web开发工作中使用NXHTMLMumamo,并且一切正常,除了HTML属性包含的内容是这样写的 <element attribute="<?= _ID ?>"></element> 类似这样的东西: (add-hook 'nxhtml-mumamo-mode-hook (lambda () (mumamo-alt-php-tags-mode 1))) (add-hook 'nxhtml-m
<element attribute="<?= _ID ?>"></element>
类似这样的东西:
(add-hook 'nxhtml-mumamo-mode-hook (lambda () (mumamo-alt-php-tags-mode 1)))
(add-hook 'nxhtml-mumamo-mode-hook 'enable-alt-tags-in-certain-files)
(defun enable-alt-tags-in-certain-files ()
"enable mumamo-alt-php-tags-mode in .php and .html files"
(when (string-match "\\.php$\\|\\.html\\$" (buffer-file-name))
(mumamo-alt-php-tags-mode 1)))
这将导致nxhtml-mumamo模式下的所有缓冲区也处于mumamo-alt-php-tags模式下
,如果您想将其限制为.html
和.php
缓冲区,您可以添加一些更复杂的内容,如:
(add-hook 'nxhtml-mumamo-mode-hook (lambda () (mumamo-alt-php-tags-mode 1)))
(add-hook 'nxhtml-mumamo-mode-hook 'enable-alt-tags-in-certain-files)
(defun enable-alt-tags-in-certain-files ()
"enable mumamo-alt-php-tags-mode in .php and .html files"
(when (string-match "\\.php$\\|\\.html\\$" (buffer-file-name))
(mumamo-alt-php-tags-mode 1)))
太好了,谢谢。我现在要用第一个,因为它正是我想要的,但是谢谢扩展版本。如果可以的话,我会提高投票率,但我还是个新手。即使没有提高投票率的最低声誉,你也可以接受你所问问题的答案。