From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: make new links show as figures? Date: Tue, 22 Oct 2013 21:53:31 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3946cc233ab04e95ec83d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYnde-0004SN-Ln for emacs-orgmode@gnu.org; Tue, 22 Oct 2013 21:53:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYndd-00048U-FA for emacs-orgmode@gnu.org; Tue, 22 Oct 2013 21:53:34 -0400 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]:59278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYndd-00045g-6c for emacs-orgmode@gnu.org; Tue, 22 Oct 2013 21:53:33 -0400 Received: by mail-pa0-f53.google.com with SMTP id kq14so338044pab.40 for ; Tue, 22 Oct 2013 18:53:31 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" --001a11c3946cc233ab04e95ec83d Content-Type: text/plain; charset=ISO-8859-1 Is it possible to define new links that would be rendered as inline images? I am imagining something like chemdraw:benzene.png which would show the benzene.png file inline, but when I click on it would open a chemdraw file for editing. John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu --001a11c3946cc233ab04e95ec83d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Is it possible to define new links that wou= ld be rendered as inline images?

I am imagining something like=

chemdraw:benzene.png

which would show the benze= ne.png file inline, but when I click on it would open a chemdraw file for e= diting.

John

--------------------= ---------------
John Kitchin
Associate Professor
Doherty Hall A207= F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

