Browse Source

org-element: Remove :alt-title property for headlines

* lisp/org-element.el (org-element-headline-parser): Remove :alt-title.
* lisp/ox.el (org-export-get-alt-title): Check regular :ALT_TITLE
  property instead of :alt-title.

`:alt-title' is an export-specific property. As a consequence, it's
value doesn't need to be parsed at "org-element.el"'s level. There, it
is treated as a regular property : `ALT_TITLE'.

This also removes the last call to
`org-element-parse-secondary-string' from "org-element.el".
Nicolas Goaziou 10 years ago
parent
commit
a1f54021c9
2 changed files with 8 additions and 13 deletions
  1. 4 11
      lisp/org-element.el
  2. 4 2
      lisp/ox.el

+ 4 - 11
lisp/org-element.el

@@ -867,10 +867,10 @@ Return value is a plist."
   "Parse a headline.
 
 Return a list whose CAR is `headline' and CDR is a plist
-containing `:raw-value', `:title', `:alt-title', `:begin',
-`:end', `:pre-blank', `:contents-begin' and `:contents-end',
-`:level', `:priority', `:tags', `:todo-keyword',`:todo-type',
-`:scheduled', `:deadline', `:closed', `:archivedp', `:commentedp'
+containing `:raw-value', `:title', `:begin', `:end',
+`:pre-blank', `:contents-begin' and `:contents-end', `:level',
+`:priority', `:tags', `:todo-keyword',`:todo-type', `:scheduled',
+`:deadline', `:closed', `:archivedp', `:commentedp'
 `:footnote-section-p', `:post-blank' and `:post-affiliated'
 keywords.
 
@@ -953,13 +953,6 @@ Assume point is at beginning of the headline."
 			  :post-affiliated begin)
 		    time-props
 		    standard-props))))
-	(let ((alt-title (org-element-property :ALT_TITLE headline)))
-	  (when alt-title
-	    (org-element-put-property
-	     headline :alt-title
-	     (if raw-secondary-p alt-title
-	       (org-element-parse-secondary-string
-		alt-title (org-element-restriction 'headline) headline)))))
 	(org-element-put-property
 	 headline :title
 	 (if raw-secondary-p raw-value

+ 4 - 2
lisp/ox.el

@@ -3803,8 +3803,10 @@ fail, the fall-back value is \"???\"."
   "Return alternative title for HEADLINE, as a secondary string.
 INFO is a plist used as a communication channel.  If no optional
 title is defined, fall-back to the regular title."
-  (or (org-element-property :alt-title headline)
-      (org-element-property :title headline)))
+  (let ((alt (org-element-property :ALT_TITLE headline)))
+    (if alt (org-element-parse-secondary-string
+	     alt (org-element-restriction 'headline) headline)
+      (org-element-property :title headline))))
 
 (defun org-export-first-sibling-p (blob info)
   "Non-nil when BLOB is the first sibling in its parent.