From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: henry atting Newsgroups: gmane.emacs.help Subject: Re: delete frame automatically Date: Sun, 10 Apr 2011 10:46:37 +0200 Organization: LiteraturLateNight Message-ID: <87bp0eh4sy.fsf@online.de> References: <8762qn9396.fsf@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1302428443 7993 80.91.229.12 (10 Apr 2011 09:40:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 10 Apr 2011 09:40:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 10 11:40:39 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8r8H-0001Ds-2p for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Apr 2011 11:40:37 +0200 Original-Received: from localhost ([127.0.0.1]:50794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8r8F-0002x3-NC for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Apr 2011 05:40:35 -0400 Original-Path: usenet.stanford.edu!newsserver.news.garr.it!kanaga.switch.ch!news-zh.switch.ch!switch.ch!news.belwue.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: dslb-178-008-037-001.pools.arcor-ip.net Original-X-Trace: online.de 1302425171 28584 178.8.37.1 (10 Apr 2011 08:46:11 GMT) Original-X-Complaints-To: abuse@einsundeins.com Original-NNTP-Posting-Date: Sun, 10 Apr 2011 08:46:11 +0000 (UTC) User-Agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:fPPvrm7zkwZz6S4TeYa6lInwnUc= Original-Xref: usenet.stanford.edu gnu.emacs.help:186650 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:80760 Archived-At: José A. Romero L. writes: > On Apr 9, 11:35, henry atting wrote: > (...) >> How can I bring it about that the frame is deleted automatically when >> I close ansi-term/tmux? As far a I know the > (...) > > Write some advice around the term-sentinel function. Something like > this should do the trick: > > (defadvice term-sentinel (around my-advice-term-sentinel (proc > msg)) > (if (memq (process-status proc) '(signal exit)) > (let ((buffer (process-buffer proc)) ) > ad-do-it > (kill-buffer buffer) > (delete-frame)) > ad-do-it)) > (ad-activate 'term-sentinel) Great, thanks. This works perfectly for term but not for multi-term. In multi-term.el is a function (multi-term-handle-close) which closes the current buffer when closing multi-term. Additionally to the above lines I had to change it to take care of the current frame. Cheers, henry -- http://literaturlatenight.de