emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [Exporter] Why fall-back to :title if :alt-title is nil?
Date: Sat, 16 Nov 2013 11:24:30 +0100	[thread overview]
Message-ID: <87li0olk4h.fsf@gmail.com> (raw)


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)))
#+end_src

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.

-- 
cheers,
Thorsten

             reply	other threads:[~2013-11-16 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-16 10:24 Thorsten Jolitz [this message]
2013-11-16 11:01 ` [Exporter] Why fall-back to :title if :alt-title is nil? Nicolas Goaziou
2013-11-16 12:38   ` Thorsten Jolitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87li0olk4h.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).