Commit Graph

4405 Commits

Author SHA1 Message Date
Nicolas Avrutin eb9bfbb1ca Perform threading calculation on related set instead of entire result.
The current threading algorithm is applied to the entire result of a query, even
if maxnum is specified, and then the result of the threading algorithm is
truncated to maxnum. The improves threading results by returning the entire
thread even when only a single message makes it into the top maxnum results.

This commit applies the threading algorithm to the related message set of the
maxnum-truncated query result instead of to the entire query result. For a given
set of messages, the set of messages which will share threads with any of the
original messages is exactly the related message sets. Put another way, either
any messages returned by the original query but removed by the maxnum truncation
will also be returned by the related message query, or they would not have been
needed anyway because they would not be members of any visible thread.

To maintain backward compatibility and allow threading to be used without
including related messages, the related message set is found for the threading
calculation, but any messages which would not have matched the original query
are then pruned, resulting in a superset of the truncated query, but a subset of
the untruncated query.

This does not improve (or degrade) the run time of a threading calculation when
maxnum is not set, but significant improves it when maxnum is set by making it
scale (roughly) linearly in terms of maxnum. On a maildir with ~200k messages
and maxnum set to 500 (the default), the run time of a threading calculation is
lowered from ~1m to ~0.1s.

Perform threading calculation on related set instead of entire result.

The current threading algorithm is applied to the entire result of a query, even
if maxnum is specified, and then the result of the threading algorithm is
truncated to maxnum. The improves threading results by returning the entire
thread even when only a single message makes it into the top maxnum results.

This commit applies the threading algorithm to the related message set of the
maxnum-truncated query result instead of to the entire query result. For a given
set of messages, the set of messages which will share threads with any of the
original messages is exactly the related message sets. Put another way, either
any messages returned by the original query but removed by the maxnum truncation
will also be returned by the related message query, or they would not have been
needed anyway because they would not be members of any visible thread.

To maintain backward compatibility and allow threading to be used without
including related messages, the related message set is found for the threading
calculation, but any messages which would not have matched the original query
are then pruned, resulting in a superset of the truncated query, but a subset of
the untruncated query.

This does not improve (or degrade) the run time of a threading calculation when
maxnum is not set, but significant improves it when maxnum is set by making it
scale (roughly) linearly in terms of maxnum. On a maildir with ~200k messages
and maxnum set to 500 (the default), the run time of a threading calculation is
lowered from ~1m to ~0.1s.
2018-07-09 02:41:22 -04:00
djcb 4f6fd873fa mu4e: cleanup handler functions 2018-06-30 21:14:00 +03:00
djcb 5f45e014df mu4e: use defvar for handler functions
This allows for a little easier *overriding* them.
2018-06-29 21:33:43 +03:00
djcb 1cb3cbc94d mu4e: fix bbdb doc 2018-06-29 18:08:43 +03:00
djcb 5ccd261771 mu4e: speedbar: use the correct buffer 2018-06-14 11:19:50 +03:00
djcb d106e0e03b mu4e-view: ensure buffer is named *Article* (gnus mode)
Some of the gnus internal code depends on that.
2018-06-13 22:24:47 +03:00
djcb 9bf1670aa1 mu4e: work-around for missing contacts 2018-06-13 18:19:13 +03:00
djcb acb68f5551 mu4e: disable some keybindings for the gnus backend 2018-06-13 16:58:41 +03:00
djcb d98e78548c mu4e: re-draw speedbar when context changes
Folders may have changed.
2018-06-13 14:48:22 +03:00
djcb 0140d433a1 mu4e: update documentation 2018-06-13 13:22:47 +03:00
djcb 36ce14e705 mu4e: view/gnus: support verifying signed mails
Hook up with gnus' verification for signed mails.
2018-06-13 13:22:47 +03:00
Dirk-Jan C. Binnema 4fb5d11d9f
Merge pull request #1243 from avar/render-urls-with-space-before-number
mu4e: view: render URLs as "<url> [%d]" not "<url>[%d]"
2018-06-12 09:23:14 +03:00
Ævar Arnfjörð Bjarmason 6c8aec38be view: render URLs as "<url><zwp>[%d]" not "<url>[%d]"
When we render URLs like https://gnu.org/[1] right-clicking on them in
e.g. GNOME Terminal will also copy the "[1]" as well as the URL,
inserting zero-width-space[1] between the two avoids this.

