tags:

views:

57

answers:

1

I use the php debugger geben and nxhtml-mode -- my standard mode for editing php files. Unfortunately, these two modes don't mix well. Is it possible to configure emacs such a way that it enables nxhtml only conditionaly, when I open php files manually, but enables php-mode instead when the buffer is opened by geben?

+1  A: 

Okay, I seem to have fixed it. Warning! I really don't know what I'm doing -- these are my first steps in lisp and I found it by trial and error. I've added this to the end of my .emacs file:

(require 'geben)
(defun geben-enter-php-mode ()
  (let* ((local-path (buffer-file-name))
     (session (and local-path (geben-source-find-session local-path))))
    (if session
        (let ((session nil))
          (php-mode)))))

(add-hook 'find-file-hook #'geben-enter-php-mode)
artistoex