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