From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: running mm-destroy-parts when (mm-display-part handle) returns inline Date: Fri, 12 Nov 2004 03:09:30 +0900 (JST) Message-ID: <20041112.030930.112599232.jet@gyve.org> References: <20041027.141808.202854715.jet@gyve.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1100196792 11990 80.91.229.6 (11 Nov 2004 18:13:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 Nov 2004 18:13:12 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 11 19:12:59 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CSJRK-0005oZ-00 for ; Thu, 11 Nov 2004 19:12:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CSJZq-0004Uo-0N for ged-emacs-devel@m.gmane.org; Thu, 11 Nov 2004 13:21:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CSJZh-0004Uh-4P for emacs-devel@gnu.org; Thu, 11 Nov 2004 13:21:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CSJZg-0004UO-LD for emacs-devel@gnu.org; Thu, 11 Nov 2004 13:21:36 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CSJZg-0004UG-GH for emacs-devel@gnu.org; Thu, 11 Nov 2004 13:21:36 -0500 Original-Received: from [210.130.136.40] (helo=r-maa.spacetown.ne.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CSJQz-0004lD-OV; Thu, 11 Nov 2004 13:12:38 -0500 Original-Received: from localhost (h219-110-075-244.catv01.itscom.jp [219.110.75.244]) by r-maa.spacetown.ne.jp (8.11.6) with ESMTP id iABICW120331; Fri, 12 Nov 2004 03:12:35 +0900 (JST) Original-To: wmperry@gnu.org In-Reply-To: <20041027.141808.202854715.jet@gyve.org> X-Mailer: Mew version 4.0.62 on Emacs 21.3.50 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29756 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29756 Dear Sir, I'm trying url-mm-callback in the url package with emacs-w3m web browser. When (mm-display-part handle) returns inline, follwoing code sequence are executed: (display-buffer (current-buffer)) (mm-destroy-parts handle) As the result, the user see nothing. The inline handler renders the result on the (current-buffer). The rendering result is destroyed by (mm-destroy-parts handle). I don't know whether this is the special case of emacs-w3m or not. However, the attached patch will fix my problem. I think the impact of this patch is small; and the patch helps all inline handlers which manages rendered items on the (current-buffer). BTW, is there any document about the url package? Regards, Masatake YAMATO 2004-11-12 Masatake YAMATO * url.el (url-mm-callback): Call `mm-destroy-parts' when the buffer is killed. Index: lisp/url/url.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/url/url.el,v retrieving revision 1.6 diff -u -r1.6 url.el --- lisp/url/url.el 16 Oct 2004 15:02:46 -0000 1.6 +++ lisp/url/url.el 11 Nov 2004 18:05:40 -0000 @@ -207,7 +207,10 @@ (message "Viewing externally") (kill-buffer (current-buffer))) (display-buffer (current-buffer)) - (mm-destroy-parts handle))))) + (add-hook 'kill-buffer-hook + `(lambda () (mm-destroy-parts ',handle)) + nil + t))))) (defun url-mm-url (url) "Retrieve URL and pass to the appropriate viewing application."