Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!bionet!apple!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!HPLABS.HP.COM!paepcke%hplap From: paepcke%hplap@HPLABS.HP.COM (Andreas Paepcke) Newsgroups: gnu.emacs Subject: Buffer Switch Hook Message-ID: <8909292348.AA04613@hplap.HPL.HP.COM> Date: 29 Sep 89 23:48:50 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 23 I want a function of mine called whenever a GnuEmacs user enters a new buffer. I have been looking at the various available hooks, but can't find one that is suitable. The best would be a function *list*, so that I don't step on other people's toes. The functions would have to be called with the new buffer as an argument (or have some other way of finding the new buffer). Reason: I have developed a softkey facility that handles toggling softkeys. One such toggle is `buffer-read-only'. If a user pushes it, a little star appears in the softkey label and the buffer is made `read-only'. BUT when he switches to another buffer, I don't get a chance to update that label which at that time conveys incorrect information. I have come across several other cases where a switch-buffer-hook would be very important to have. Does anyone have a suggestion? Thanks, Andreas