point moves left after opening paren

Bug #409358 reported by Jack Tanner
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nXhtml
Fix Released
Medium
Unassigned

Bug Description

In php-mode (but not in nxhtml-mumamo-mode), typing either an opening paren or // moves the point to the beginning of that line. This applies to PHP mode 1.5.0-nxhtml-1.88 of 2008-11-28-Fri, as shipped with nXhtml 1.93.

For example, visit foo.php, set php-mode, paste the code below, and type an opening paren after "= f".

<?php
$foo = f

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks Jack.

Hm, that probably makes it two bugs: one in php-mode and one in mumamo that avoids this bug ... ;-)

I think we had better start with the php-mode bug - which probably is quite complicated (that's probably why mumamo kills the bug ...). I have to call in Alan and Aaron I think.

Changed in nxhtml:
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
lborgman (lennart-borgman) wrote :

Alan has answered me, but he will not be able to look into this for at least several weeks.

As a work around just delete that key binding from php-mode-map. It surprises me that it is on by default in php-mode.

Revision history for this message
Jack Tanner (ihok) wrote :

Sorry for being dense, but which key binding is that?

Revision history for this message
lborgman (lennart-borgman) wrote :

I wish I were less dense - I don't understand how to turn off this. I asked on Emacs Devel since there seem to be some old left over info in the CC Mode manual.

You can however turn it off by changing the keymap c-mode-basemap where c-electric-paren is bound. (At least I believe so, I did not test right now.)

Keymaps can inherit from other keymaps. I think C-h b (which calls describe-bindings) should show helpful information in cases where bindings are inheritied.

Revision history for this message
plasma (plasmaball) wrote :

I second on this as I encountered the same problem today.

Then I did some tests. My .emacs had stripped down to nxhtml startup so no other external script was loaded. The problem consisted. Then I replace related/php-mode.el in nxhtml with the php-mode.el 1.50 downloaded from sf, and the problem went away.

Out of the procedures I did, I think the bug is introduced by nxhtml patch. I found a '(goto-char (line-beginning-position))', which looked very suspicious, in php-check-html-for-indentation, but comment the line out doesn't help. I am not an elisp expert, so there is nothing much I can do.

Hope the information is helpful to fix the bug. :)

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks, plasma.

That helped to solve the bug.

It was however not in that part you looked at. It was in the part where I corrected a problem in the original php-mode where it did not check for heredoc syntax, see line 355 in the function php-cautious-line-indent. (I forgot to go back to position "here".)

So this was introduced by me, an error in a bug fix.

Could you please test the latest beta 1.94 that I just uploaded?

Changed in nxhtml:
status: In Progress → Fix Committed
Revision history for this message
plasma (plasmaball) wrote :

Thanks Lennart. But could you tell me where I can download 1.94? I can't find it at nxhtml download page (http://ourcomments.org/cgi-bin/emacsw32-dl-latest.pl).

Revision history for this message
plasma (plasmaball) wrote :

I found it on http://ourcomments.org/Emacs/DL/elisp/nxhtml/beta/ . I've downloaded and tested, and it works. Thanks for quick response. :)

Jack Tanner (ihok)
Changed in nxhtml:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.