Commit Graph

246 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 411b95acd7 vars: refactor variables
Remove some variables from mu4e-vars, and move them to where they are used.

Move some more items to mu4e-helpers.
2021-08-29 20:30:29 +03:00
Dirk-Jan C. Binnema d7055b7ed8 mu4e-helpers: split off from mu4e-utils
Create a new mu4e-helpers, which will usurp some of the parts mu4e-utils that do
not depend on other parts of mu4e.
2021-08-29 20:30:29 +03:00
Dirk-Jan C. Binnema 17ae356e35 mu4e: Fix up documentation
And remove some unncessary message
2021-08-12 20:34:26 +03:00
Dirk-Jan C. Binnema 6537de1116 mu4e: better feedback for lazy indexing
Add `mu4e-update-index-nonlazy`, point users towards it.
2021-08-12 13:08:52 +03:00
Dirk-Jan C. Binnema b4ebd6c248 mu4e-utils: make schema warning/error a bit clearer
Show in the warning buffer.
2021-07-31 01:49:23 +03:00
Salman Mohammadi 539a946aa4
mu4e/*: fix license notice at the start of source files
At the start of mu4e/* files, the license has been wrongly attributed
to GNU Emacs instead of mu4e.

Fixes https://github.com/djcb/mu/issues/2019
2021-05-29 23:45:10 +02:00
Tassilo Horn b7fb722df6 Add support for bug-reference auto-setup in mu4e-view-mode
The bug-reference mode in Emacs 28 has support for several kinds of auto-setup,
one of them being for mail customizable by the variable
`bug-reference-setup-from-mail-alist`.  Add mu4e support for that so that users
can simply do

    (add-hook 'mu4e-view-mode-hook #'bug-reference-mode)

and have it working.

Also squash one byte-compiler warning about the (at compile-time) undefined
variable `gnus-article-buffer`.

* mu4e/mu4e-utils.el (mu4e-view--try-setup-bug-reference-mode): New function.
2021-05-28 23:33:08 +02:00
Dirk-Jan C. Binnema 3799975714 mu4e-view: only kill existing buffer 2021-04-25 14:05:27 +03:00
Dirk-Jan C. Binnema 2437dc27c9 mu4e: Replace mu4e-view-use-gnus with mu4e-view-use-old
Make mu4e-view-use-gnus obsolete (it's the default now), and add a
variable mu4e-view-use-old (which must be set before starting mu4e).

Update documentation / mentions.

Load the correct view when starting mu4e, so people can customize
e.g. the keymap.

Add some sanity checking.
2021-03-16 19:57:36 +02:00
Dirk-Jan C. Binnema 8d1175f511 mu4e: avoid some compiler warnings
(require) necessary things etc.

warnings for using "obsolete" code are still there since things should
work on emacs 25.3
2021-03-11 10:17:00 +02:00
Yuri D'Elia c311dc4d36 Fix 'mu4e-interrupt-update-mail alias definition 2021-01-11 10:23:55 +02:00
Tassilo Horn e76f894476 Fix Selecting deleted buffer when quitting mu4e 2021-01-03 12:54:13 +01:00
Tassilo Horn fe6cbf5949 Use mu4e-query-rewrite-function also for computing bookmark counts
Until now, the bookmark queries were sent to mu in their original form.  Thus,
if you have `mu4e-query-rewrite-function` set, the numbers shown next to the
bookmarks didn't reflect the actual number of query results you'd get when
opening a bookmark view.

With this commit, the `mu4e-query-rewrite-function` is applied and the result
is sent to mu for evaluation (in `mu4e~start`) and the likewise the rewritten
queries are used to find the matching one in the last query results (in
`mu4e~main-bookmarks`).

* mu4e/mu4e-utils.el (mu4e~start): Send the rewritten queries for evaluation to
mu.
* mu4e/mu4e-main.el (mu4e~main-bookmarks): Compare last mu query results with
rewritten queries.
2020-12-13 17:06:11 +01:00
Dirk-Jan C. Binnema 273eb822d5 mu4e: add mu4e-last-query-result[s]
This makes the most recent results from the queries (i.e. the numbers)
available using the supported 'mu4e-' API.

Fixes: #1845.
2020-12-06 14:48:46 +02:00
Dirk-Jan C. Binnema aba0ab3629 mu4e: cosmetics 2020-12-06 13:20:13 +02:00
Dirk-Jan C. Binnema 4985f5c959 mu4e: Improve personal-address handling
Make mu4e-personal-address-p safe for being called with nil.

Upgrade code that used mu4e-user-mail-address-p to
mu4e-personal-address-p.

Update docs.

Add some more helpers to mu4e-message, and avoid some byte-compiler
warnings.
2020-10-19 22:39:25 +03:00
Dirk-Jan C. Binnema 3937b70f13 mu4e: use sorted list in mu4e-contacts-info
Sort by rank.
2020-10-18 12:53:43 +03:00
Dirk-Jan C. Binnema 5e069d9a6f mu4e: support regexp patterns for personal addresses 2020-10-17 15:38:24 +03:00
Dirk-Jan C. Binnema de8f1d3e6a mu4e: Fix issue with mu4e-display-image
We were getting an error when `identify` is nil.
2020-07-11 10:14:57 +03:00
Dirk-Jan C. Binnema 2b5a747fad
Merge pull request #1746 from mrvdb/mu4e-image-scale
Satisfy both max height and width for images in view
2020-07-07 00:14:51 +03:00
Alex Bennée 5040d52b46 mu4e/mu4e-utils: save-excursion before updating the log buffer
If the user is scrolling and searching through the log buffer to see
what went wrong it gets very annoying having an update change things.
To avoid this wrap all buffer updating code in a save-excursion so
point is preserved.
2020-07-06 20:32:27 +01:00
Alex Bennée 8bc622ff09 mu4e/mu4e-utils: refactor mu4e-log buffer creation
Move all the one time setup for mu4e-log into its own private section.
2020-07-06 20:27:13 +01:00
Marcel van der Boom c698bc3a40 Satisfy both max height and width for images in view
- introduce private function mu4e~image-width-scale:
    determine the width to use for proportional scaling based on the image width, height and the max
    restrictions.
- use it in mu4e-display-image
2020-07-03 16:02:09 +02:00
Alex Bennée c074e7ea3b mu4e/mu4e-utils: only set so-long-mode once
Ideally we should separate the log buffer creation code so this van be
done a bit more cleanly. For now however only set so-long-mode once
otherwise you end up spamming the messages with constant:

  Changed to so-long-mode (from fundamental-mode) on account of line length.  C-c C-c to revert. [36 times]

As the messages keep rolling in.
2020-06-29 10:26:34 +01:00
Dirk-Jan C. Binnema 5ca0b6e148 mu4e-utils: use so-long-mode for logs when available 2020-06-26 19:25:45 +03:00
Dirk-Jan C. Binnema e37486fb5a mu4e: auto-enable logging when pressing '$' 2020-06-13 16:56:41 +03:00
Dirk-Jan C. Binnema ee99176fce mu4e: mu4e-info is not interactive 2020-06-08 19:52:19 +03:00
Dirk-Jan C. Binnema 5fdb205b8b mu4e: Update for sexp format changes 2020-06-06 14:27:25 +03:00
Dirk-Jan C. Binnema 73be015cd0 fixup: mu4e: some cleanups / bytecomp warning fixes 2020-05-28 10:21:16 +03:00
Sean Farley 3ea1784aad mu4e-main: use `string-width' over `length'
Better for utf-8 but still difficult to align due to non-monospaced
characters.
2020-05-26 23:12:26 +03:00
Sean Farley 41f0c5a92a mu4e-utils: add method to count the longest name
Consolidates the logic for looping over bookmarks and maildirs so that
we can compute the longest name.
2020-05-26 23:12:26 +03:00
Sean Farley c2b0d2db6e mu4e-utils: send maildir queries along with bookmarks
When `mu4e-main-show-maildirs' is non-nil, we append the list of maildir
queries to the mu server.
2020-05-26 23:12:26 +03:00
Sean Farley a899dd04f7 mu4e-utils: add new method to transform `mu4e-maildir-shortcuts'
This will allow iterating over `mu4e-maildir-shortcuts' the same way as
`mu4e-bookmarks' (i.e. adding :name and :query to the plist).
2020-05-26 20:57:40 +03:00
Dirk-Jan C. Binnema 57d38aa707 mu4e: honor truncate-string-ellipsis
Use truncate-string-to-width and thus honor truncate-string-ellipsis; so
to get 'fancy' ellipsis, one can set:
   (setq truncate-string-ellipsis "…")
2020-05-25 18:34:42 +03:00
Derek Upham bb865fd1af Strip properties from mu4e-completing-read-function results.
Some completion engines (like "flx") decorate the strings that they
return.  If MU4E passes such a string down to MU, the "format" call
preserves the text properties in the generated S-expression, producing
an invalid query.  MU4E itself has no interest in those decorations,
so strip them out as early as possible from all prompts that use
mu4e-completing-read-function.
2020-05-18 08:12:56 -07:00
Dirk-Jan C. Binnema 05dc6333c3 mu4e-format: decode strings to utf8
Thanks to thierryvolpiatto

Fixes #1676.
2020-05-05 22:14:53 +03:00
Dirk-Jan C. Binnema 0f5f6c4e13 mu4e: ask for context in mu4e~start
This is a little risky, but it avoids the case where the
context-question is hidden by the response from the server ("blabla
contacts" etc.)
2020-04-27 21:51:23 +03:00
Dirk-Jan C. Binnema cdddb816e4 mu4e: increase max log size, use ms timestamps 2020-04-04 15:40:45 +03:00
Abdo Haji-Ali 33694814fc Save window selection after updating the index 2020-03-29 22:07:25 +01:00
Dirk-Jan C. Binnema 935874dfc3 mu4e: make logging a bit faster 2020-03-28 11:06:37 +02:00
Dirk-Jan C. Binnema c4953a4310 mu4e-utils: select mu4e-main-window when refreshing
Fixes #1613.
2020-03-11 20:47:25 +02:00
Dirk-Jan C. Binnema 1c1dbaf882 mu4e: make mu4e-main-buffer-name a defvar
(and rename from mu4e~main-buffer-name)
2020-02-28 12:17:13 +02:00
Dirk-Jan C. Binnema 7e58f21f48 mu4e-utils: add mu4e-copy-message-path helper 2020-02-26 21:56:01 +02:00
Dirk-Jan C. Binnema 3fe437985f utils: explicitly decode contacts string
Seems emacs doesn't know yet they're utf-8.

Fixes #1589.
2020-02-25 23:57:50 +02:00
Dirk-Jan C. Binnema 74d40f4d20 mu4e: make mu4e-maildir-shortcuts a plist
Similar to mu4e-bookmarks.
2020-02-25 21:20:51 +02:00
Thierry Volpiatto b301b7663b
Don't use mu4e-index-updated-hook in mu4e~start
Using mu4e-index-updated-hook in mu4e~start with a lambda is just like
adding the call to mu4e-info-handler so do it explicitely which is
much cleaner.

* mu4e/mu4e-utils.el (mu4e-info-handler): Always refresh main buffer.
(mu4e~start): Remove insertion of mu4e-index-updated-hook.
2020-02-21 08:54:16 +01:00
Dirk-Jan C. Binnema e10fc21a9b mu4e: Rename 'Unnamed' sections 2020-02-18 23:49:50 +02:00
Jonas Bernoulli 74332947a0 mu4e: Split libraries into outline sections 2020-02-18 23:49:50 +02:00
Jonas Bernoulli 040c6578be mu4e: Place provide forms in their own sections
Use "_" as the title of that section so that it is less distracting
when sections are collapsed to get an overview of the library.

Using a separate section is useful because it reduces the risk of
accidentally into the middle of a library.
2020-02-18 23:49:50 +02:00
Jonas Bernoulli 6c58a311d1 mu4e: Add missing mandatory "FILE ends here" library footer 2020-02-18 23:49:50 +02:00