Browse Source

Remove TARGET handling from export back-ends

* contrib/lisp/ox-groff.el (org-groff-link): Remove TARGET handling.
* lisp/ox-ascii.el (org-ascii-link): Remove TARGET handling.
* lisp/ox-html.el (org-html-keyword): Remove TARGET handling.
* lisp/ox-latex.el (org-latex-keyword, org-latex-link): Remove TARGET
  handling.
* lisp/ox-man.el (org-man-keyword): Remove TARGET handling.
* lisp/ox-md.el (org-md-link): Remove TARGET handling.
* lisp/ox-odt.el (org-odt-keyword): Remove TARGET handling.
Nicolas Goaziou 12 years ago
parent
commit
735bb251b1
7 changed files with 21 additions and 37 deletions
  1. 3 6
      contrib/lisp/ox-groff.el
  2. 8 10
      lisp/ox-ascii.el
  3. 0 2
      lisp/ox-html.el
  4. 0 4
      lisp/ox-latex.el
  5. 0 2
      lisp/ox-man.el
  6. 6 8
      lisp/ox-md.el
  7. 4 5
      lisp/ox-odt.el

+ 3 - 6
contrib/lisp/ox-groff.el

@@ -1293,12 +1293,9 @@ INFO is a plist holding contextual information.  See
                    (or desc
                        (org-export-data
                         (org-element-property :raw-link link) info))))
-          ;; Fuzzy link points to an invisible target.
-          (keyword nil)
-          ;; LINK points to a headline.  If headlines are numbered
-          ;; and the link has no description, display headline's
-          ;; number.  Otherwise, display description or headline's
-          ;; title.
+          ;; LINK points to a headline.  If headlines are numbered and
+          ;; the link has no description, display headline's number.
+          ;; Otherwise, display description or headline's title.
           (headline
            (let ((label ""))
              (if (and (plist-get info :section-numbers) (not desc))

+ 8 - 10
lisp/ox-ascii.el

@@ -1424,16 +1424,14 @@ INFO is a plist holding contextual information."
      ;; targets.
      ((string= type "fuzzy")
       (let ((destination (org-export-resolve-fuzzy-link link info)))
-	;; Ignore invisible "#+TARGET: path".
-	(unless (eq (org-element-type destination) 'keyword)
-	  (if (org-string-nw-p desc) desc
-	    (when destination
-	      (let ((number
-		     (org-export-get-ordinal
-		      destination info nil 'org-ascii--has-caption-p)))
-		(when number
-		  (if (atom number) (number-to-string number)
-		    (mapconcat 'number-to-string number ".")))))))))
+	(if (org-string-nw-p desc) desc
+	  (when destination
+	    (let ((number
+		   (org-export-get-ordinal
+		    destination info nil 'org-ascii--has-caption-p)))
+	      (when number
+		(if (atom number) (number-to-string number)
+		  (mapconcat 'number-to-string number "."))))))))
      (t
       (if (not (org-string-nw-p desc)) (format "[%s]" raw-link)
 	(concat

+ 0 - 2
lisp/ox-html.el

@@ -2328,8 +2328,6 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
 	(value (org-element-property :value keyword)))
     (cond
      ((string= key "HTML") value)
-     ;; Invisible targets.
-     ((string= key "TARGET") nil)
      ((string= key "TOC")
       (let ((value (downcase value)))
 	(cond

+ 0 - 4
lisp/ox-latex.el

@@ -1722,8 +1722,6 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
     (cond
      ((string= key "LATEX") value)
      ((string= key "INDEX") (format "\\index{%s}" value))
-     ;; Invisible targets.
-     ((string= key "TARGET") nil)
      ((string= key "TOC")
       (let ((value (downcase value)))
 	(cond
@@ -1924,8 +1922,6 @@ INFO is a plist holding contextual information.  See
 		   (or desc
 		       (org-export-data
 			(org-element-property :raw-link link) info))))
-	  ;; Fuzzy link points to an invisible target.
-	  (keyword nil)
 	  ;; LINK points to a headline.  If headlines are numbered
 	  ;; and the link has no description, display headline's
 	  ;; number.  Otherwise, display description or headline's

+ 0 - 2
lisp/ox-man.el

@@ -618,8 +618,6 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
     (cond
      ((string= key "MAN") value)
      ((string= key "INDEX") nil)
-     ;; Invisible targets.
-     ((string= key "TARGET") nil)
      ((string= key "TOC"   ) nil))))
 
 

+ 6 - 8
lisp/ox-md.el

@@ -310,14 +310,12 @@ a communication channel."
 	     (org-export-data (org-element-contents destination) info)))
 	  ((equal type "fuzzy")
 	   (let ((destination (org-export-resolve-fuzzy-link link info)))
-	     ;; Ignore invisible "#+TARGET: path".
-	     (unless (eq (org-element-type destination) 'keyword)
-	       (if (org-string-nw-p contents) contents
-		 (when destination
-		   (let ((number (org-export-get-ordinal destination info)))
-		     (when number
-		       (if (atom number) (number-to-string number)
-			 (mapconcat 'number-to-string number ".")))))))))
+	     (if (org-string-nw-p contents) contents
+	       (when destination
+		 (let ((number (org-export-get-ordinal destination info)))
+		   (when number
+		     (if (atom number) (number-to-string number)
+		       (mapconcat 'number-to-string number "."))))))))
 	  (t (let* ((raw-path (org-element-property :path link))
 		    (path (cond
 			   ((member type '("http" "https" "ftp"))

+ 4 - 5
lisp/ox-odt.el

@@ -2022,7 +2022,6 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
      ((string= key "INDEX")
       ;; FIXME
       (ignore))
-     ((string= key "TARGET") nil)
      ((string= key "TOC")
       (let ((value (downcase value)))
 	(cond
@@ -2836,10 +2835,10 @@ INFO is a plist holding contextual information.  See
 	     (let ((label (org-element-property :value destination)))
 	       (format "<text:a xlink:type=\"simple\" xlink:href=\"#%s\">%s</text:a>"
 		       (org-export-solidify-link-text label) desc))))
-	 ;; LINK has no description. It points to either a HEADLINE, a
-	 ;; TARGET or an ELEMENT with a #+NAME: LABEL attached to it.
-	 ;; LINK to DESTINATION, but make a best effort to provide a
-	 ;; *meaningful* description.
+	 ;; LINK has no description. It points to either a HEADLINE or
+	 ;; an ELEMENT with a #+NAME: LABEL attached to it.  LINK to
+	 ;; DESTINATION, but make a best effort to provide
+	 ;; a *meaningful* description.
 	 (org-odt-link--infer-description destination info))))
      ;; Coderef: replace link with the reference name or the
      ;; equivalent line number.