From: Jim H. <hun...@al...> - 2001-05-15 12:58:33
|
Jim> When I load a .jsp page using mmm, everything works correctly Jim> except that it appears my c-offsets-alist is forgotten. >What emacsen are you running? In Emacs 20, c-offsets-alist is not >a local variable at all, but a global one, so adding it to >mmm-save-local-variables can't be expected to work--although I >don't know if the specific breakage would be what you're >experiencing. I'm running Emacs 20.7.1 on Windows 2000 and also Emacs 20.7.1 on Linux. The behavior is the same in both. Using M-x describe-variable on c-offsets-alist all over the place seems to say that it doesn't exist as a variable until I open something in CC Mode, then it exists in all buffers. Whether the first CC Mode file is a .jsp file or not doesn't affect anything. I'm just speculating here (I don't know anything about how modes work), but it seems that when you open the first file, CC Mode is entered, and all of its variables are instantiated. When it's entered normally, the c-mode-common-hook is called. In my case, this hook modifies the c-offsets-alist global variable. When a new CC Mode file is opened, either Emacs recognizes that CC Mode has been used before and avoids reinitializing the variables and calling the hook, or it does both again. When MMM starts CC Mode, the problem is either that Emacs doesn't recognize this as a brand new instance of CC Mode (avoiding CC Mode's startup code that calls the hook), or it reinitializes the CC Mode variables and somehow forgets the binding of the hook to my-hook. Is there any way I can debug this stuff to identify the problem? I went through most of the emacs lisp tutorial a few weeks ago, but some tips might help. --- Jim |