Hi Paul, I replied too hastily earlier. On starting up a new emacs process, switching buffers as you describe results in loading the correct prj.el file.
However, after a while I can get myself into a situation where some of my jde buffers do not have jde-detect-java-buffer-activation in their post-command-hook. Its value is (ecb-layout-post-command-hook ecb-handle-major-mode-visibilty). So switching from *any* buffer to this jde buffer does not load the project file. I don't have a reproducible set of commands I can perform to get into this state yet, but the customizations I have for jde-entering-buffer-hook and ecb-source-path-functions are the likely suspects. The documentation for post-command-hook says that if an unhandled error occurs while running one of the hooks, its value is set to nil. I shall investigate this further. Sorry for the false alarm. I have noticed this behavior of the project file not being loaded correctly before sporadically, usually when killing buffers or when trying to load all the buffers in recentf-list, and jumped to the conclusion that it was because post-command-hook was buffer-local. Suraj On Wed, 2 Jun 2004 23:40:13 -0400, Paul Kinnucan <[EMAIL PROTECTED]> wrote: > > > Suraj Acharya writes: > > On Wed, 2 Jun 2004 09:29:22 +0200 , Berndl, Klaus <[EMAIL PROTECTED]> wrote: > > > > > > >> ;; to a buffer belonging to another. > > > >> (make-local-hook 'post-command-hook) > > > > > > >Hmm, I don't think I need the above form because the add-hook form below > > > >makes the variable local anyway. > > > > > > Indeed. > > > > > > > > (add-hook 'post-command-hook > > > > > 'jde-detect-java-buffer-activation nil t) > > > > > > > > > > > > > > > This is the code from `jde-mode' (JDEE 2.3.4beta3). > > > >This should work even if the "from" buffer is not a jde-mode buffer. Are > > > >you saying that it doesn't? > > > > > > Yes, i'm saying this - and it can not work in other modes: > > > This add-hook is called when `jde-mode' is called which is only called when a > buffer X is opened which is "linked" to jde-mode. And because you add the function > LOCALLY to post-command-hook only the local value (local in buffer X) contains this > function - the global value of post-command-hook doesn't. Therefore this works only > in jde-buffers - which is suboptimal IMHO ;-) > > > > > > I can confirm this. Moving from a java file in one project to a .el > > file and then to a > > java file in another project does not result in the loading of the new > > project's settings file. > > > > It does on my system. I opened up four frames: > > Frame 1: Project A > Frame 2: Project B > Frame 3: jde.el > Frame 4: *Messages* buffer (to monitor project load messages). > > Frame Movements Result > ------------------------------------------------ > > 1->2 Project B reloaded. > 2->3->1 Project A reloaded. > 1->3 No change. > 3->2 Project B reloaded. > > etc. > > I am at a loss to explain why the project switching does > not work correctly on your system. > > I am using JDEE 2.3.4beta5 with Emacs 21.3.1 on Windows > Millenium. > > Paul > >
