Re: [PATCH] doc: add support for adding configure options as Sphinx tags

2019-03-19 Thread David Bremner
Jani Nikula  writes:

> Add the configure options specified in $(TAGS) that equal 1 as tags on
> the Sphinx command line using the -t option. The tags may be used to
> conditionally include documentation using the Sphinx "only" directive
> [1].
>
> As an example, indicate in the documentation whether the Xapian field
> processor is likely to be available (assuming the notmuch binary was
> built in the same environment as the documentation).
>
> [1] 
> http://www.sphinx-doc.org/en/stable/markup/misc.html#including-content-based-on-tags
>
> ---
>
> This is something I wrote two years ago, ISTR David asking about
> something like this on IRC, but I've already forgotten what it was
> about...
> ---
>  doc/Makefile.local| 7 ++-
>  doc/man7/notmuch-search-terms.rst | 8 
>  2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/doc/Makefile.local b/doc/Makefile.local
> index bab3d0d286ce..95df9ae82b4f 100644
> --- a/doc/Makefile.local
> +++ b/doc/Makefile.local
> @@ -7,8 +7,13 @@ SPHINXOPTS:= -q
>  SPHINXBUILD   = sphinx-build
>  DOCBUILDDIR  := $(dir)/_build
>  
> +# Configure options to be added as Sphinx tags.
> +# Add "-t " for each make variable in TAGS that equals 1.
> +TAGS := HAVE_XAPIAN_FIELD_PROCESSOR HAVE_XAPIAN_COMPACT

Is there a good reason TAGS not defined in Makefile.config? Or just a
lack of tuits?

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] doc: add support for adding configure options as Sphinx tags

2019-03-19 Thread David Bremner
Jani Nikula  writes:

> Add the configure options specified in $(TAGS) that equal 1 as tags on
> the Sphinx command line using the -t option. The tags may be used to
> conditionally include documentation using the Sphinx "only" directive
> [1].
>
> As an example, indicate in the documentation whether the Xapian field
> processor is likely to be available (assuming the notmuch binary was
> built in the same environment as the documentation).
>
> [1] 
> http://www.sphinx-doc.org/en/stable/markup/misc.html#including-content-based-on-tags
>
> ---
>
> This is something I wrote two years ago, ISTR David asking about
> something like this on IRC, but I've already forgotten what it was
> about...

The urgent-ish issue is getting the docs building without
emacs. Hopefully similar technology can comment out the emacs docs from
the sphinx index page?

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] doc: add support for adding configure options as Sphinx tags

2019-03-19 Thread Jani Nikula
Add the configure options specified in $(TAGS) that equal 1 as tags on
the Sphinx command line using the -t option. The tags may be used to
conditionally include documentation using the Sphinx "only" directive
[1].

As an example, indicate in the documentation whether the Xapian field
processor is likely to be available (assuming the notmuch binary was
built in the same environment as the documentation).

[1] 
http://www.sphinx-doc.org/en/stable/markup/misc.html#including-content-based-on-tags

---

This is something I wrote two years ago, ISTR David asking about
something like this on IRC, but I've already forgotten what it was
about...
---
 doc/Makefile.local| 7 ++-
 doc/man7/notmuch-search-terms.rst | 8 
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/doc/Makefile.local b/doc/Makefile.local
index bab3d0d286ce..95df9ae82b4f 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -7,8 +7,13 @@ SPHINXOPTS:= -q
 SPHINXBUILD   = sphinx-build
 DOCBUILDDIR  := $(dir)/_build
 
