Path: utzoo!utgpu!water!watmath!clyde!rutgers!super.upenn.edu!grasp.cis.upenn.edu!shirono From: shirono@grasp.cis.upenn.edu (Roberto Shironoshita) Newsgroups: comp.emacs Subject: Re: stop-editing-hook? Message-ID: <3221@super.upenn.edu> Date: 31 Jan 88 20:28:00 GMT References: <8801271613.AA02607@RAVEN.LCS.MIT.EDU> Sender: news@super.upenn.edu Reply-To: shirono@grasp.cis.upenn.edu (Roberto Shironoshita) Organization: University of Pennsylvania Lines: 41 In article <8801271613.AA02607@RAVEN.LCS.MIT.EDU> bard@THEORY.LCS.MIT.EDU (Bard Bloom) writes: > Is there a hook which GNU emacs runs when a buffer is killed? No. kill-buffer is a primitive (i.e. written in C) defined in buffer.c, and does not include a run-hooks. > I am trying to write some functions which prevent more than one > person from editing a file at a given time. There are some > primitives (lock-buffer and friends), but it looks as if I have to > write some commands to manipulate them. I can set up the locks > without trouble, but I'd like to be able to take them off when the > person stops editing the file -- preferably without forcing the > person to leave emacs. I have just been browsing through buffer.c, and noticed that the DEFUN of kill-buffer has the following code: #ifdef CLASH_DETECTION /* Unlock this buffer's file, if it is locked. */ unlock_buffer (b); #endif /* CLASH_DETECTION */ So, since you mention you can lock files, I would presume kill-buffer is already doing what you want. Roberto Shironoshita ----------------------------------------------------------------------- Disclaimer 1: The opinions expressed here are my own. The University need not share them, or even be aware of them. Disclaimer 2: Like most humans, I'm bound to err at times. I believe what I have said, but agree that I may be wrong. @@@@@@@@@\ Full Name: Roberto Shironoshita @@ @@ Occupation: BSE candidate in Computer Science @@ @@ Organization: University of Pennsylvania @@@@@@@@/ @@ Network Address: @@ PENNnet: shirono@eniac.seas @@@@ Internet: shirono@eniac.seas.upenn.edu