linum with nxhtml can't work properly

Bug #618635 reported by Lost shen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nXhtml
Invalid
Medium
Unassigned

Bug Description

when i opened a php&html mixed file, i will get this message
"Toggling linum-mode off; better pass an explicit argument."
but linum works well in this time, and when i move cursor to php chunk, line-number disappear and get the warning
again, continue move the cursor, line number will appear and when move out php chunk, it will disappear again.
how can i deal with it ?

GNU Emacs 23.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.29)

Revision history for this message
Lost shen (jayklx) wrote :

i fond after i disable the font-lock-mode,
it wont happen again.hope this would be helpful.

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

Thanks Lost shen,

This is an Emacs bug. I have just filed an Emacs bug report for it:

 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6871

Changed in nxhtml:
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Lost shen (jayklx) wrote :

I commented this line in linum.el
 (add-hook 'change-major-mode-hook 'linum-delete-overlays nil t)
it works good now.
will it bring me any side-effect?

Revision history for this message
Lost shen (jayklx) wrote :

I try to use mmm-mode for a test, linum works well with it ,so, i think its not a linum bug, mumamo-mode would be have something conflict with linum-mode.

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

It sounds very strange that this bug does not show up in mmm-mode. Does it really handle major mode dependent minor modes at all then?

Revision history for this message
Lost shen (jayklx) wrote :

yah,its strange, although mmm-mode works with some bugs(indent and font-lock incorrectly etc) but it really change major mode when move between different chunks,and linum just work well.
i think there's not only one hook make linum update lineumber, because,after i comment out
 (add-hook 'change-major-mode-hook 'linum-delete-overlays nil t)
it also make a little change with linenumber,it display wrong line number first time to enter a different chunk, and works well after that.
you can test it with:
1.comment out the line above;
2.turn on global-linum-mode;
3.edit a mixed file ,like php+html,
and move the cursor form html chunk to php chunk, you'll see what happend.
my English is not well, hope you can understand what i mean :)

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

Lost shen,

If you look at the Emacs bug report that I sent (see above) you can find a patch for linum.el there that fixes the problem. A version of this will be applied to Emacs (when I have time to fix it).

Revision history for this message
Lost shen (jayklx) wrote :

thanks for your job.
but, i tried to apply the patch by Lennart Borgman,
it not work, Lennart Borgman post two patches,but neither seem to work properly.
if you give it a try, you'll know whats wrong.
anyway, thanks for your patient to deal with this bug, and give us such an amazing nxhtml.
i'll still wait for a solution.
this bug is not such important, but for a perfect emacs. you need'nt take much time of it if you
are busy.

Revision history for this message
Lost shen (jayklx) wrote :

hha, seems Lennart Borgman is you...
sorry for my mistake..

Revision history for this message
Lost shen (jayklx) wrote :

use your patch (the full one) and add this to .emacs

(add-hook 'find-file-hook (lambda () (linum-mode 1)))

its seems perfect now~

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

This is fixed in my patched version of Emacs+EmacsW32, but the patch is not applied to Emacs yet. So this is not a bug in nXhtml. Closing.

Changed in nxhtml:
status: In Progress → Invalid
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.