M-; does not respect comment-padding

Bug #595613 reported by Nicholas Riley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nXhtml
Fix Committed
Medium
Unassigned

Bug Description

When I press M-; in nXHTML, it inserts <!---->. I have comment-padding set to " " or 1, which should insert <!-- -->.

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

Thanks for reporting this Nicholas, but I believe this is a bug in Emacs.

Can you test this in a fresh Emacs without nXhtml. Just start with

  emacs -Q

If the problem is there too then please report it as an Emacs bug. Tell me which it were so we can fix it here if I am wrong.

Changed in nxhtml:
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Nicholas Riley (njriley) wrote :

Comment-padding works for other modes. For example, if I run emacs -Q and evaluate:

(setq comment-padding "blah")

then press M-; below it, I get ";;blah". (I am using Emacs 23.2 but this worked fine on earlier versions too.)

If this is not what you mean, please let me know...

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

Ah, thanks, but a little misunderstanding. I meant you should use the same file as you did before, but without nXhtml.

However I should explain a bit more in detail.

It looked to me like you were editing a html file. You can edit those files in Emacs without nXhtml (which I guess you know). There are two main major modes in Emacs itself for it, html-mode and nxml-mode (the latter for xhtml only).

Can you please try (without nXhtml) these two modes with your file? You can switch major mode by doing something like

   M-x html-mode

Revision history for this message
Nicholas Riley (njriley) wrote :

Both nxml-mode and html-mode obey comment-padding, though slightly differently. nXML defaults to no spacing (like nXhtml); nXHTML seems to replace the first character of comment-padding with a space. So, for example:

(setq comment-padding "xy")

<!-- yy --> - html-mode

<!--xyxy--> - nxml-mode

It seems to be only nXhtml-mode that inserts <!----> regardless.

Revision history for this message
Nicholas Riley (njriley) wrote :

(and by nXHTML I mean html-mode. Sorry, too many acronyms...)

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

Thanks Nicholas,

Testing with the latest beta of nXhtml I think this works as it should.

I have sent a bug report for html-mode.

Changed in nxhtml:
status: Incomplete → Fix Committed
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.