From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to display an image contained in a file? Date: Tue, 01 Mar 2016 21:04:48 +0200 Message-ID: <838u226mun.fsf@gnu.org> References: <87twkqvya3.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1456859126 11707 80.91.229.3 (1 Mar 2016 19:05:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2016 19:05:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 01 20:05:21 2016 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 1aapbk-0006Z6-HG for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Mar 2016 20:05:20 +0100 Original-Received: from localhost ([::1]:51808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aapbj-0003CH-Nf for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Mar 2016 14:05:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aapbS-00036t-CV for help-gnu-emacs@gnu.org; Tue, 01 Mar 2016 14:05:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aapbO-0000ZX-7U for help-gnu-emacs@gnu.org; Tue, 01 Mar 2016 14:05:02 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aapbO-0000ZS-4O for help-gnu-emacs@gnu.org; Tue, 01 Mar 2016 14:04:58 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2398 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aapbN-0004R7-9o for help-gnu-emacs@gnu.org; Tue, 01 Mar 2016 14:04:57 -0500 In-reply-to: <87twkqvya3.fsf@mbork.pl> (message from Marcin Borkowski on Tue, 01 Mar 2016 19:38:44 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:109379 Archived-At: > From: Marcin Borkowski > Date: Tue, 01 Mar 2016 19:38:44 +0100 > > I have an image in the file, say "~/image.png". I want to display it in > an interactive function - say, the user says M-x display-my-image, and > I want a buffer containing the image to pop up. What do I do? Of > course, (find-file "~/image.png") works, but it's probably not what > I should do in an Elisp program, right? (let ((image (create-image "~/image.png"))) (pop-to-buffer "*image*") (insert-image image))