1

working with nxhtml-mode in emacs, I get problems since a few weeks. While working emacs pauses unexpectingly until showing a message in the mode line "!MEM FULL!"; obviously nxhtml-mode is filling up the memory until emacs stopps to work. I am working with html, php and css files.

I have no idea how I could debug this problem in a meaningfull way. Also I seem to be the only one to have this problem, because googling did not deliver any answers to this question.

I am using emacs 2.32 on an Linux Mint 11 system. I can not find out the verson of nxhtml, it says revision 829 downloaded from http://bazaar.launchpad.net/~nxhtml/nxhtml/main/revision/829.

I set up a test scenario with a minimal dot-emacs just to test the nxhtml-mode. It seemed to be alright, but it does not reflect my productive set up. It would probably take a week or so to gradually include everything I used to use within emacs (e.g. org-mode) while testing whether nxhtml-mode does not like anything, which is called in my dot-emacs file.

Is there another way? Can I find out, what causes the memory overload? Does anyone has similar problems using nxhtml-mode?

Greetings Martin

mbutz
  • 11
  • 2
  • Sorry, this was a typo, emacs version: GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4) – mbutz Jun 28 '12 at 15:25
  • 1
    Without more information, I don't know how much help you will find here. If you can consistently reproduce the problem, and post the necessary set up details for others to produce the same problem, you might get better suggestions. – Tyler Jun 28 '12 at 15:50
  • Tyler, thanks for the repley. Yes, I know, the information I provided is rather poor. The problem is, that I do not know, how to get more of it. The only thing I notice is, that working about one or two hours with emacs in nxhtml-mode, suddenly the problems show up. I am not able to trace it to a specific edit command, nor to reproduce the memory overflow on purpose. I was hoping that at least someone could give a hint, what I could do to gather more valid information. Anyway, thanks. Martin – mbutz Jun 28 '12 at 18:11
  • It seems to have something to do with the nxml-validation. Emacs seemingly tries to validate and gets slower and slower (mode line indicates e.g. 80% validated); after a while the memory is full. – mbutz Jun 29 '12 at 11:45
  • Can anybody give me a hint, how valilidation within the nxml-mode works and what I could look for, to solve the problem? I can reproduce the memory overflow by editing an xhtml-file and using the automatic indentation (which, as I understand, triggers the validation). Emacs seems to be able to do this a few times but after a while gets slower and slower until there is no memory left. – mbutz Jul 03 '12 at 06:48
  • Okay. Maybe this is still not enough information, but testing showed the following results: Emacs hangs more or less reproducable after a few minutes using nxhtml-mode during the following actions: (1) Using the command "Move by Tag > forward balanced tag" and deleting a portion of code (2) "Mark region > search for string (3) several editing actions involving "Move by tag"-commands; last message in minibuffer"Using scheme: /usr/share/emacs/23.2/etc/schema/xhtml.rnc". So far. As xhtml-mode is really great, I would hate to use Geany or any other editor instead of emacs. – mbutz Jul 03 '12 at 12:44

1 Answers1

1

I got the same problem with emacs 23.3. Recently I switched to a version 24.1 hoping the problem will dissapear. Hélas.

So I switched to the sgml-mode

(add-to-list 'auto-mode-alist (cons (concat "\\." (regexp-opt '("xml" "xsd" "xslt" "xsl" "html" "htm" "wsdl" "xml.template" "xhtml" "jsp") t) "\\'") 'sgml-mode))


(add-hook 'sgml-mode-hook
          '(lambda ()
             (sgml-electric-tag-pair-mode)))

Actuall, you can disable the xml validation:

(setq rng-nxml-auto-validate-flag nil)

I did it after your questions and comments and I don't have problems since.

Oleg Pavliv
  • 20,462
  • 7
  • 59
  • 75
  • Hi Oleg, I am kind of lucky for your reply. At least I know, I am not the only one. I began to find nxhtml-mode realy nice, but this way it is near to unusable. Thanks a lot for the sgml tip. Maybe I will also switch. – mbutz Jul 16 '12 at 18:50
  • @mbutz You can disable validation if you don't need it. – Oleg Pavliv Oct 01 '12 at 09:29