tekai / geben-on-emacs

Automatically exported from code.google.com/p/geben-on-emacs
GNU Lesser General Public License v2.1
0 stars 0 forks source link

GEBEN with nXhtml : "Buffer is read only" #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install GEBEN + Xdebug + nXhtml
2. Open Emacs, and start GEBEN (M-x geben)
3. Start stepping through some code mixing PHP/HTML and starting with HTML 
code. For example : a blank line before the opening PHP tag '<?php'.
4. Pressing debugger keys such as 'o' (geben-step-over) or other control key

What is the expected output? What do you see instead?
Expected outcome would be to control the debugger. Instead, pressing control 
key seems to want to edit the buffer (which is read only, because it is under 
the debugger) and nothing happens. If we press any unbound key of `geben-mode', 
expected output would be: "The buffer is under debug mode. Want to open the 
original file? (y/N)". Instead, we got the mesage "Buffer is read only" in the 
minibuffer.

What version of the product are you using? On what operating system?
Using latest version (0.26), nxhtml 2.08-100425, and Emacs 23.2.1 on GNU/Linux. 
Also tried with latest GEBEN SVN revision (r121).

Please provide any additional information below.
It works if the script starts with the opening PHP tag, even if it contains 
also HTML further.

The same bug is reported in nxhtml launchpad :
http://bugs.launchpad.net/nxhtml/+bug/600601

Original issue reported on code.google.com by mbruneel@gmail.com on 15 Aug 2010 at 1:44

Attachments:

GoogleCodeExporter commented 8 years ago
This workaround should help- I had your same problem and it worked for me
http://stackoverflow.com/questions/2880238/let-emacs-choose-mode-conditionally-w
hen-opening-files

#basically you put this in your .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)

Original comment by douglasw...@gmail.com on 23 Mar 2011 at 8:42

GoogleCodeExporter commented 8 years ago
Thanks, Douglas, that workaround worked beautifully for me.

Original comment by geo...@gmail.com on 2 May 2011 at 2:27