
(setq load-path (append (list (car load-path)) '("~/dlisp/imported-stuff/") (cdr load-path)))

(require 'multi-mode)

(set (make-local-variable 'hack-local-variables-hook) #'multi-mode-install-modes)

(setq multi-chunk-fns '(my-check-php))

(defun my-check-php ()
  (setq beg (re-search-backward "<\\?php" nil t))
  (setq end (re-search-backward "\\?>" nil t))
  (cond
   ((and beg (not end))
    (list 'php-mode
          beg
          (or (re-search-forward "\\?>" nil t)
              (point-max))
          ))
   ((and beg end (> beg end))
    (list 'php-mode
          beg
          (or (re-search-forward "\\?>" nil t)
              (point-max))))
   ((and beg end (<= beg end))
    (list nil
          beg
          end))
   ) ;; END COND!
  )