<= /div>
--001a11c3946cc233ab04e95ec83d-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: make new links show as figures? Date: Wed, 23 Oct 2013 09:54:40 -0400 Message-ID: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYyta-0000RB-SE for emacs-orgmode@gnu.org; Wed, 23 Oct 2013 09:54:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYytU-0007Wb-U5 for emacs-orgmode@gnu.org; Wed, 23 Oct 2013 09:54:46 -0400 Received: from [204.62.15.78] (port=40861 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYytU-0007WT-QI for emacs-orgmode@gnu.org; Wed, 23 Oct 2013 09:54:40 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Kitchin Cc: emacs-orgmode@gnu.org On 2013-10-22 21:53, John Kitchin wrote: > Is it possible to define new links that would be rendered as inline > images? > > I am imagining something like > > chemdraw:benzene.png > > which would show the benzene.png file inline, but when I click on it > would open a chemdraw file for editing. unfortunately, it seems that `org-display-inline-images' has a hardcoded regex which searches only for =file:= links. Wouldn't a better way be to define =chemdraw= as a babel language? ob-plantuml, ob-dot and ob-mscgen are all examples of babel languages which generate images. rick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: make new links show as figures? Date: Thu, 24 Oct 2013 09:28:34 +0200 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZFLa-0000pX-J2 for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 03:28:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZFLU-0007OY-S0 for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 03:28:46 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:44370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZFLU-0007OH-LJ for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 03:28:40 -0400 In-reply-to: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rick Frankel Cc: emacs-orgmode@gnu.org, John Kitchin Hi Rick and John, rick@rickster.com writes: > On 2013-10-22 21:53, John Kitchin wrote: >> Is it possible to define new links that would be rendered as inline >> images? >> >> I am imagining something like >> >> chemdraw:benzene.png >> >> which would show the benzene.png file inline, but when I click on it >> would open a chemdraw file for editing. > > unfortunately, it seems that `org-display-inline-images' has a > hardcoded regex which searches only for =file:= links. > > Wouldn't a better way be to define =chemdraw= as a babel language? > > ob-plantuml, ob-dot and ob-mscgen are all examples of babel languages > which generate images. This may be related to a question I had a couple weeks ago (see http://article.gmane.org/gmane.emacs.orgmode/77567). The current logic seems to be to display inline images when the link points to an image, it would be great to extend it when the description, or part of the link, points to an image. Alan From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: make new links show as figures? Date: Thu, 24 Oct 2013 12:08:59 +0200 Message-ID: <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZHqm-0002fB-6I for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 06:09:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZHqg-00064P-Qo for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 06:09:07 -0400 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:60549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZHqg-00064H-Jz for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 06:09:02 -0400 Received: by mail-wg0-f52.google.com with SMTP id f12so2091417wgh.7 for ; Thu, 24 Oct 2013 03:09:01 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: Rick Frankel , emacs-orgmode@gnu.org, John Kitchin On 24.10.2013, at 09:28, Alan Schmitt = wrote: > Hi Rick and John, >=20 > rick@rickster.com writes: >=20 >> On 2013-10-22 21:53, John Kitchin wrote: >>> Is it possible to define new links that would be rendered as inline=20= >>> images? >>>=20 >>> I am imagining something like >>>=20 >>> chemdraw:benzene.png >>>=20 >>> which would show the benzene.png file inline, but when I click on it >>> would open a chemdraw file for editing. >>=20 >> unfortunately, it seems that `org-display-inline-images' has a >> hardcoded regex which searches only for =3Dfile:=3D links. >>=20 >> Wouldn't a better way be to define =3Dchemdraw=3D as a babel = language? >>=20 >> ob-plantuml, ob-dot and ob-mscgen are all examples of babel languages >> which generate images. >=20 > This may be related to a question I had a couple weeks ago (see > http://article.gmane.org/gmane.emacs.orgmode/77567). The current logic > seems to be to display inline images when the link points to an image, > it would be great to extend it when the description, or part of the > link, points to an image. Indeed, currently this is not possible. I would be interested to get a = patch to this effect. - Carsten >=20 > Alan >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: make new links show as figures? Date: Thu, 24 Oct 2013 09:45:03 -0400 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLDp-0004Lt-9o for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 09:45:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZLDl-0003Xm-2O for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 09:45:09 -0400 Received: from [204.62.15.78] (port=34575 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLDk-0003OU-UZ for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 09:45:04 -0400 In-Reply-To: <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Alan Schmitt , emacs-orgmode@gnu.org, John Kitchin On 2013-10-24 06:08, Carsten Dominik wrote: > On 24.10.2013, at 09:28, Alan Schmitt > wrote: > > Hi Rick and John, > > rick@rickster.com writes: > > On 2013-10-22 21:53, John Kitchin wrote: > Is it possible to define new links that would be rendered as inline > images? > > I am imagining something like > > chemdraw:benzene.png > > which would show the benzene.png file inline, but when I click on it > would open a chemdraw file for editing. > > unfortunately, it seems that `org-display-inline-images' has a > hardcoded regex which searches only for =file:= links. > > This may be related to a question I had a couple weeks ago (see > http://article.gmane.org/gmane.emacs.orgmode/77567). The current logic > seems to be to display inline images when the link points to an image, > it would be great to extend it when the description, or part of the > link, points to an image. > > Indeed, currently this is not possible. I would be interested to get > a patch to this effect. Carsten- In terms of inlining images in the description portion per the linked posting, do you think that it should depended on the value if the =include-linked= argument? (IMHO no, since the default usage of `org-display-inline-images' doesn't set this argument). I would be glad to take a stab at this enhancement. John- In reviewing `org-display-inline-images', and the handling of org links in general, i see no safe (and not overly complex) way of making added link types expand inline images. In the case mentioned, i still feel that adding chemdraw as a babel language is the correct approach. However, if we add the expansion of images in the description, would that work: [[chemdraw:file.cdxml][file:file.png]] rick From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: make new links show as figures? Date: Thu, 24 Oct 2013 17:48:38 -0400 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1c372b07f7004e983988b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZSlm-0005Qw-Cn for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 17:48:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZSlk-00070f-L2 for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 17:48:42 -0400 Received: from mail-pb0-x235.google.com ([2607:f8b0:400e:c01::235]:58127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZSlk-000704-2P for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 17:48:40 -0400 Received: by mail-pb0-f53.google.com with SMTP id up7so2641259pbc.40 for ; Thu, 24 Oct 2013 14:48:38 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rick Frankel Cc: Alan Schmitt , "emacs-orgmode@gnu.org" , Carsten Dominik --e89a8ff1c372b07f7004e983988b Content-Type: text/plain; charset=ISO-8859-1 I don't think making chemdraw a babel language is the answer here. The way I know chemdraw is as a standalone binary executable that is all gui. there is no scripting. maybe you could build an xml file by hand, but i would never dream of that! maybe I am missing how you would use it. [[chemdraw:file.cdxml][file:file.png]] Is pretty close to what I had in mind. I would define the link click function to just strip off the png, and open the file.cdxml for example, then you do not need both of those pieces. I suppose this means you would have had to export the file as a new png after editing it to make a change though. The real examples I had in mind were some clean way to integrate emacs with my tablet and drawing pictures that are inline in a buffer. Clicking on the link would open the image in my tablet drawing program, where I would draw on it with a pen, and then save the figure. this is not all images though, just some. Hence the differentiation by a different link. In my course notes, I often have hand-drawn pictures in them. Right now I go through a somewhat annoying process of drawing in powerpoint, selecting the drawing and right clicking to save as an image, which I then put in as a link. I havent had time to find a much better solution. A link could save me some of that hassle, except that the link doesn't show in the buffer as an inline image. I also wanted a "figure" link that would export different ways. For example in html export it would export as html, for latex as eps, and for pdflatex as pdf, but it would show inline in some supported format. I know I can use filters to do that on export to replace or remove extensions, but I haven't had time to write one, and I thought a link would be a nice alternative. We typically make all three versions (png, eps, pdf) of figures, and put the png files in org so they show inline, but we often have to switch them out to one of the other formats at the end for manuscript submission. A link like figure:filename that would somehow show inline if a filename.png existed would solve this problem. Those are what I was thinking about for using other links as images. j John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Thu, Oct 24, 2013 at 9:45 AM, Rick Frankel wrote: > On 2013-10-24 06:08, Carsten Dominik wrote: > >> On 24.10.2013, at 09:28, Alan Schmitt > >> wrote: >> >> Hi Rick and John, >> >> rick@rickster.com writes: >> >> On 2013-10-22 21:53, John Kitchin wrote: >> Is it possible to define new links that would be rendered as inline >> images? >> >> I am imagining something like >> >> chemdraw:benzene.png >> >> which would show the benzene.png file inline, but when I click on it >> would open a chemdraw file for editing. >> >> unfortunately, it seems that `org-display-inline-images' has a >> hardcoded regex which searches only for =file:= links. >> >> This may be related to a question I had a couple weeks ago (see >> http://article.gmane.org/**gmane.emacs.orgmode/77567). >> The current logic >> seems to be to display inline images when the link points to an image, >> it would be great to extend it when the description, or part of the >> link, points to an image. >> >> Indeed, currently this is not possible. I would be interested to get >> a patch to this effect. >> > > Carsten- > > In terms of inlining images in the description portion per the linked > posting, do you think that it should depended on the value if the > =include-linked= argument? (IMHO no, since the default usage of > `org-display-inline-images' doesn't set this argument). I would be > glad to take a stab at this enhancement. > > John- > In reviewing `org-display-inline-images', and the handling of org > links in general, i see no safe (and not overly complex) way of making > added link types expand inline images. In the case mentioned, i still > feel that adding chemdraw as a babel language is the correct approach. > However, if we add the expansion of images in the description, would > that work: > > [[chemdraw:file.cdxml][file:**file.png]] > > rick > --e89a8ff1c372b07f7004e983988b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I don't think making chemdraw a ba= bel language is the answer here. The way I know chemdraw is as a standalone= binary executable that is all gui. there is no scripting. maybe you could = build an xml file by hand, but i would never dream of that! maybe I am miss= ing how you would use it.

[[chemdraw:file.cdxml][file:file.png]]

Is pretty close to what= I had in mind. I would define the link click function to just strip off th= e png, and open the file.cdxml for example, then you do not need both of th= ose pieces. I suppose this means you would have had to export the file as a= new png after editing it to make a change though.

The real examples I had in mind were some clean way to integrate = emacs with my tablet and drawing pictures that are inline in a buffer. Clic= king on the link would open the image in my tablet drawing program, where I= would draw on it with a pen, and then save the figure. this is not all ima= ges though, just some. Hence the differentiation by a different link. In my= course notes, I often have hand-drawn pictures in them. Right now I go thr= ough a somewhat annoying process of drawing in powerpoint, selecting the dr= awing and right clicking to save as an image, which I then put in as a link= . I havent had time to find a much better solution. A link could save me so= me of that hassle, except that the link doesn't show in the buffer as a= n inline image.

I also wanted a "figure" link that would export differe= nt ways. For example in html export it would export as html, for latex as e= ps, and for pdflatex as pdf, but it would show inline in some supported for= mat. I know I can use filters to do that on export to replace or remove ext= ensions, but I haven't had time to write one, and I thought a link woul= d be a nice alternative. We typically make all three versions (png, eps, pd= f) of figures, and put the png files in org so they show inline, but we oft= en have to switch them out to one of the other formats at the end for manus= cript submission. A link like figure:filename=A0 that would somehow show in= line if a filename.png existed would solve this problem.

Those are what I was thinking about for using other links as imag= es.

j


John

-----------------------------------
John Kitch= in
Associate Professor
Doherty Hall A207F
Department of Chemical Enginee= ring
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803<= br>http://k= itchingroup.cheme.cmu.edu



On Thu, Oct 24, 2013 at 9:45 AM, Rick Fr= ankel <rick@rickster.com> wrote:
On 2013-10-24 06:08, Carsten Dominik wrote:
This may be related to a question I had a couple weeks ago (see
http://article.gmane.org/gmane.emacs.orgmode/77567). The c= urrent logic
seems to be to display inline images when the link points to an image,
it would be great to extend it when the description, or part of the
link, points to an image.

Indeed, currently this is not possible. =A0I would be interested to get
a patch to this effect.

Carsten-

In terms of inlining images in the description portion per the linked
posting, do you think that it should depended on the value if the
=3Dinclude-linked=3D argument? (IMHO no, since the default usage of
`org-display-inline-images' doesn't set this argument). I would be<= br> glad to take a stab at this enhancement.

John-
In reviewing `org-display-inline-images', and the handling of org
links in general, i see no safe (and not overly complex) way of making
added link types expand inline images. In the case mentioned, i still
feel that adding chemdraw as a babel language is the correct approach.
However, if we add the expansion of images in the description, would
that work:

[[chemdraw:file.cdxml][file:file.png]]

rick

--e89a8ff1c372b07f7004e983988b-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: make new links show as figures? Date: Thu, 24 Oct 2013 19:41:55 -0400 Message-ID: <3E0DCABB-91AC-44EE-9D5F-06AA208FB7A9@rickster.com> References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1812\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZUdd-0007Qg-RB for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 19:48:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZUdR-0000TT-PD for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 19:48:25 -0400 Received: from [204.62.15.78] (port=44440 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZUdR-0000TJ-Kz for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 19:48:13 -0400 In-Reply-To: <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Alan Schmitt , emacs-orgmode@gnu.org, John Kitchin Carsten- On 2013-10-24 06:08, Carsten Dominik wrote: > On 24.10.2013, at 09:28, Alan Schmitt = wrote: > This may be related to a question I had a couple weeks ago (see > http://article.gmane.org/gmane.emacs.orgmode/77567). The current logic > seems to be to display inline images when the link points to an image, > it would be great to extend it when the description, or part of the > link, points to an image. > Indeed, currently this is not possible. I would be interested to get > a patch to this effect. I agree, expanding images in the link description per the mentioned = posting makes sense. Do you think inlining images in the description In terms of implementation of this, and inlining= From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: make new links show as figures? Date: Thu, 24 Oct 2013 21:18:01 -0400 Message-ID: <2AB1FAD8-C42C-4A75-A9D1-312A1D0E8E42@rickster.com> References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1812\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZW2W-0007yj-QD for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 21:18:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZW2R-0007Vx-E1 for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 21:18:12 -0400 Received: from [204.62.15.78] (port=48858 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZW2R-0007Vq-Ah for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 21:18:07 -0400 In-Reply-To: <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Alan Schmitt , emacs-orgmode@gnu.org, John Kitchin Carsten- On 2013-10-24 06:08, Carsten Dominik wrote: > On 24.10.2013, at 09:28, Alan Schmitt = wrote: > This may be related to a question I had a couple weeks ago (see > http://article.gmane.org/gmane.emacs.orgmode/77567). The current logic > seems to be to display inline images when the link points to an image, > it would be great to extend it when the description, or part of the > link, points to an image. > Indeed, currently this is not possible. I would be interested to get > a patch to this effect. I agree, expanding images in the link description per the mentioned = posting makes sense. Do you think inlining images in the description In terms of implementation of this, and inlining= From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: make new links show as figures? Date: Fri, 25 Oct 2013 12:49:49 -0400 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZkaF-0006kx-KL for emacs-orgmode@gnu.org; Fri, 25 Oct 2013 12:50:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZka9-0006ns-Ax for emacs-orgmode@gnu.org; Fri, 25 Oct 2013 12:49:59 -0400 Received: from [204.62.15.78] (port=43281 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZka9-0006nd-77 for emacs-orgmode@gnu.org; Fri, 25 Oct 2013 12:49:53 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Kitchin Cc: Alan Schmitt , emacs-orgmode@gnu.org, Carsten Dominik On 2013-10-24 17:48, John Kitchin wrote: > I don't think making chemdraw a babel language is the answer here. The > way I know chemdraw is as a standalone binary executable that is all > gui. there is no scripting. maybe you could build an xml file by hand, > but i would never dream of that! maybe I am missing how you would use > it. Sorry, not familiar w/ chemdraw and you had originally mentioned that you wanted clicking the link to open it in emacs. > [[chemdraw:file.cdxml][file:file.png]] > > Is pretty close to what I had in mind. I would define the link click > function to just strip off the png, and open the file.cdxml for > example, then you do not need both of those pieces. I suppose this > means you would have had to export the file as a new png after editing > it to make a change though. I realize that. I offered this approach as an alternative, as I believe I can add the functionality to expand inline images in the description portion, but i don't see a way to make the link portion accept "aliases" for the file: protocol without major changes to link handling. Even then, it seems a bit like a hack. > [many use cases omitted] > Those are what I was thinking about for using other links as images. Other than having to repeat yourself, wouldn't the [[custom:file.ext][file:file.png]] syntax allow for most/all of the use cases mentioned? rick From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: make new links show as figures? Date: Sat, 26 Oct 2013 08:10:06 -0400 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec53963ca6214a904e9a3bf27 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va2gz-0003oG-DG for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 08:10:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Va2gy-0004cT-Hg for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 08:10:09 -0400 Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]:33859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va2gy-0004by-AT for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 08:10:08 -0400 Received: by mail-pd0-f182.google.com with SMTP id q10so5092878pdj.13 for ; Sat, 26 Oct 2013 05:10:06 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rick Frankel Cc: Alan Schmitt , "emacs-orgmode@gnu.org" , Carsten Dominik --bcaec53963ca6214a904e9a3bf27 Content-Type: text/plain; charset=ISO-8859-1 I realize that. I offered this approach as an alternative, as I > believe I can add the functionality to expand inline images in the > description portion, but i don't see a way to make the link portion > accept "aliases" for the file: protocol without major changes to link > handling. Even then, it seems a bit like a hack. > > [many use cases omitted] >> > > Those are what I was thinking about for using other links as images. >> > > Other than having to repeat yourself, wouldn't the > [[custom:file.ext][file:file.**png]] syntax allow for most/all of the > use cases mentioned? > > rick > Yes, I think [[custom:file.ext][file:file.png]] would cover all those cases. --bcaec53963ca6214a904e9a3bf27 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


I realize that. I offered this approach as an alternative, as I
believe I can add the functionality to expand inline images in the
description portion, but i don't see a way to make the link portion
accept "aliases" for the file: protocol without major changes to = link
handling. =A0Even then, it seems a bit like a hack.

[many use cases omitted]

Those are what I was thinking about for using other links as images.

Other than having to repeat yourself, wouldn't the
[[custom:file.ext][file:file.png]] syntax allow for most/all of the<= br> use cases mentioned?

rick

Yes, = I think [[custom:file.ext][file:file.png]] would cover all those cases.
=
--bcaec53963ca6214a904e9a3bf27-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: make new links show as figures? Date: Wed, 30 Oct 2013 12:02:20 -0400 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbYE2-0003av-2K for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 12:02:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbYDv-0005Uj-Rz for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 12:02:30 -0400 Received: from [204.62.15.78] (port=36923 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbYDv-0005Ub-Oj for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 12:02:23 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Kitchin Cc: Alan Schmitt , emacs-orgmode@gnu.org, Carsten Dominik On 2013-10-26 08:10, John Kitchin wrote: > Other than having to repeat yourself, wouldn't the > [[custom:file.ext][file:file.png]] syntax allow for most/all of the > use cases mentioned? > > rick > > Yes, I think [[custom:file.ext][file:file.png]] would cover all > those cases. So it turns out that this is a REALLY simple patch (two characters): --- a/lisp/org.el +++ b/lisp/org.el @@ -18853,7 +18853,7 @@ BEG and END default to the buffer boundaries." (widen) (setq beg (or beg (point-min)) end (or end (point-max))) (goto-char beg) - (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" + (let ((re (concat "\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" (substring (org-image-file-name-regexp) 0 -2) "\\)\\]" (if include-linked "" "\\]"))) (case-fold-search t) This seems to work in all cases I can think of (see test file below). Let me know if this works for you and i will apply to master when i get home and have git push access. rick --------- 8< -------------------- * Setup (babel me) #+BEGIN_SRC dot :file "image1.png" digraph { one } #+END_SRC #+BEGIN_SRC sh echo "digraph { one }" > image1.dot #+END_SRC #+RESULTS: [[file:image1.png]] #+BEGIN_SRC dot :file "image2.png" digraph { two } #+END_SRC #+RESULTS: [[file:image2.png]] * Tests ** file link - with path (=./=) [[file:./image1.png]] - without path [[file:image1.png]] ** no uri link - with path ( =./=) [[./image1.png]] - without path (this does not expand as an image) [[image1.png]] ** with description Note: this does not expand as an image unless `org-display-inline-images' is called with =include-linked= true. [[file:./image1.png][an image]] ** image in description [[./image1.dot][./image1.png]] ** in both This will always display the image in the description regardless of the value of the =include-linked= argument to `org-display-inline-images' (but open the image in the link). [[./image1.png][./image2.png]] From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: make new links show as figures? Date: Thu, 31 Oct 2013 11:04:30 +0100 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbqAb-0005PX-R4 for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 07:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbqAO-0002n1-2k for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 07:12:09 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:7018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vbp7F-0007oE-NG for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 06:04:37 -0400 In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rick Frankel Cc: Carsten Dominik , emacs-orgmode@gnu.org, John Kitchin rick@rickster.com writes: > On 2013-10-26 08:10, John Kitchin wrote: >> Other than having to repeat yourself, wouldn't the >> [[custom:file.ext][file:file.png]] syntax allow for most/all of the >> use cases mentioned? >> >> rick >> >> Yes, I think [[custom:file.ext][file:file.png]] would cover all >> those cases. > > So it turns out that this is a REALLY simple patch (two characters): > > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -18853,7 +18853,7 @@ BEG and END default to the buffer boundaries." > (widen) > (setq beg (or beg (point-min)) end (or end (point-max))) > (goto-char beg) > - (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" > + (let ((re (concat > "\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" > (substring (org-image-file-name-regexp) 0 -2) > "\\)\\]" (if include-linked "" "\\]"))) > (case-fold-search t) > > This seems to work in all cases I can think of (see test file below). > Let me know if this works for you and i will apply to master when i > get home and have git push access. I tried it on some files with images as links, and it works great. Thanks a lot! Alan From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: make new links show as figures? Date: Thu, 31 Oct 2013 11:47:48 -0400 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbuTV-0002ob-F0 for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 11:48:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbuTQ-0003ps-9Z for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 11:47:57 -0400 Received: from [204.62.15.78] (port=50579 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbuTQ-0003ph-5d for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 11:47:52 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: John Kitchin , emacs-orgmode@gnu.org, Carsten Dominik On 2013-10-31 06:04, Alan Schmitt wrote: > rick@rickster.com writes: > > So it turns out that this is a REALLY simple patch (two characters): > > +++ b/lisp/org.el > @@ -18853,7 +18853,7 @@ BEG and END default to the buffer boundaries." > (widen) > (setq beg (or beg (point-min)) end (or end (point-max))) > (goto-char beg) > - (let ((re (concat > "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" > + (let ((re (concat > "\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" > (substring (org-image-file-name-regexp) 0 -2) > "\\)\\]" (if include-linked "" "\\]"))) > (case-fold-search t) > > This seems to work in all cases I can think of (see test file below). > Let me know if this works for you and i will apply to master when i > get home and have git push access. > > I tried it on some files with images as links, and it works > great. Thanks a lot! So, I've done some testing of the export functions (html and latex only) and found the following behaviors with this patch: - HTML - image in description only displayed if the protocol (file:) is included. - LaTeX - same, required file: protocol in description - additionally, pdflatex \includgraphics barfs on any path w/ a =./= path prefix -- this is true for the current implmenation as well. Changing the regexp for in-buffer image expansion to mimic the export behavior is difficult at best. I think the inconsistency is acceptable, and I will documentment the behavior in the `org-display-inline-images' docstring. The latex breakage on paths beginning with =./= should perhaps be addressed in the latex exporter, but this is orthogonal to the current issue. If there is no objection, I will push a fix tonight or tomorrow. rick From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Cook, Malcolm" Subject: Re: make new links show as figures? Date: Thu, 31 Oct 2013 16:20:39 +0000 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbuzS-0006wf-PW for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 12:21:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbuzL-0008Et-2n for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 12:20:58 -0400 Received: from smtp01.stowers.org ([12.201.176.61]:33821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbuzK-0008Ee-FT for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 12:20:50 -0400 In-Reply-To: Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: 'Rick Frankel' , 'Alan Schmitt' Cc: 'Carsten Dominik' , "'emacs-orgmode@gnu.org'" , 'John Kitchin' Pj4NCiA+PiBTbyBpdCB0dXJucyBvdXQgdGhhdCB0aGlzIGlzIGEgUkVBTExZIHNpbXBsZSBwYXRj aCAodHdvIGNoYXJhY3RlcnMpOg0KID4+DQogPj4gKysrIGIvbGlzcC9vcmcuZWwNCiA+PiBAQCAt MTg4NTMsNyArMTg4NTMsNyBAQCBCRUcgYW5kIEVORCBkZWZhdWx0IHRvIHRoZSBidWZmZXIgYm91 bmRhcmllcy4iDQogPj4gKHdpZGVuKQ0KID4+IChzZXRxIGJlZyAob3IgYmVnIChwb2ludC1taW4p KSBlbmQgKG9yIGVuZCAocG9pbnQtbWF4KSkpDQogPj4gKGdvdG8tY2hhciBiZWcpDQogPj4gLSAg IChsZXQgKChyZSAoY29uY2F0DQogPj4gIlxcW1xcW1xcKFxcKGZpbGU6XFwpXFx8XFwoWy4vfl1c XClcXClcXChbXl1cbl0rPyINCiA+PiArICAgKGxldCAoKHJlIChjb25jYXQNCiA+PiAiXFxbLipc XFtcXChcXChmaWxlOlxcKVxcfFxcKFsuL35dXFwpXFwpXFwoW15dXG5dKz8iDQogPj4gKHN1YnN0 cmluZyAob3JnLWltYWdlLWZpbGUtbmFtZS1yZWdleHApIDAgLTIpDQogPj4gIlxcKVxcXSIgKGlm IGluY2x1ZGUtbGlua2VkICIiICJcXF0iKSkpDQogPj4gKGNhc2UtZm9sZC1zZWFyY2ggdCkNCiA+ Pg0KID4+IFRoaXMgc2VlbXMgdG8gd29yayBpbiBhbGwgY2FzZXMgSSBjYW4gdGhpbmsgb2YgKHNl ZSB0ZXN0IGZpbGUgYmVsb3cpLg0KID4+IExldCBtZSBrbm93IGlmIHRoaXMgd29ya3MgZm9yIHlv dSBhbmQgaSB3aWxsIGFwcGx5IHRvIG1hc3RlciB3aGVuIGkNCiA+PiBnZXQgaG9tZSBhbmQgaGF2 ZSBnaXQgcHVzaCBhY2Nlc3MuDQogPj4NCiA+PiBJIHRyaWVkIGl0IG9uIHNvbWUgZmlsZXMgd2l0 aCBpbWFnZXMgYXMgbGlua3MsIGFuZCBpdCB3b3Jrcw0KID4+IGdyZWF0LiBUaGFua3MgYSBsb3Qh DQpbQ29vaywgTWFsY29sbV0gDQoNCkhpIC0gSSdtIHRyeWluZyB0byBmb2xsb3cgdGhpcyB0aHJl YWQgYnV0IGhhdmluZyBhIGNoYWxsZW5nZS4gIENhbiB5b3UgcGxlYXNlIHN1bW1hcml6ZS9yZXBl YXQgdGhlIG9yaWdpbmFsIGludGVuZGVkIGVmZmVjdCBvZiB0aGlzIGNoYW5nZS4uLi4gIA0KDQp+ TWFsY29sbQ0KDQoNCiA+DQogPlNvLCBJJ3ZlIGRvbmUgc29tZSB0ZXN0aW5nIG9mIHRoZSBleHBv cnQgZnVuY3Rpb25zIChodG1sIGFuZCBsYXRleA0KID5vbmx5KSBhbmQgZm91bmQgdGhlIGZvbGxv d2luZyBiZWhhdmlvcnMgd2l0aCB0aGlzIHBhdGNoOg0KID4NCiA+LSBIVE1MDQogPi0gaW1hZ2Ug aW4gZGVzY3JpcHRpb24gb25seSBkaXNwbGF5ZWQgaWYgdGhlIHByb3RvY29sIChmaWxlOikgaXMN CiA+aW5jbHVkZWQuDQogPi0gTGFUZVgNCiA+LSBzYW1lLCByZXF1aXJlZCBmaWxlOiBwcm90b2Nv bCBpbiBkZXNjcmlwdGlvbg0KID4tIGFkZGl0aW9uYWxseSwgcGRmbGF0ZXggXGluY2x1ZGdyYXBo aWNzIGJhcmZzIG9uIGFueSBwYXRoIHcvIGENCiA+PS4vPSBwYXRoIHByZWZpeCAtLSB0aGlzIGlz IHRydWUgZm9yIHRoZSBjdXJyZW50IGltcGxtZW5hdGlvbiBhcw0KID53ZWxsLg0KID4NCiA+Q2hh bmdpbmcgdGhlIHJlZ2V4cCBmb3IgaW4tYnVmZmVyIGltYWdlIGV4cGFuc2lvbiB0byBtaW1pYyB0 aGUgZXhwb3J0DQogPmJlaGF2aW9yIGlzIGRpZmZpY3VsdCBhdCBiZXN0LiBJIHRoaW5rIHRoZSBp bmNvbnNpc3RlbmN5IGlzDQogPmFjY2VwdGFibGUsIGFuZCBJIHdpbGwgZG9jdW1lbnRtZW50IHRo ZSBiZWhhdmlvciBpbiB0aGUNCiA+YG9yZy1kaXNwbGF5LWlubGluZS1pbWFnZXMnIGRvY3N0cmlu Zy4NCiA+DQogPlRoZSBsYXRleCBicmVha2FnZSBvbiBwYXRocyBiZWdpbm5pbmcgd2l0aCA9Li89 IHNob3VsZCBwZXJoYXBzIGJlDQogPmFkZHJlc3NlZCBpbiB0aGUgbGF0ZXggZXhwb3J0ZXIsIGJ1 dCB0aGlzIGlzIG9ydGhvZ29uYWwgdG8gdGhlDQogPmN1cnJlbnQgaXNzdWUuDQogPg0KID5JZiB0 aGVyZSBpcyBubyBvYmplY3Rpb24sIEkgd2lsbCBwdXNoIGEgZml4IHRvbmlnaHQgb3IgdG9tb3Jy b3cuDQogPg0KID5yaWNrDQogPg0KDQo= From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: make new links show as figures? Date: Thu, 31 Oct 2013 12:55:10 -0400 Message-ID: <454e32d5f18a0d803775aec68888f3b3@mail.rickster.com> References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbvWe-0002KU-Gr for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 12:55:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbvWY-0002MF-HF for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 12:55:16 -0400 Received: from [204.62.15.78] (port=45772 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbvWY-0002M5-Ed for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 12:55:10 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On 2013-10-31 12:20, Cook, Malcolm wrote: > > >> So it turns out that this is a REALLY simple patch (two characters): > >> > >> +++ b/lisp/org.el > >> @@ -18853,7 +18853,7 @@ BEG and END default to the buffer > boundaries." > >> (widen) > >> (setq beg (or beg (point-min)) end (or end (point-max))) > >> (goto-char beg) > >> - (let ((re (concat > >> "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" > >> + (let ((re (concat > >> "\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" > >> (substring (org-image-file-name-regexp) 0 -2) > >> "\\)\\]" (if include-linked "" "\\]"))) > >> (case-fold-search t) > >> > >> This seems to work in all cases I can think of (see test file > below). > >> Let me know if this works for you and i will apply to master when i > >> get home and have git push access. > >> > >> I tried it on some files with images as links, and it works > >> great. Thanks a lot! > [Cook, Malcolm] > > Hi - I'm trying to follow this thread but having a challenge. Can you > please summarize/repeat the original intended effect of this > change.... To make images in link descriptions (e.g, [[file.dot][file.png]] displayed inline rather than showing the text ("file.png") > > > > >So, I've done some testing of the export functions (html and latex > >only) and found the following behaviors with this patch: > > > >- HTML > >- image in description only displayed if the protocol (file:) is > >included. > >- LaTeX > >- same, required file: protocol in description > >- additionally, pdflatex \includgraphics barfs on any path w/ a > >=./= path prefix -- this is true for the current implmenation as > >well. > > > >Changing the regexp for in-buffer image expansion to mimic the export > >behavior is difficult at best. I think the inconsistency is > >acceptable, and I will documentment the behavior in the > >`org-display-inline-images' docstring. > > > >The latex breakage on paths beginning with =./= should perhaps be > >addressed in the latex exporter, but this is orthogonal to the > >current issue. > > > >If there is no objection, I will push a fix tonight or tomorrow. > > > >rick > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: make new links show as figures? Date: Thu, 31 Oct 2013 18:06:12 +0100 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbvhP-0002LG-OS for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 13:06:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbvhJ-0005rV-FL for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 13:06:23 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:54682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbvhJ-0005r9-9D for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 13:06:17 -0400 In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rick Frankel Cc: John Kitchin , emacs-orgmode@gnu.org, Carsten Dominik rick@rickster.com writes: > So, I've done some testing of the export functions (html and latex > only) and found the following behaviors with this patch: > > - HTML > - image in description only displayed if the protocol (file:) is > included. > - LaTeX > - same, required file: protocol in description > - additionally, pdflatex \includgraphics barfs on any path w/ a > =./= path prefix -- this is true for the current implmenation as > well. > > Changing the regexp for in-buffer image expansion to mimic the export > behavior is difficult at best. I think the inconsistency is > acceptable, and I will documentment the behavior in the > `org-display-inline-images' docstring. Consistency would be nice, but then we might start asking for more, such as following attr_html attributes (width, for instance). It's very useful like this, to check before exporting that the link to the expected image is indeed correct. Thanks, Alan