Path: utzoo!mnetor!uunet!tektronix!reed!trost From: trost@reed.UUCP (Trost [no first name]) Newsgroups: comp.emacs Subject: Re: delete file/process in server.el Message-ID: <9110@reed.UUCP> Date: 29 Apr 88 04:26:05 GMT References: <2112@mipos3.intel.com> Reply-To: trost@reed.UUCP (Trost [no first name]) Distribution: na Organization: Reed College, Portland OR Lines: 45 In article <2112@mipos3.intel.com> pinkas@cadev4.UUCP () writes: >In server.el, as distributed, the following code (in 18.48 and 18.50) >exists in start-server: > > ;; kill it dead! > (if server-process > (progn > (set-process-sentinel server-process nil) > (condition-case () (delete-process server-process) (error nil)))) > (condition-case () (delete-file "~/.emacs_server") (error nil)) > >As distributed, the server process exits when the server socket already >exists. condition-case is documented as follows: What? No it doesn't; it takes over, but read on... >My understanding is that the first argument to condition-case should be a >variable, which () isn't. When I replace the () with i in the delete-file >line, the server process does not die upon startup. > >Alternately, since nothing is being done when an a signal (error) occurs, >is there a better function to use? Something that will simplely ignore the >error resulting from the file not being existent? The () (usually seen as "nil") in the condition case probably tells emacs to not to bother with assigning the data to any variable. This is OK here because the data isn't used at all. As for leaving out the condition case, that is a bad thing. The (error nil) clause at the end tells emacs to ignore the error altogether; otherwise, if the bodyform within the command failed, it would stop right there with an error. Now, someone can tell me how to use "signal" correctly, right? I've played with it a bit, and it doesn't seem to do what's desired; it always complains about "peculiar errors". I've wanted to try my hand with programming using exceptions, and this seems like a good way to try it out. -- ...!(ogcvax|tektronix)!reed!trost (UUCP) When in danger, when in doubt, run in circles, scream and shout, gnash your teeth and cry and pout, when in danger, when in doubt.