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