From b495c922394ac7b2911bc6774011c527cf8358f1 Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Sat, 1 Dec 2012 11:29:42 +0530 Subject: [PATCH] org-odt.el: Correctly format link to headlines that have description * lisp/org-odt.el (org-odt-format-org-link): Add check for presence of description in headline links. Fix http://lists.gnu.org/archive/html/emacs-orgmode/2012-11/msg00841.html --- lisp/org-odt.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/org-odt.el b/lisp/org-odt.el index f9fd6a2b9..03b067048 100644 --- a/lisp/org-odt.el +++ b/lisp/org-odt.el @@ -1727,6 +1727,7 @@ ATTR is a string of other attributes of the a element." ((and (string= type "") (or (not thefile) (string= thefile "")) (plist-get org-lparse-opt-plist :section-numbers) + (get-text-property 0 'org-no-description fragment) (setq sec-frag fragment) (or (string-match "\\`sec\\(\\(-[0-9]+\\)+\\)" sec-frag) (and (setq sec-frag @@ -1756,7 +1757,11 @@ ATTR is a string of other attributes of the a element." (when (not (member type '("" "file"))) (setq thefile (concat type ":" thefile))) - (let ((org-odt-suppress-xref nil)) + (let ((org-odt-suppress-xref + ;; Typeset link to headlines with description, as a + ;; regular hyperlink. + (and (string= type "") + (not (get-text-property 0 'org-no-description fragment))))) (org-odt-format-link (org-xml-format-desc desc) thefile attr)))))))