Open GoogleCodeExporter opened 9 years ago
[deleted comment]
well, a not so nice hook can be used to fix the indentation, though the
syntactic
type of the first line after "<?PHP" or "<?php" is still `topmost-intro-cont'.
The
hook code is below:
(defun php-mode-fix-first-line-syntactic ()
(interactive)
(save-excursion
(let ((paren-state (c-parse-state)))
(c-beginning-of-statement-1 (c-safe-position (point) paren-state))
(if (>= (- (point) 2) 1)
(let ((header-tag (buffer-substring-no-properties (- (point) 2)
(+ (point) 3))))
(message header-tag)
(if (or (string-equal header-tag "<?php")
(string-equal header-tag "<?PHP"))
(progn
(c-add-syntax 'topmost-intro (c-point 'boi))
(forward-char 4)
(indent-line-to 0)
)
))))))
(add-hook 'c-special-indent-hook 'php-mode-fix-first-line-syntactic)
Original comment by sen.zh...@gmail.com
on 9 Nov 2008 at 10:34
Original issue reported on code.google.com by
sen.zh...@gmail.com
on 2 Nov 2008 at 3:54