Berndl, Klaus writes: > ;; Enable support for automatic project switching. > ;; This feature loads the appropriate project settings whenever > ;; a user switches from a Java buffer belonging to one project > ;; 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. > (add-hook 'post-command-hook > 'jde-detect-java-buffer-activation nil t) > > > This is the code from `jde-mode' (JDEE 2.3.4beta3). > > This works well when switch from a jde-buffer to another jde-buffer. But what is > when switching from > a buffer not in jde-mode to a jde-buffer?? There are people programming with more > than one language ;-) This should work even if the "from" buffer is not a jde-mode buffer. Are you saying that it doesn't? > > Why not add this hook to the global value of post-command-hook? Ok, this woold need > some > modifications in `jde-detect-java-buffer-activation' but would this not be sensful? Then the hook function would run in buffers that are not jde-mode buffers? This seemed a waste of processing cycles to me when I wrote the code. > > Or have we to use jde-mode hook for switches from a not-jde-buffer to a jde-buffer? > Then this should be > made clearer in the docs or even better: Then the doc needs a description which > jde-hooks are running > at what time! I will try to make the doc clearer on these issues. > > Is the hook jde-entering-java-buffer-hook only designed for switching between two > jde-buffers and not > for switching from any-buffer to a jde-buffer?? The documentation says nothing > about this? > jde-entering-java-buffer-hook functions are supposed to run whenever the user activates a jde-mode buffer, regardless of the mode of the previously active buffer. As far as I know, it works correctly and that is easily verifiable. Are you saying that the hook functions are not being run when a jde-mode buffer is entered from a buffer that is operating in a different mode? Paul > Klaus > > > Klaus Berndl mailto: <mailto:[EMAIL PROTECTED]> [EMAIL > PROTECTED] > sd&m AG <http://www.sdm.de/> http://www.sdm.de > software design & management > Carl-Wery-Str. 42, 81739 Muenchen, Germany > Tel +49 89 63812-392, Fax -220 > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> > <HTML><HEAD> > <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> > <TITLE>Nachricht</TITLE> > > <META content="MSHTML 6.00.2737.800" name=GENERATOR></HEAD> > <BODY> > <DIV><FONT face=Arial size=2> ;; > Enable support for automatic project > switching.<BR> ;; This feature loads > the appropriate project settings > whenever<BR> ;; a user switches from a > Java buffer belonging to one > project<BR> ;; to a buffer belonging > to another.<BR> (make-local-hook > 'post-command-hook)<BR> (add-hook > 'post-command-hook<BR> > > 'jde-detect-java-buffer-activation nil t)<BR></FONT></DIV> > <DIV><FONT face=Arial size=2></FONT> </DIV> > <DIV><FONT face=Arial size=2><SPAN class=971042312-01062004>This is the code > from `jde-mode' (JDEE 2.3.4beta3).</SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN > class=971042312-01062004></SPAN></FONT> </DIV> > <DIV><FONT face=Arial size=2><SPAN class=971042312-01062004>This works well when > switch from a jde-buffer to another jde-buffer. But what is when switching from > </SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN class=971042312-01062004>a buffer not in > jde-mode to a jde-buffer?? There are people programming with more than one > language ;-)</SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN > class=971042312-01062004></SPAN></FONT> </DIV> > <DIV><FONT face=Arial size=2><SPAN class=971042312-01062004>Why not add this > hook to the global value of post-command-hook? Ok, this woold need > some</SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN class=971042312-01062004>modifications in > `jde-detect-java-buffer-activation' but would this not be > sensful?</SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN > class=971042312-01062004></SPAN></FONT> </DIV> > <DIV><FONT face=Arial size=2><SPAN class=971042312-01062004>Or have we to use > jde-mode hook for switches from a not-jde-buffer to a jde-buffer? Then this > should be</SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN class=971042312-01062004>made clearer in the > docs or even better: Then the doc needs a description which jde-hooks are > running</SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN class=971042312-01062004>at what > time!</SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN > class=971042312-01062004></SPAN></FONT> </DIV> > <DIV><FONT face=Arial size=2><SPAN class=971042312-01062004>Is the hook > jde-entering-java-buffer-hook only designed for switching between two > jde-buffers and not</SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN class=971042312-01062004>for switching from > any-buffer to a jde-buffer?? The documentation says nothing about this? > </SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN > class=971042312-01062004></SPAN></FONT> </DIV> > <DIV><FONT face=Arial size=2><SPAN > class=971042312-01062004>Klaus</SPAN></FONT></DIV> > <DIV><FONT face=Arial size=2><SPAN > class=971042312-01062004></SPAN></FONT> </DIV> > <DIV><FONT face=Arial size=2></FONT> </DIV> > <DIV align=left><FONT face=Arial size=2>Klaus > Berndl > > mailto: </FONT><A href="mailto:[EMAIL PROTECTED]"><FONT face=Arial > size=2>[EMAIL PROTECTED]</FONT></A><BR><FONT face=Arial size=2>sd&m > AG > > </FONT><A href="http://www.sdm.de/"><FONT face=Arial > size=2>http://www.sdm.de</FONT></A><BR><FONT face="Courier New"><FONT face=Arial > size=2>software design & management</FONT></FONT></DIV> > <DIV align=left><FONT face="Courier New"><FONT face=Arial size=2><FONT > size=2>Carl-Wery-Str. 42, 81739 Muenchen, Germany</FONT></FONT></FONT></DIV> > <DIV align=left><FONT face="Courier New"><FONT face=Arial size=2><FONT > size=2>Tel +49 89 63812-392, Fax -220</DIV></FONT></FONT></FONT> > <DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>
