Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!pasteur!ucbvax!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hp-pcd!uoregon!omepd!mipos3!nate From: nate@mipos3.intel.com (Nate Hess) Newsgroups: comp.emacs Subject: Re: delete file/process in server.el Message-ID: <2123@mipos3.intel.com> Date: 28 Apr 88 01:17:10 GMT References: <2112@mipos3.intel.com> Reply-To: nate@mipos3.intel.com (Nate Hess) Distribution: na Organization: Intel Corporation, Santa Clara, CA Lines: 40 Summary: It's now fixed 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)) [ Israel gives the documentation string for condition-case, noting that the first argument is supposed to be a variable. (I think there is a bug in the documentation, since VAR is never mentioned again after (condition-case VAR BODYFORM HANDLERS...)) He gives a fix which substitutes i for (). He then continues...] >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? Yes, I believe that there is a better function: file-exists-p, which does the appropriate lispy thing. So, the code I wrote to replace the last line from above is: (if (file-exists-p "~/.emacs_server") (delete-file "~/.emacs_server")) or, if you're using the code Israel posted earlier to get around the problem of .emacs_server being in the home directory: (if (file-exists-p (concat "/tmp/.emacs_server_" (user-real-login))) (delete-file (concat "/tmp/.emacs_server_" (user-real-login)))) At your serverice, --woodstock -- "How did you get your mind to tilt like your hat?" ...!{decwrl|hplabs!oliveb|pur-ee|qantel|amd}!intelca!mipos3!nate : nate@mipos3.intel.com ATT : (408) 765-4309