From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Leach Newsgroups: gmane.emacs.help Subject: Re: have emacs use SIGTERM to end a process instead of SIGHUP Date: Fri, 12 Jul 2013 12:01:02 +0100 Message-ID: <51DFE1EE.2000805@johnleach.co.uk> References: <51DB3A43.4090909@johnleach.co.uk> <87txk4c55k.fsf@thinkpad.tsdh.de> (sfid-20130709_120354_508407_88128E2B) NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1373626893 23350 80.91.229.3 (12 Jul 2013 11:01:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Jul 2013 11:01:33 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 12 13:01:34 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Uxb6R-0005fp-Fx for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Jul 2013 13:01:31 +0200 Original-Received: from localhost ([::1]:33726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxb6R-0001hH-6E for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Jul 2013 07:01:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxb65-0001fz-Gt for help-gnu-emacs@gnu.org; Fri, 12 Jul 2013 07:01:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uxb60-0003pv-Bc for help-gnu-emacs@gnu.org; Fri, 12 Jul 2013 07:01:09 -0400 Original-Received: from mycogen.trantor.org.uk ([109.107.38.252]:59889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxb60-0003o0-6c for help-gnu-emacs@gnu.org; Fri, 12 Jul 2013 07:01:04 -0400 Original-Received: from [192.168.88.5] (cpc7-brad19-2-0-cust107.barn.cable.virginmedia.com [77.97.184.108]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mycogen.trantor.org.uk (Postfix) with ESMTPSA id 330BE63B78 for ; Fri, 12 Jul 2013 11:01:02 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 In-Reply-To: <87txk4c55k.fsf@thinkpad.tsdh.de> (sfid-20130709_120354_508407_88128E2B) X-Enigmail-Version: 1.5.1 OpenPGP: id=5C06D153 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 109.107.38.252 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92077 Archived-At: On 09/07/13 13:02, Tassilo Horn wrote: > John Leach writes: > > Hi John, > >> I'm starting a process using start-process-shell-command, but the >> command I'm running doesn't exit when it receives a SIGHUP (it reloads >> it's configs or something) so I end up with orphaned processes hanging >> around when I close the buffer or exit emacs. > > I guess you could add a function to `kill-buffer-hook' that calls > `delete-process' on the process. thanks Tassilo. I'm trying to do this but failing. So I think I need a kill-buffer-hook that can get the process of the current buffer, check if it looks like the process I know needs a SIGTERM, and then send it one. I'm wondering if I can set some kind of attribute on the buffer when I create the process, so I can easily recognise it at kill time? Rather than looking at the command line or something. I'm lost with even the basic syntax to do any of this though. Could you help? Thanks, John.