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 > >