From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baoqiu Cui Subject: Re: Wow -- adding images to an org file Date: Tue, 11 May 2010 22:39:44 -0700 Message-ID: References: <3950.1273620034@iinet.net.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=34846 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OC4fu-0006gc-6q for emacs-orgmode@gnu.org; Wed, 12 May 2010 01:40:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OC4ft-0002fW-1w for emacs-orgmode@gnu.org; Wed, 12 May 2010 01:40:06 -0400 Received: from lo.gmane.org ([80.91.229.12]:40071) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OC4fs-0002fF-Mg for emacs-orgmode@gnu.org; Wed, 12 May 2010 01:40:05 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OC4fr-0001Td-JI for emacs-orgmode@gnu.org; Wed, 12 May 2010 07:40:03 +0200 Received: from nat-dip6.cfw-a-gci.corp.yahoo.com ([209.131.62.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 May 2010 07:40:03 +0200 Received: from cbaoqiu by nat-dip6.cfw-a-gci.corp.yahoo.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 May 2010 07:40:03 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= "robut@iinet.net.au" writes: > I very much like the idea of native inline image display in Org-mode but can't > seem to make it work. > > Given a 6.36 snapshot or 6.36 release and these org file contents > > * Test image > Test image > [[Screenshot.png]] > > > I hoped org would display that image after C-c C-x C-v. Rather Org-mode returns > "No images to display inline". > > I've tried different ways of linking that image, different image formats, > relative vs complete paths, and my regular .emacs vs a near empty one and > always the same result. If I toggle iimage-mode the image displays fine per se > but does not affect how Org-mode works. > > Seems clear I am missing something simple. What? I like the idea of inline image display too, but hit the similar problems. After reading the code in org.el, I found that the inline image file link has to start with either "file:" or "./". For example, the following two links are OK: [[file:~/images/myImage.png]] [[./figures/org-mode-unicorn.svg]] but the following two are not: [[Screenshot.png]] [[~/images/myImage.png]] Here is a small patch that seems to work well for me, but I'd like Carsten to check whether it may break anything: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=inline-images.diff diff --git a/lisp/org.el b/lisp/org.el index 0381a26..5efc162 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15502,7 +15502,7 @@ with a description part will be inlined." (interactive "P") (org-remove-inline-images) (goto-char (point-min)) - (let ((re (concat "\\[\\[\\(file:\\|\\./\\)\\(~?" "[-+./_0-9a-zA-Z]+" + (let ((re (concat "\\[\\[\\(file:\\)?\\(~?" "[-+./_0-9a-zA-Z]+" (substring (org-image-file-name-regexp) 0 -2) "\\)\\]" (if include-linked "" "\\]"))) file ov) --=-=-= Regards, -- Baoqiu --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--