I know about "g" (mu4e-view-go-to-url), but sometimes I want to open a
URL in a different browser, or copy it into a non-Emacs program. This
makes that easier. I think this improves the UI at a very trivial cost
to users that don't care about this use-case.

I could make this configurable, but unless someone vehemently objects
to this I don't see the point of not just making it the default.

In GNOME Terminal a ZWS is rendered simply as a space, and
copy/pasting works as expected, but in Emacs's GTK GUI there's no
space between the two.

This was initially a plain ASCII space character, but djcb preferred a
ZWP, and this works as well.

1. https://en.wikipedia.org/wiki/Zero-width_space
2018-06-11 22:10:56 +02:00
djcb 8aa6558579 guile: require guile 2.2
Drop support for guile2.0 -- mostly because it's installation is
different enough between distros that it seems a bit too much work to
keep both that and guile2.2 working.
2018-06-11 13:10:29 +03:00
djcb 99df588d41 update compiler warnings, fix them
Update the compiler warnings, and fix all the ones outside the guile/.
2018-06-11 10:49:07 +03:00
djcb dcaad0e473 guile: fix tests
Ensure we have a valid $GUILE_BINARY in the tests.
2018-06-11 10:10:49 +03:00
djcb 2d954e9647 mu: fix strncpy usage
Ensure the resulting strings are \0-terminated.
2018-06-11 09:18:27 +03:00
djcb 088064d5e1 mu4e: define the view-mode when needed
Define the view-mode (gnus or internal) just before it's needed. This
ensures that (when in gnus mode) it's really a gnus-article-mode
derivative, so more of the gnus specifics work.
2018-06-08 10:01:55 +03:00
djcb ee6e91da9b mu4e: auto decode quoted-printable, base64 (gnus)
Set things up so gnus article mode decodes base64 and quoted-printable
messages automatically.

Don't try to set up URL links.
2018-06-07 13:13:37 +03:00
djcb 67eea5fadd guile: add some more m4 for guile detection
We need a few more m4 macros for guile.m4 to work. Hope this is enough.
2018-06-05 17:49:30 +03:00
djcb d01bdfa7b4 mu4e: add decoding support for gnus' article-mode
Decode Gnu's articles as expected; thanks to Lars Ingebrigtsen for his
advice.
2018-06-05 17:42:09 +03:00
djcb cef25610e2 build: include lib-link.m4
This is provided by gnu-lib, but needed for the Guile build.
2018-05-31 21:35:27 +03:00
Dirk-Jan C. Binnema a3c1058654
Merge pull request #1242 from stsquad/patch-application-updates
mu4e: Patch application updates
2018-05-29 11:14:43 +03:00
djcb 143c0d1468 build: add dummy config.rpath
This seems to be necessary for the Guile/autotools machinery to work.
2018-05-29 10:59:20 +03:00
djcb 676589b30a perl: disable build
the perl build is not being used, and is a bit of a pain to maintain.
So, we disable it for now; and remove it at some point in the future.
2018-05-28 13:55:16 +03:00
djcb d8db74d422 build: rework guile setup
Use an update guile.m4; it seems different systems (Fedora, arch,
gentoo, ...) have guile installed under different names. Try to handle
all of those.

For this, we include the upstream guile.m4 and add support for
guile-snarf.
2018-05-28 13:22:13 +03:00
Alex Bennée 79774d4d1b mu4e/mu4e-actions: re-factor apply-patch/mbox
The old code directly hacked around with ido-read-directory to achieve
its smarts. However other completion methods are available so this
re-factors the code to use an appropriately predicated completing-read
with a new history variable which is just used for patch application.
2018-05-25 18:26:59 +01:00
Alex Bennée 67b9ef8384 mu4e/mu4e-actions: optional apply signoff
Maintainers often want to apply patches with their signoff. Support
this with an optional argument.
2018-05-21 18:56:44 +01:00
djcb 426b9a50c7 guile: optionally allow guile2.2 2018-05-21 15:03:58 +03:00
djcb 7a8d43dc5f only use OP_WILDCARD for xapian >= 1.3.3
It's not available for earlier versions.
2018-05-19 22:22:41 +03:00
djcb 6290e4ad9a query-parser: special-case wildcards
We were transforming wild-card searches into regular-expression
searches; while that works, it's also significantly slower.

