+if tags.has('WITH_EMACS'):
+ # Hacky reimplementation of include to workaround limitations of
+ # sphinx-doc
+ lines = ['.. include:: /../emacs/rstdoc.rsti\n\n'] # in the source tree
+ for file in ('notmuch.rsti', 'notmuch-lib.rsti', 'notmuch-show.rsti', 'notmuch-tag.rsti', 'notmuch-tree.rsti'):
+ lines.extend(open(rsti_dir+'/'+file))
+ rst_epilog = ''.join(lines)
+ del lines
+else:
+ # If we don't have emacs (or the user configured --without-emacs),
+ # don't build the notmuch-emacs docs, as they need emacs to generate
+ # the docstring include files
+ exclude_patterns.append('notmuch-emacs.rst')
+
+if not tags.has('WITH_PYTHON'):
+ exclude_patterns.append('python-bindings.rst')
+