From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: exporting link abbreviations Date: Sat, 29 Mar 2014 19:48:35 +0100 Message-ID: <87fvm0q1rw.fsf@gmail.com> References: <9769.1396112254@gregminhallsmbp> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTyIe-000405-9H for emacs-orgmode@gnu.org; Sat, 29 Mar 2014 14:48:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTyIZ-0005dZ-1N for emacs-orgmode@gnu.org; Sat, 29 Mar 2014 14:48:12 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:53804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTyIY-0005dS-Nu for emacs-orgmode@gnu.org; Sat, 29 Mar 2014 14:48:06 -0400 Received: by mail-wi0-f175.google.com with SMTP id cc10so1795701wib.14 for ; Sat, 29 Mar 2014 11:48:05 -0700 (PDT) In-Reply-To: <9769.1396112254@gregminhallsmbp> (Greg Minshall's message of "Sat, 29 Mar 2014 17:57:34 +0100") 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: Greg Minshall Cc: org-mode Hello, Greg Minshall writes: > but, i'm less happy with how these links look when i've provided no > description and they are exported. if i have a link like: > ---- > [[gmap:123 Main Street, Our Town, California, United States]] > ---- > > what is *shown* on the exported web page (say) is something ugly like: > ---- > http://maps.google.com/maps?q=123%20Main%20Street,%20Our%20Town,%20California,%20United%20States > ---- > > i'd rather not specify the address twice (once in the link tag, a second > time in the link description), out of laziness, i guess (but also for > 2nd-normal-form'ity). > > what i'd *like* the user to see on the web page is the address ("123 > Main Street, Out Town, California, United States", in this example). > > i could define a macro: > ---- > #+MACRO: gmap [[gmap: $1][$1]] > ---- > and invoke it with > ---- > {{{gmap(123 Main Street Los Altos California United States)}}} > ---- > > but then > 1) i'd have to get rid of the commas in the address (it might > be nice to have a "$*" or some such to give the entire argument ); and No, you don't have to. Commas can be escaped within a macro: {{{gmap(123 Main Street\, Los Altos\, California\, United States)}}} > 2) i wouldn't have the link active in my org-mode buffer itself > (something i find so magical, plus it helps entering the info to be able > to check the map before exporting). You may want to add gmap as a new link type with dedicated export functions. See `org-add-link-type'. Regards, -- Nicolas Goaziou