So, instead, special-case wildcards, and use the Xapian machinery for
wildcard queries.
2018-05-19 11:20:58 +03:00
Dirk-Jan C. Binnema 84376b4aa7
Merge pull request #1241 from jabranham/dont-declare-nil-obsolete
mu4e: Fix call to make-obsolete-variable
2018-05-19 11:19:17 +03:00
Alex Branham 39ec6a0417
Fix call to make-obsolete-variable 2018-05-18 15:52:41 -05:00
djcb b9527245a8 mu4e: minor doc update 2018-05-14 15:44:23 +03:00
Dirk-Jan C. Binnema c2c5dd5939
Merge pull request #1236 from mhcerri/mu4e-orphan-thread-prefix
mu4e: orphan thread prefix
2018-05-11 14:50:01 +03:00
Marcelo Henrique Cerri 94e9795d9d mu4e: Do not assume orphan messages can't appear in the middle of a thread
Do not clear the thread state when an orphan message is found.
2018-05-03 08:27:20 -03:00
Marcelo Henrique Cerri 26cd0a59ff mu4e: use special prefixes to describe orphan threads
Re-use `mu4e-headers-thread-orphan-prefix' for the prefix for the
first sibling in the orphan thread and add
`mu4e-headers-thread-single-orphan-prefix' as the prefix of single orphans.
2018-05-02 23:31:33 -03:00
Marcelo Henrique Cerri d8ca5a3d7b mu4e: remove reference to mu4e-headers-new-thread-style
The docs for the prefix variables mention the variable
"mu4e-headers-new-thread-style" that was removed on a previous
iteration.
2018-05-02 23:04:50 -03:00
djcb 35951da4b5 mu4e: doc: mention aquamacs-autoface-mode
See issue #1230.
2018-05-01 13:12:23 +03:00
djcb c410ebfc45 mu: update copyright year in --version 2018-04-28 09:33:46 +03:00
djcb cd649efb6b mu4e: re-view after marked-as-read
When we mark a message as read, we get an (:update ... ) with the
marked-as-read message (ie., moved from new/ to cur/).

The (:update ...) however does _not_ include extracted images etc.; so
images in unread message would not be visible at that time. To fix this,
to another (:view ...) and extract the images etc.

Thanks to tangxinfa for pointing this out.
2018-04-25 11:35:52 +03:00
djcb bef3113c09 mu4e: factor out mu4e~decrypt-p
Factor out defun to get decryption decision, so we can use it from
elsewhere.
2018-04-25 11:35:52 +03:00
djcb 84afa94fb2 mu4e: do not mark mu4e~view-msg as buffer-local
It's unnecessary.
2018-04-25 11:35:52 +03:00
Dirk-Jan C. Binnema aeb6718da6
Merge pull request #1161 from gambhiro/modeline-max-width
mu4e: shorten modeline str if longer than max-width
2018-04-25 11:32:15 +03:00
Dirk-Jan C. Binnema b9d2046a6e
Merge pull request #1228 from mhcerri/mu4e-improved-thread-prefix
mu4e: improved thread prefix
2018-04-25 09:45:14 +03:00
Marcelo Henrique Cerri adc56249da mu4e.texi: update the header view example with the new thread prefix 2018-04-24 22:34:43 -03:00
Marcelo Henrique Cerri 0b38210549 mu4e: add support for mutt-like thread tree prefix 2018-04-24 22:34:43 -03:00
Dirk-Jan C. Binnema 59e24f0234
Merge pull request #1221 from cacology/master
mu4e: updated fontify-signature for RFC 1153 compliant digest messages
2018-04-24 15:01:22 +03:00
djcb d0671ac3da mu4e: bump minimal required emacs to 24.4
We didn't really support older versions anyway, so let's make it
official.
2018-04-24 14:58:39 +03:00
djcb 260a8bb629 mu4e-view: use Gnus' article mode (experimental)
Add a defcustom `mu4e-view-use-gnus`, which, when `t', use Gnus'
article-mode for displaying messages instead of mu4e's built-in mode.

This is experimental, and a view messages do not display
correctly yet (base64-encoded bodies).
2018-04-24 14:58:39 +03:00