From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Gordon Beaton Newsgroups: gmane.emacs.help Subject: passing data to process sentinel Date: 15 Sep 2006 11:17:32 GMT Organization: - Message-ID: <450a8bcc$0$19463$8404b019@news.wineasy.se> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1158320549 18894 80.91.229.2 (15 Sep 2006 11:42:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Sep 2006 11:42:29 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 15 13:42:27 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GOC5P-00053g-BB for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Sep 2006 13:42:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GOC5O-0000Xz-VD for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Sep 2006 07:42:22 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.swip.net!swipnet!newsfeed1.funet.fi!newsfeeds.funet.fi!uio.no!fi.sn.net!newsfeed1.fi.sn.net!news.song.fi!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: slrn/0.9.7.4 (Linux) Original-Lines: 37 Original-NNTP-Posting-Host: cube.smaltan.org Original-X-Trace: 1158319052 news.wineasy.se 19463 195.42.215.17:64246 Original-X-Complaints-To: abuse@tdcsong.se Original-Xref: shelby.stanford.edu gnu.emacs.help:141763 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37385 Archived-At: I run tkdiff from emacs to compare the current buffer contents with the corresponding saved file. tkdiff needs two filenames, so I start by storing the buffer contents to a temporary file created by make-temp-file. I'd like to be able to pass the name of the temporary file to a process sentinel so it can be cleaned up after tkdiff exits, for example by attaching the filename to the process object itself where it can be retrieved in the sentinel. To me this seems more elegant than storing the filename elsewhere and looking it up. One solution I'd like to see is something like this, but of course neither set-process-sentinel nor the sentinel itself take the additional argument: (set-process-sentinel (start-process "tkdiff" nil "tkdiff" (buffer-file-name) temp-file) 'my-sentinel temp-file) (defun my-sentinel (process event mydata) (if (file-exists-p mydata) (delete-file mydata))) I was hoping that something like the following might work, but temp-file doesn't seem to get bound in the lambda function: (set-process-sentinel (start-process "tkdiff" nil "tkdiff" (buffer-file-name) temp-file) (lambda (process event) (if (file-exists-p temp-file) (delete-file temp-file)))) Suggestions? /gordon -- [ don't email me support questions or followups ] g o r d o n + n e w s @ b a l d e r 1 3 . s e