The culprit code is the following: (when :time-stamp-file (format-time-string (concat "\n"))) This `when' condition is always true, because :time-stamp-file is a keyword and always eval to itself, never to nil. So I think org-export-time-stamp-file should be used instead of :time-stamp-file.