+# Configure options to be added as Sphinx tags.
+# Add "-t " for each make variable in TAGS that equals 1.
+TAGS := HAVE_XAPIAN_FIELD_PROCESSOR HAVE_XAPIAN_COMPACT
+TAGOPTS := $(patsubst %=1,-t %,$(filter %=1,$(foreach 
tag,$(TAGS),$(tag)=$(value $(tag)
+
 # Internal variables.
-ALLSPHINXOPTS   := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(srcdir)/$(dir)
+ALLSPHINXOPTS   := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(TAGOPTS) 
$(srcdir)/$(dir)
 APIMAN := $(DOCBUILDDIR)/man/man3/notmuch.3
 DOXYFILE   := $(srcdir)/$(dir)/doxygen.cfg
 
diff --git a/doc/man7/notmuch-search-terms.rst 
b/doc/man7/notmuch-search-terms.rst
index f7a39ceb9df4..4840f03743aa 100644
--- a/doc/man7/notmuch-search-terms.rst
+++ b/doc/man7/notmuch-search-terms.rst
@@ -451,6 +451,14 @@ notmuch was built against a sufficiently recent version of 
Xapian by running
 
   % notmuch config get built_with.field_processor
 
+.. only:: HAVE_XAPIAN_FIELD_PROCESSOR
+
+   The documentation was built on a host with field processor support.
+
+.. only:: not HAVE_XAPIAN_FIELD_PROCESSOR
+
+   The documentation was built on a host without field processor support.
+
 Currently the following features require field processor support:
 
 - non-range date queries, e.g. "date:today"
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Synchronize tags across machines without a mail server

2019-03-19 Thread Ralph Seichter
* Dan Čermák:

> Ralph Seichter  writes:
>
>> * Pierre Neidhardt:
>>
>>> muchsync (http://www.muchsync.org/): Requires our own mail server if I
>>> understand correctly.
>>
>> No. If you have a machine A with notmuch already set up, and want to
>> sync to machine B, you only need SSH access from B to A (plus notmuch
>> and muchsync installed on B).
>
> That's correct if you are fine with machine B only syncing with machine
> A via muchsync and no longer with your mail servers via IMAP (or at
> least I don't know a way how to make that work).

Sorry for quoting the whole history here, but I don't see how your
comment relates to me stating that muchsync does not require a "mail
server"? If the MTA can deliver into Maildir (like Postfix can), one
does not need an IMAP server at all.

Muchsync can perform both content and metadata synchronisation, which
takes care of my needs. I run it as a background job on my notebook. An
IMAP server can be in the mix somewhere, but is not needed. That's all I
am trying to say.

-Ralph
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Synchronize tags across machines without a mail server

2019-03-19 Thread Dan Čermák
Ralph Seichter  writes:

> * Pierre Neidhardt:
>
>> muchsync (http://www.muchsync.org/): Requires our own mail server if I
>> understand correctly.
>
> No. If you have a machine A with notmuch already set up, and want to
> sync to machine B, you only need SSH access from B to A (plus notmuch
> and muchsync installed on B).

That's correct if you are fine with machine B only syncing with machine
A via muchsync and no longer with your mail servers via IMAP (or at
least I don't know a way how to make that work).

>
> -Ralph
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Synchronize tags across machines without a mail server

2019-03-19 Thread Ralph Seichter
* Pierre Neidhardt:

> muchsync (http://www.muchsync.org/): Requires our own mail server if I
> understand correctly.

No. If you have a machine A with notmuch already set up, and want to
sync to machine B, you only need SSH access from B to A (plus notmuch
and muchsync installed on B).

-Ralph
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH v1 1/1] emacs: Add `notmuch-wash-cut-here'

2019-03-19 Thread David Edmondson
Add `notmuch-wash-cut-here' as a washing function that can be added to
`notmuch-show-insert-text/plain-hook' to excerpt 'cut here' sections,
such as those generated by `message-mark-inserted-region'.
---
 emacs/notmuch-wash.el | 31 +++
 1 file changed, 31 insertions(+)

diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 54108d93..2ca9c108 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -426,6 +426,37 @@ for error."
 
 ;;
 
+(defcustom notmuch-wash-button-cut/here-hidden-format
+  "[ %d-line cut here. Click/Enter to show. ]"
+  "String used to construct button text for hidden 'cut here' sections.
+Can use up to one integer format parameter, i.e. %d."
+  :type 'string
+  :group 'notmuch-wash)
+
+(defcustom notmuch-wash-button-cut/here-visible-format
+  "[ %d-line cut here. Click/Enter to hide. ]"
+  "String used to construct button text for visible 'cut here' sections.
+Can use up to one integer format parameter, i.e. %d."
+  :type 'string
+  :group 'notmuch-wash)
+
+(define-button-type 'notmuch-wash-button-cut/here-toggle-type
+  'help-echo "mouse-1, RET: Show original message"
+  :supertype 'notmuch-wash-button-invisibility-toggle-type)
+
+(defconst notmuch-wash--cut-here-start (concat "^" message-mark-insert-begin))
+(defconst notmuch-wash--cut-here-end (concat "^" message-mark-insert-end))
+
+(defun notmuch-wash-cut-here (msg depth)
+  "Excerpt 'cut here' sections, hiding them by default."
+  (goto-char (point-min))
+  (while (re-search-forward notmuch-wash--cut-here-start nil t)
+(let ((start (match-beginning 0)))
+  (when (re-search-forward notmuch-wash--cut-here-end nil t)
+   (notmuch-wash-region-to-button msg start (point) "cut/here")
+
+;;
+
 (provide 'notmuch-wash)
 
 ;;; notmuch-wash.el ends here
-- 
2.21.0

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Reply inline in notmuch-show buffer, "mu4e-conversation style"

2019-03-19 Thread Pierre Neidhardt
What I did in mu4e-conversation was actually rather simple, albeit a bit
hackish:

- Copy the test from the composition buffer
- Save the window excursion
- Fire up a new message buffer as notmuch-show-reply would produce.
- Cleanup the citation.
- Insert the copied text from the composition buffer.
- Send.

Sadly, mu4e wraps too much around message-mode and this forced me to use
some ugly hacks.  I haven't looked at notmuch's code yet, but it seems
that it does not wrap quite as much, so it might be cleaner and as
simple as a writing a 10-line-longish function.

The "hardest" part is to add a composition area.

Here is the code excerpt from mu4e-conversation:

--8<---cut here---start->8---
(defun mu4e-conversation-send ( msg)
  "Send message at the end of the view buffer.
If MSG is specified, then send this message instead.

Most `mu4e-compose-…' variables are lexically bound during the
call of this function."
  (interactive)
  (unless (mu4e-conversation--buffer-p)
(mu4e-warn "(send) Not a conversation buffer"))
  (let (draft-buf
(buf (current-buffer))
(mu4e-compose-signature mu4e-compose-signature)
;; [More local variables...]
(mu4e-compose-crypto-reply-encrypted-policy 
mu4e-compose-crypto-reply-encrypted-policy))
(run-hooks 'mu4e-conversation-before-send-hook)
(save-window-excursion
  (mu4e-conversation--open-draft msg)
  (condition-case nil
  ;; Force-kill DRAFT-BUF on succcess since it's an implementation
  ;; detail in mu4e-conversation and the composition area is in BUF.
  (let ((message-kill-buffer-on-exit t))
(message-send-and-exit))
;; Stay in draft buffer and widen in case we failed during header check.
(error (setq draft-buf (current-buffer))
   (widen
(cond
 (draft-buf
  (switch-to-buffer draft-buf))
 (mu4e-conversation-kill-buffer-on-exit
  (switch-to-buffer buf)
  (mu4e-conversation-quit 'no-confirm))
 (t
  ;; Delete message that was just sent.
  (goto-char (point-max))
  (mu4e-conversation-previous-message)
  (forward-line)
  (delete-region (line-beginning-position 1) (point-max))
  ;; Ensure it's writable.
  (insert
   (propertize "\n"
   'face 'mu4e-conversation-header
   'rear-nonsticky t))
  (set-buffer-modified-p nil)
  ;; -after-send-hook can be used to update the conversation buffer so that
  ;; it includes the message that was just sent.
  (run-hooks 'mu4e-conversation-after-send-hook)
--8<---cut here---end--->8---

The hackish part is in mu4e-conversation--open-draft, which I'm not
including here because it's long and boring.  Hopefully notmuch.el won't
require us to do this.

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-tree-tag does not support regions

2019-03-19 Thread Dan Čermák
Pierre Neidhardt  writes:

> notmuch-search-tag can tag all the threads in the region.
> notmuch-tree-tag does not, pity :p
>
> I think it would make a lot of sense to make notmuch-tree-tag behave
> like notmuch-search-tag on regions.
>
> Thoughts?

I'd like to have this too, as I have tried to mark a region of mails in
tree view and tag them.

>
> -- 
> Pierre Neidhardt
> https://ambrevar.xyz/
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Foldable "cut here" snippets in notmuch-show

2019-03-19 Thread Pierre Neidhardt
Hi,

It'd be nice if notmuch-show could treat the snippets produced by Emacs'
`message-mark-inserted-region' specially, e.g.:

--8<---cut here---start->8---
foo
--8<---cut here---end--->8---

and make them foldable.

(Note that the enclosing lines are defined in ‘message-mark-insert-begin’
and ‘message-mark-insert-end’.)

Thoughts?

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Reply inline in notmuch-show buffer, "mu4e-conversation style"

2019-03-19 Thread Pierre Neidhardt
Hi,

mu4e-conversation (https://gitlab.com/ambrevar/mu4e-conversation) has a
very nice feature in my opinion: it allows you to compose a reply at the
end of the buffer, in a dedicated "composition area".

- Pressing C-c C-c sends the message (it won't if the message is empty
  or white space).

- Pressing "RET" appends the region to the composition area.  This
  makes it very convenient to *quote/cite from different messages*.
  With a prefix argument, it prepends a citation line (e.g. "John doe 
wrote...").
  This is similar to how messengers like Whatsapp work.
  This is the real killer-feature of mu4e-conversation in my opinion.

What to you people think of adding such a feature to notmuch-show?

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] release: provide clearsigned sha256sum

2019-03-19 Thread David Bremner
To quote id:87ftrpgjdb@fifthhorseman.net

 if the thing verified is the output of sha256sum, then the
 *filename* of the tarball itself is included, then the standard
 verification step will is sufficient to ensure that you've got the right
 version in the filename.

This is in addition to the detached signature on the tarball
---
 Makefile.global | 2 +-
 Makefile.local  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.global b/Makefile.global
index 6e17494a..27c82433 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -43,7 +43,7 @@ RELEASE_URL=https://notmuchmail.org/releases
 TAR_FILE=$(PACKAGE)-$(VERSION).tar.gz
 ELPA_FILE:=$(PACKAGE)-emacs-$(ELPA_VERSION).tar
 DEB_TAR_FILE=$(PACKAGE)_$(VERSION).orig.tar.gz
-SHA256_FILE=$(TAR_FILE).sha256
+SHA256_FILE=$(TAR_FILE).sha256.asc
 GPG_FILE=$(TAR_FILE).asc
 
 PV_FILE=bindings/python/notmuch/version.py
diff --git a/Makefile.local b/Makefile.local
index 01ba49cc..79595925 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -40,7 +40,7 @@ $(TAR_FILE):
@echo "Source is ready for release in $(TAR_FILE)"
 
 $(SHA256_FILE): $(TAR_FILE)
-   sha256sum $^ > $@
+   sha256sum $^ | gpg --armour --clear-sign > $@
 
 $(GPG_FILE): $(TAR_FILE)
gpg --armor --detach-sign $^
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 2/2] release: use xz compression

2019-03-19 Thread David Bremner
This produces tarballs that are roughly 30% smaller.
---
 Makefile.global | 4 ++--
 Makefile.local  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.global b/Makefile.global
index 27c82433..e4dbce48 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -40,9 +40,9 @@ DEB_TAG=debian/$(UPSTREAM_TAG)-1
 RELEASE_HOST=notmuchmail.org
 RELEASE_DIR=/srv/notmuchmail.org/www/releases
 RELEASE_URL=https://notmuchmail.org/releases
-TAR_FILE=$(PACKAGE)-$(VERSION).tar.gz
+TAR_FILE=$(PACKAGE)-$(VERSION).tar.xz
 ELPA_FILE:=$(PACKAGE)-emacs-$(ELPA_VERSION).tar
-DEB_TAR_FILE=$(PACKAGE)_$(VERSION).orig.tar.gz
+DEB_TAR_FILE=$(PACKAGE)_$(VERSION).orig.tar.xz
 SHA256_FILE=$(TAR_FILE).sha256.asc
 GPG_FILE=$(TAR_FILE).asc
 
diff --git a/Makefile.local b/Makefile.local
index 79595925..d16245cb 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -36,7 +36,7 @@ $(TAR_FILE):
--transform s_^_$(PACKAGE)-$(VERSION)/_  \
--transform 's_.tmp$$__' --mtime=@$$ct version.tmp
rm version.tmp
-   gzip -n < $(TAR_FILE).tmp > $(TAR_FILE)
+   xz -C sha256 -9 < $(TAR_FILE).tmp > $(TAR_FILE)
@echo "Source is ready for release in $(TAR_FILE)"
 
 $(SHA256_FILE): $(TAR_FILE)
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch