[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [Exporter] Why fall-back to :title if :alt-title is nil?

From: Thorsten Jolitz
Subject: [O] [Exporter] Why fall-back to :title if :alt-title is nil?
Date: Sat, 16 Nov 2013 11:24:30 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Hi List, 

in ox.el I find this function for getting the (optional) alternative title of
a headline:

#+begin_src emacs-lisp
(defun org-export-get-alt-title (headline info)
  "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)))

I'm not so sure that it is a good idea to fallback to the regular title in
case :alt-title is nil, because when extracting both, title and alt-title,
from a headline, there is a almost always a duplication (the regular title
string is received two times, via the get-title and get-alt-title functions)
because :alt-title isn't really set very often.

Wouldn't it make more sense to just return nil when :alt-title is nil? If the
application code needs a title string anyway, it can always fall-back to a
call to the get-title function.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]