if($true)
__{
__}
elseif($false)
{
}
else
___{
___}
I immediately downloaded that new mode file and installed it, later added several tunings:
(add-hook 'php-mode-hook
'(lambda () (define-abbrev php-mode-abbrev-table "ex" "extends")))
Now, time to try it!! Very lucky, that bug has now disappeared! See this screnshot:
// also, I add "print_r"to the constant php-keywords in php-mode.el to make it appears just the same as "echo":
(defconst php-keywords
(eval-when-compile
(regexp-opt
;; "class", "new" and "extends" get special treatment
;; "case" and "default" get special treatment elsewhere
'("and" "as" "break" "continue" "declare" "do" "echo" "else" "elseif"
"endfor" "endforeach" "endif" "endswitch" "endwhile" "exit"
"extends" "for" "foreach" "global" "if" "include" "include_once"
"next" "or" "print_r" "require" "require_once" "return" "static" "switch"
"then" "var" "while" "xor" "private" "throw" "catch" "try"
"instanceof" "catch all" "finally")))
"PHP keywords.")
没有评论:
发表评论