[PATCH] doc/python-cffi: import from built bindings, not installed module

2021-10-29 Thread David Bremner
Previously the python-cffi bindings either failed to build, or built
for the wrong module by using the installed module.

The fix requires correction the module path, building the bindings
before docs, and helping python find the built libnotmuch.

Based on patch / discussion from Micheal Gruber [1]

[1]: id:cover.1634808719.git@grubix.eu
---
 doc/Makefile.local | 12 
 doc/conf.py|  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/doc/Makefile.local b/doc/Makefile.local
index f476d1da..730ad4fb 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -4,7 +4,7 @@ dir := doc
 
 # You can set these variables from the command line.
 SPHINXOPTS:= -q
-SPHINXBUILD   = sphinx-build
+SPHINXBUILD   = env LD_LIBRARY_PATH=${NOTMUCH_BUILDDIR}/lib sphinx-build
 DOCBUILDDIR  := $(dir)/_build
 
 # Internal variables.
@@ -35,7 +35,7 @@ endif
 
 INFO_INFO_FILES := $(INFO_TEXI_FILES:.texi=.info)
 
-.PHONY: sphinx-html sphinx-texinfo sphinx-info
+.PHONY: sphinx-html sphinx-texinfo sphinx-info doc-prereqs
 
 .PHONY: install-man build-man apidocs install-apidocs
 
@@ -46,15 +46,19 @@ ifeq ($(WITH_EMACS),1)
 $(DOCBUILDDIR)/.roff.stamp $(DOCBUILDDIR)/.html.stamp 
$(DOCBUILDDIR)/.texi.stamp : docstring.stamp
 endif
 
+ifeq ($(HAVE_PYTHON3_CFFI),1)
+doc-prereqs: python-cffi-bindings
+endif
+
 sphinx-html: $(DOCBUILDDIR)/.html.stamp
 
-$(DOCBUILDDIR)/.html.stamp: $(ALL_RST_FILES)
+$(DOCBUILDDIR)/.html.stamp: $(ALL_RST_FILES) doc-prereqs
$(SPHINXBUILD) -b html -d $(DOCBUILDDIR)/html_doctrees $(ALLSPHINXOPTS) 
$(DOCBUILDDIR)/html
touch $@
 
 sphinx-texinfo: $(DOCBUILDDIR)/.texi.stamp
 
-$(DOCBUILDDIR)/.texi.stamp: $(ALL_RST_FILES)
+$(DOCBUILDDIR)/.texi.stamp: $(ALL_RST_FILES) doc-prereqs
$(SPHINXBUILD) -b texinfo -d $(DOCBUILDDIR)/texinfo_doctrees 
$(ALLSPHINXOPTS) $(DOCBUILDDIR)/texinfo
touch $@
 
diff --git a/doc/conf.py b/doc/conf.py
index 1fbd102b..c7fd8f5a 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -25,7 +25,7 @@ for pathdir in ['.', '..']:
 version=infile.read().replace('\n','')
 
 # for autodoc
-sys.path.insert(0, os.path.join(location, '..', 'bindings', 'python-cffi', 
'notmuch2'))
+sys.path.insert(0, os.path.join(location, '..', 'bindings', 'python-cffi', 
'build', 'stage'))
 
 # read generated config
 for pathdir in ['.', '..']:
-- 
2.33.0

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] emacs: don't add space to tag completion candidates.

2021-10-29 Thread inwit
Works as expected under selectrum! Thanks!


On Sat Oct 23, 2021 at 7:05 PM CEST, David Bremner wrote:
> Apparently this messes up various third party completion
> frameworks. This change does mean that users will have to hit space
> after completing a tag change in order to enter another change.
>
> As a bonus, remove the call to #'delete, since
> completing-read-multiple already promises to remove empty strings.
> ---
> emacs/notmuch-tag.el | 14 +++---
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
> index 536315e9..145f309f 100644
> --- a/emacs/notmuch-tag.el
> +++ b/emacs/notmuch-tag.el
> @@ -429,17 +429,9 @@ initial input in the minibuffer."
> (set-keymap-parent map crm-local-completion-map)
> (define-key map " " 'self-insert-command)
> map)))
> - (delete "" (completing-read-multiple
> - prompt
> - ;; Append the separator to each completion so when the
> - ;; user completes a tag they can immediately begin
> - ;; entering another. `completing-read-multiple'
> - ;; ultimately splits the input on crm-separator, so we
> - ;; don't need to strip this back off (we just need to
> - ;; delete "empty" entries caused by trailing spaces).
> - (mapcar (lambda (tag-op) (concat tag-op crm-separator)) tag-list)
> - nil nil initial-input
> - 'notmuch-read-tag-changes-history
> + (completing-read-multiple prompt tag-list
> + nil nil initial-input
> + 'notmuch-read-tag-changes-history)))
>  
> ;;; Tagging
>  
> --
> 2.33.0
> ___
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-le...@notmuchmail.org

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org