Commit Graph

44 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 9157d9102d mu4e-utils: refactor into mu4e-helpers, separate files
Usurp more of the utils code than can be re-used without further dependencies in
helpers.

Split off specific parts in their own file.

After the helper/utils changes, update the rest of mu4e to take the changes into
account.
2021-08-29 21:40:42 +03:00
Dirk-Jan C. Binnema 035977a89a mu4e-context: make it a minor-mode
Add mu4e-context-minor-mode, for re-use in other parts of mu4e.

Update those parts + documentation.
2021-08-29 20:30:29 +03:00
Dirk-Jan C. Binnema bfd0618e58 mu4e-context: fix some flycheck warnings 2021-08-29 20:30:29 +03:00
Dirk-Jan C. Binnema f69214b4df mu4e-main: refresh after context-switch
Fixes: #2062.
2021-07-29 23:24:13 +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
Dirk-Jan C. Binnema 1c88651f41 mu4e: remove easy-accounts / no-trash-providers for now
The code still has some problems, and the original author has moved
elsewhere (which is fine of course), but it's not ready enough for
1.4.... yet. So let's remove it for now and check again with 1.5+.
2020-05-18 18:56:15 +03:00
Vu Quoc Huy 1b0d06f706 Fix make-mu4e-context-account
set the correct query for bookmarks when no-trash-flag is used
2020-05-12 00:38:16 +02:00
Dirk-Jan C. Binnema 1919146b94 mu4e: centralize mode-line context setting code
Add mu4e-context-in-modeline to handle all setting of context in the
mode-line, to address some corner-cases with the current setup.
2020-05-01 22:44:45 +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 263e5a160d mu4e: Don't use (mu4e-root-maildir) with easy-accounts
Use an older version, and update the docs.
2020-04-22 09:53:49 +03:00
Dirk-Jan C. Binnema e9fb70e50c mu4e: update documentation
Remove mentions of mu4e-user-mail-address-list.
2020-04-11 22:21:48 +03:00
Thierry Volpiatto ec684cc99c
Update mode-line when changing context
* mu4e/mu4e-context.el (mu4e-context-switch): Do it.
2020-02-21 09:08:48 +01: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
Jonas Bernoulli 15c6680037 mu4e: Add missing mandatory "Code:" section headers 2020-02-18 23:49:50 +02:00
Jonas Bernoulli 83f0c9cea9 mu4e: Remove excess semicolons from library headers
Placing two semicolons on an otherwise empty line helps to logically
"connect" the surrounding "paragraphs", which in (only) some cases
makes sense.

Previously the three paragraphs of the permission statement were not
connected to each other like this, which is perfectly fine.  However
the preceding "This file is not part of GNU Emacs." line was connected
to the first paragraph, which does not make sense considering that the
latter is not connected two the second paragraph, which it relates to
more.

Once those two semicolons are gone, it also makes sense to remove
those from the second line.
2020-02-18 23:49:50 +02:00
Dirk-Jan C. Binnema c09a9c4372 mu4e: update context handling
Make mu4e-context-autoswitch works a before we updated the pong-handler

