From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: Unintended behavior? Links without description Date: Fri, 31 Dec 2010 10:09:32 -1000 Message-ID: <7EE2D870-2AC8-474A-BB36-38751035BF5E@tsdye.com> References: <4D19BC26.8030904@christianmoe.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=36220 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYlID-0002kr-0C for emacs-orgmode@gnu.org; Fri, 31 Dec 2010 15:09:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PYlIB-0004AT-3A for emacs-orgmode@gnu.org; Fri, 31 Dec 2010 15:09:40 -0500 Received: from cpoproxy3-pub.bluehost.com ([67.222.54.6]:33478) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PYlIA-0004A3-Qi for emacs-orgmode@gnu.org; Fri, 31 Dec 2010 15:09:39 -0500 In-Reply-To: <4D19BC26.8030904@christianmoe.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: mail@christianmoe.com Cc: Org Mode , Carsten Dominik Aloha Christian, I explored the possibility of bisecting but found two things: 1) with my setup I can't run versions of Org-mode earlier than approximately 7.01h because of requirements for ob.el, and 2) the current behavior has been around at least since last summer--Org-mode version 7.01trans (release_7.01h.209.g2c33b) yields the same results as the current git master. All the best, Tom On Dec 28, 2010, at 12:29 AM, Christian Moe wrote: > (sorry -- hit "send" too early by mistake in the previous mail) > > Hi, > > In pre-processing for export with org-export-normalize-links, links > that lack a description part are given one, which consists of the > full raw path of the link. In other words, link descriptions are > never nil. This seems to conflict with the expectations of org- > bbdb.el and custom links based on that example. > > The link [[bbdb:Carsten Dominik]], for instance, is exported to html > and latex as follows: > > bbdb:Carsten Dominik > \textit{bbdb:Carsten Dominik}. > > Org-bbdb.el is clearly prepared to be passed a desc that is nil, in > which case it would use path instead: > > (defun org-bbdb-export (path desc format) > "Create the export version of a BBDB link specified by PATH or DESC. > If exporting to either HTML or LaTeX FORMAT the link will be > italicized, in all other cases it is left unchanged." > (cond > ((eq format 'html) (format "%s" (or desc path))) > ((eq format 'latex) (format "\\textit{%s}" (or desc path))) > (t (or desc path)))) > > However, desc is never nil, because a missing description part is > replaced in export pre-processing by a string consisting of the link > type, a colon, and the path. This takes place in the function org- > export-normalize-links. > > This makes for unexpected behavior in custom links that some of us > have defined. E.g., Thomas S. Dye's `cite' links (the thread `org- > add-link-type'): > >> (org-add-link-type >> "citet" 'ebib >> (lambda (path desc format) >> (cond >> ((eq format 'latex) >> (if (and desc) >> (format "\\citet[%s]{%s}" desc path) >> (format "\\citet{%s}" path)))))) >> >> [[citet:green84:_settl_patter_studies_ocean]] >> >> yields this: >> >> \citet[citet:green84:_settl\_patter\_studies\_ocean] >> {green84:_settl_patter_studies_ocean} > > Some of my links, more closely modeled on org-bbdb.el, have similar > problems. > > I haven't done the bisection thing, but I suspect this is a fairly > recent change. > > I think I've tracked down the problem, but I don't necessarily > understand what org-export-normalize-links is supposed to do or what > other behaviors depend on this, so I'm not going to submit a patch. > If this is now the intended behavior, it will be no problem to > rewrite the custom link export definitions to take account of it. > > Yours, > Christian > > >