From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Unintended behavior? Links without description Date: Tue, 28 Dec 2010 11:11:06 +0100 Message-ID: <4D19B7BA.8010505@christianmoe.com> Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=37106 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PXWUX-0003Iv-Eh for emacs-orgmode@gnu.org; Tue, 28 Dec 2010 05:09:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PXWUS-0000hx-Iw for emacs-orgmode@gnu.org; Tue, 28 Dec 2010 05:09:17 -0500 Received: from mars.hitrost.net ([91.185.211.18]:56362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PXWUS-0000eE-DR for emacs-orgmode@gnu.org; Tue, 28 Dec 2010 05:09:12 -0500 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: Org Mode Hi, In pre-processing for export, 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: