From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: [PATCH] Re: Unintended behavior? Links without description Date: Sun, 13 Feb 2011 13:45:18 +0100 Message-ID: <4D57D25E.408@christianmoe.com> References: <4D19BC26.8030904@christianmoe.com> <87hbc8vr7k.fsf@gnu.org> Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040503020409010201060301" Return-path: Received: from [140.186.70.92] (port=55106 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PobHz-0001qr-62 for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 07:42:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PobHy-0006Gz-AR for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 07:42:55 -0500 Received: from mars.hitrost.net ([91.185.211.18]:32197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PobHx-00069R-Tm for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 07:42:54 -0500 In-Reply-To: <87hbc8vr7k.fsf@gnu.org> 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: Bastien Cc: Org Mode , Carsten Dominik This is a multi-part message in MIME format. --------------040503020409010201060301 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit bbdb: Export links with normalized desc part * org-bbdb.el (org-bbdb-export): When a link description has been added by org-export-normalize-links, use path instead (remove the `bbdb:' prefix). The existing code handled the case where desc is nil. However, this no longer occurs, since org-export-normalize-links now automatically adds a desc to links, with a `bbdb:' prefix that would not usually be wanted in exported text. The patch results in the same output as originally intended. TINYCHANGE diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el index c04b7ff..1d3252c 100644 --- a/lisp/org-bbdb.el +++ b/lisp/org-bbdb.el @@ -208,10 +208,12 @@ date year)." "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." + (when (string= desc (format "bbdb:%s" path)) + (setq desc path)) (cond - ((eq format 'html) (format "%s" (or desc path))) - ((eq format 'latex) (format "\\textit{%s}" (or desc path))) - (t (or desc path)))) + ((eq format 'html) (format "%s" desc)) + ((eq format 'latex) (format "\\textit{%s}" desc)) + (t desc))) (defun org-bbdb-open (name) "Follow a BBDB link to NAME." --------------040503020409010201060301 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="org-bbdb.el.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="org-bbdb.el.diff" diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el index c04b7ff..1d3252c 100644 --- a/lisp/org-bbdb.el +++ b/lisp/org-bbdb.el @@ -208,10 +208,12 @@ date year)." "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." + (when (string= desc (format "bbdb:%s" path)) + (setq desc path)) (cond - ((eq format 'html) (format "%s" (or desc path))) - ((eq format 'latex) (format "\\textit{%s}" (or desc path))) - (t (or desc path)))) + ((eq format 'html) (format "%s" desc)) + ((eq format 'latex) (format "\\textit{%s}" desc)) + (t desc))) (defun org-bbdb-open (name) "Follow a BBDB link to NAME." --------------040503020409010201060301 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --------------040503020409010201060301--