Avoid unnecessary mu4e~start int he composer.
2020-02-18 22:38:40 +02:00
Jonas Bernoulli 6790c0d015 mu4e: Fix indentation 2020-02-17 14:28:00 +01:00
Dirk-Jan C. Binnema 0b1e6b623e mu4e-context: fix some compiler warnings 2020-02-09 18:07:09 +02:00
Dirk-Jan C. Binnema e1e26d1da2 mu4e: update to use server maildir/database/addresses
Mkae mu4e-maildir and mu4e-personal-addresses obsolete, we get those
from the server.
2020-02-09 00:15:49 +02:00
Thierry Volpiatto 846428cfd4
Unquote lambda's
* mu4e/mu4e-context.el (mu4e-context-switch):         Do it.
* mu4e/mu4e-contrib.el (mu4e-view-mode-hook):         Do it.
(mu4e-headers-mode-hook):                             Do it.
* mu4e/mu4e-icalendar.el (mu4e-icalendar-reply-ical): Do it.
* mu4e/mu4e-utils.el (mu4e~start):                    Do it.
(mu4e-split-ranges-to-numbers):                       Do it.
2020-01-27 08:41:24 +01:00
Vonfry 40d4abc8fb
mu4e: switch mu4e-contexts from defvar to defcustom 2019-12-22 14:54:08 +08:00
Thierry Volpiatto e4f5576cfc
Add lexical-binding to all files and fix warnings
about free variables (declare) and unused lexical vars (prefix with "_").
2019-09-16 19:54:59 +02:00
Nathanael Gentry b710e47d58
mu4e: fix `make-mu4e-context-account` to see `name` keyword arg 2019-07-30 16:47:09 -04:00
Pierre Neidhardt 67a110d2fb mu4e: Add `make-mu4e-context-account' for easy setup with sane defaults 2019-03-04 16:26:55 +01:00
Alex Branham 2674ca5583
mu4e: Replace cl with cl-lib 2019-01-04 16:03:58 -06:00
djcb d98e78548c mu4e: re-draw speedbar when context changes
Folders may have changed.
2018-06-13 14:48:22 +03:00
djcb ceb7f0a8b4 mu4e: fix some typos
Hat-tip: Kelly Dean.
2017-08-13 10:09:03 +03:00
Vladimir Sedach 9420d088eb mu4e: Added new mu4e-split-view mode: single-window
Single-window mode is meant to minimize mu4e window operations (opening,
killing, resizing, etc) and buffer changes, while still retaining the
view and headers buffers. In addition, it replaces mu4e main view with a
minibuffer prompt containing the same information.
2017-05-31 20:52:59 -07:00
djcb 6bde2618ab mu4e: make mu4e-context-current interactive
So it will output the name of the current context when used in an
interactive context.
2017-05-06 13:12:38 +03:00
Stig Brautaset 764b205fe9 mu4e: redraw menu after context switch
This is useful if you change e.g. bookmarks in the context vars and want your
menu to reflect that.
2016-12-03 12:18:07 +00:00
Christophe Troestler cec66211f5 Add a face for displaying the context in the mode-line 2016-08-12 00:11:12 +02:00
Yuri D'Elia 6337151918 mu4e: also quote the context label in the modeline 2016-02-16 08:28:59 +02:00
djcb 967b3cb727 mu4e: update copyright years 2016-01-09 21:28:03 +02:00
djcb b373f8e5f0 mu4e: context policy tweaking
As discussed in issue #751, mu4e should tried to accommodate some
different ways of choosing the context.

We add a new policy `ask-if-none', that will only query the user if
there is no context yet; this is the new default for
mu4e-context-policy, i.e. what happens when entering the main view.

The default policy for mu4e-compose-context-policy is now `ask',
i.e. ask if none of the contexts match.

The idea is for the defaults to ask when we don't know a context, and we
can't determine one using the match functions; this is probably the
least confusing. When user gets annoyed by too many question, they can
tweak the behavior to their liking. I.e. 'ask questions first, shoot
later'

Document all of this.
2016-01-03 13:29:19 +02:00
djcb a085c881ef mu4e: don't change context at startup when there is one
Since people often go start/stop mu4e, we shouldn't try to pick a
default context if one is already set.
2015-12-30 17:39:59 +02:00
djcb 7dff782c58 mu4e: let-bind context vars in mu4e-get-*-folder
When we determine the drafts/refile/trash/sent folder, see if we can
find a context matching the particular message. If we find one, let-bind
the vars for that context before determining the folder.

This allows e.g for moving message to context-specific folder, rather
than the one for the current context - useful when dealing with headers
buffers with message belonging to different contexts.
2015-12-29 18:47:12 +02:00
djcb ed1c7edba3 mu4e: some more context tweaking
Fix some typo, change default for startup to pick-first.
2015-12-24 16:03:55 +02:00
djcb 113c024632 mu4e: implement context-policies
Allow setting a policy about what context to choose when starting mu4e
and composing a message. Basically:

When you have defined contexts and you start mu4e it decides which
context to use based on the variable `mu4e-context-policy';
similarly, when you compose a new message, the context is determined
using `mu4e-compose-context-policy'.

These policies can be one of the following:
- a symbol always-ask: unconditionally ask the user what context to pick

The other choices only apply if none of the context matches (i.e., if
none of the contexts' match-functions returns t:

- symbol ask: ask the user
- a symbol pick-first: pick the first context
- nil: don't change the context
2015-12-23 22:01:51 +02:00
djcb 60192a60d2 mu4e: by default, make changing to current context a no-op
Update mu4e-context-switch to not call the enter/leave functions when
'changing' to the current context. However, calling those functions (if
defined) can be force through a prefix arg. Document this.

Make mu4e-context-determine recognize 'policies', i.e. what to do when
no context matches. This part is WIP.
2015-12-21 22:24:16 +02:00
Foivos S. Zakkak cf3c52d588 Fix mu4e-context-determine to match documentation 2015-12-16 16:51:54 +02:00
djcb a1d0071dd0 mu4e: contexts: auto select one at startup, document
When contexts have been defined, automatically select one at startup --
either the first whose match-function returns non-nil, or simply the
first one.

Document this, too.
2015-12-15 18:20:31 +02:00
djcb c2ddfeacfc mu4e: context: tweaks
Don't clear the caches when switch accounts. Fix some typos.
2015-12-13 18:14:24 +02:00
djcb 47f7f1b85a mu4e: define mu4e-context
Define mu4e-context - a structure with settings and enter/leave
functions for contexts, and some functions for switching between
contexts and auto-detecting them.
2015-12-13 17:45:52 +02:00