Commit Graph

138 Commits

Author SHA1 Message Date
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 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 b09b3cb2bb mu4e-main: fix hide-personal-addresses typo
Fixes #1879.
2021-01-03 14:58:28 +02: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 5e069d9a6f mu4e: support regexp patterns for personal addresses 2020-10-17 15:38:24 +03:00
Dirk-Jan C. Binnema 73be015cd0 fixup: mu4e: some cleanups / bytecomp warning fixes 2020-05-28 10:21:16 +03:00
Dirk-Jan C. Binnema 454e8d9a3a mu4e: allow for hiding fully read maildirs/bookmarks
Add a variable mu4e-main-hide-fully-read to control whether to _not_ show
maildir / bookmark links if they're fully read.
2020-05-27 18:56:23 +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 d68c0fd5b5 mu4e-main: decode strings as utf-8
This fixes both bookmarks and maildirs with non-ASCII names. Thanks to
@scturtle for pointing this out!
2020-05-26 23:12:26 +03:00
Sean Farley 9f1e231824 mu4e-main: fix off-by-one error in `mu4e~main-action-str'
For bookmarks, which specify the key combo instead of using the first
character of the string had an off-by-one error in the mouse
highlighting since it wasn't consuming that first letter.
2020-05-26 23:12:26 +03:00
Sean Farley 5110b02349 mu4e-main: use longest bookmark/mailder count in bookmarks section 2020-05-26 23:12:26 +03:00
Sean Farley a070cca79d mu4e-main: add new method for constructing the maildir list
This method is exactly like `mu4e~main-bookmarks' but for maildirs
instead of bookmarks.
2020-05-26 23:12:26 +03:00
Jonas Bernoulli 564d892701 Fix typos 2020-05-12 23:56:55 +02:00
Manuel Argüelles 36701c9336 mu4e: change spacing in main view for info section
Change the spaces to tab to be consistent with the other entries in the
main view.
2020-05-08 11:24:31 -05: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
Dennis Ogbe a153e08edb fix `mu4e-main-buffer-hide-personal-addresses' 2020-04-22 16:55:27 -04:00
Dirk-Jan C. Binnema 26fb011026 mu4e: main: don't use string-join, it's too new
Fixes #1636
2020-04-08 11:26:12 +03:00
Dirk-Jan C. Binnema abafd658d4 mu4e: show mu4e-personal-addresses, add check
Show the personal addresses in the main screen (allow hiding them with
mu4e-main-view-hide-addresses), as well as a check for the case where
user's user-email-address is not part of the personal addresses.
2020-04-06 20:52:24 +03:00
Dirk-Jan C. Binnema 6a294da2a1 mu4e-main: avoid calling mu4e-main-mode multiple times
once is enough
2020-04-05 23:53:55 +03:00
Dirk-Jan C. Binnema faef1792cc mu4e: improve documentation 2020-03-28 11:06:37 +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
Thierry Volpiatto b1369b6ad9
Fix mu4e-main revert-buffer-function and use it
* mu4e/mu4e-headers.el (mu4e~headers-quit-buffer): Refresh main buffer
when done.
* mu4e/mu4e-main.el (mu4e-main-mode-map): Don't bind "g" to mu4e, "g"
should be bound to revert-buffer (special-mode).
(mu4e-main-mode): No need to specify map.
(mu4e~main-view-real-1): New.
(mu4e~main-redraw-buffer): New.
(mu4e~main-view-real): Use them.
(mu4e~main-view): Take one more arg REFRESH.
(mu4e~main-toggle-mail-sending-mode): revert-buffer when done.
2020-02-21 08:33:07 +01: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
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
Jonas Bernoulli 6790c0d015 mu4e: Fix indentation 2020-02-17 14:28:00 +01: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
Dirk-Jan C. Binnema ad5f7d8dad mu4e: make `mu4e` refresh itself
update using the 'ping' function, so read/unread counts get updated.

add a 'g' binding for the main-view.
2020-01-31 00:17:19 +02:00
Dirk-Jan C. Binnema dd98203d42 mu4e: fix some compiler warnings 2020-01-28 01:03:40 +02:00
Thierry Volpiatto b51246d645
Rewrite mu4e~main-bookmarks to have bookmarks aligned
* mu4e/mu4e-main.el (mu4e~main-bookmarks): Do it.
2020-01-27 08:20:58 +01:00
Dirk-Jan C. Binnema 6f1513d187 mu4e: only show unread counts for stringp bookmarks
We can't generally do it for non-constant bookmarks.
2020-01-25 21:42:14 +02:00
Dirk-Jan C. Binnema a4265bb8e9 mu4e: include unread/all counts for bookmarks
Show the unread/all matches counts in the main-view.
2020-01-22 11:42:15 +02:00
Dirk-Jan C. Binnema d2ec85f01c mu4e: use the new command-parser
Update mu4e-proc to use the new mu4e <-> mu protocol
2020-01-22 11:42:15 +02:00
Dirk-Jan C. Binnema 1631d98b9e mu4e: support hiding bookmarks from main-screen/bookmarks
Using the :hide t property on a bookmark plist. The bookmark is still
available throught the completion mechanism.
2020-01-13 23:40:23 +02:00
Dirk-Jan C. Binnema c95cd3c1aa mu4e-main: fix indentation 2020-01-13 23:40:23 +02:00
Dirk-Jan C. Binnema 54c2a15ed0 mu4e: make mu4e-bookmarks items simple plists
We don't need cl-defstruct; simplify things a bit.
2020-01-13 23:40:23 +02:00
Jonas Bernoulli f31d1b065d Fix typos 2019-11-06 16:13:39 +01:00
Thierry Volpiatto 9ddd035a1e
Completely use cl-lib and lexical-binding
Previously both cl-lib.el and cl.el were used, now use only cl-lib.el.
Use lexical-binding where needed instead of requiring cl just for
`lexical-let`.
Replace some add-to-list with cl-pushnew as add-to-list is not
recommended in lisp program and anyway doesn't work properly with
lexical binding.
2019-09-14 12:39:51 +02:00
Alex Branham 2674ca5583
mu4e: Replace cl with cl-lib 2019-01-04 16:03:58 -06:00
djcb aef46ec14f mu4e: add some support for the mux backend 2018-02-11 12:02:53 +02:00
Vladimir Sedach 6017ac46ce mu4e: Update single-window mode
Update mu4e~headers-quit-buffer and mu4e~main-menu.

mu4e~headers-quit-buffer in single-window mode now kills current buffer
instead of quitting mu4e.

mu4e~main-menu is updated to redisplay the main menu on context switch
or unknown keybinding, display errors in commands better, and to handle
C-g and ESC keys.

Thanks to Joost Kremers for the suggestions.
2017-06-24 12:54:21 +02: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 bbdee4e765 mu4e: cosmetics (mu4e-main) 2017-05-06 13:12:38 +03:00
djcb 52ef84ccab mu4e: mu4e-main: don't use obsolete function 2017-01-16 23:44:34 +02:00
Josiah Schwab de2329dbde Replace "focus" with "context"
There were a handful places, primarily in the main menu, where the
word "focus" seemed to be used as a synonym for "context".  This
changes all of those instances to "context".
2017-01-03 17:41:21 +02:00
Antoine Levitt bc13cfda35 dont erase global-mode-string with context label, but add to it 2016-10-26 08:20:25 +02:00
djcb f7be5ef2ff mu4e: make bookmarks a defstruct
Make the structures use for mu4e-bookmarks a defstruct, and update its
usage throughout the codebase. This makes it a bit easier to read and
extend.

Ensure that the old-style bookmarks are automatically converted.
2016-07-31 11:20:59 +03:00
djcb 967b3cb727 mu4e: update copyright years 2016-01-09 21:28:03 +02:00
djcb d3dbed6c1f mu4e: make global-mode-string buffer-local
Make `global-mode-string' local in all buffers where we use it, so we
don't leak the "context" string outside mu4e.

Also add the context string to the compose buffer's modeline.

This fixes #740.
2015-12-19 10:14:49 +02:00
djcb f621003658 mu4e: context: integrate with the views
Show the current context in headers, view and main mode; add
keybindings.
2015-12-13 17:46:02 +02:00
djcb 041a79fdb5 mu4e: add NEWS(.org) as a main menu item 2015-06-09 21:08:02 +03:00
Dirk-Jan C. Binnema 6921c039d0 Merge pull request #580 from DamienCassou/update-mail-in-main-with-same-keys
Make sure C-S-u and C-c C-u work in main view
2015-03-04 06:59:39 +02:00
Damien Cassou d0890a3b0c Make sure C-S-u and C-c C-u work in main view
These 2 shortcuts update mail index in both the headers and view modes
but not in the main view.
2015-02-13 10:47:25 +01:00
Dirk-Jan C. Binnema da3c43e325 Merge pull request #564 from DamienCassou/reindent
Reindent source code to ease future modifications
2015-01-25 23:43:55 +02:00
Damien Cassou fda2db085e Reindent source code to ease future modifications
Only whitespace changes.
2015-01-19 10:53:11 +01:00
Damien Cassou 8a2c40a4b7 Improve queue-related actions of the main view
- The queue-related actions of `mu4e~main-view-real` have been extracted
  to their own `mu4e~main-view-queue` method.
- The queue toggling action now has the word "currently" to easily.
  distinguish between the current state and the toggle (e.g., "currently
  queued" instead of just "queued").
- The "[f]lush queued emails" is only visible if there is at least 1
  email in the queue.
- The number of emails in the queue is visible in the flushing
  action (e.g., "[f]lush 10 queued emails").
2015-01-19 10:41:51 +01:00
djcb 64738b8d4f mu4e: goto point-min after showing main screen 2014-10-30 21:02:18 +02:00
Thierry Volpiatto a4201fe57a * mu4e/mu4e-main.el (mu4e-main-mode): `revert-buffer-function' should be local. 2014-06-16 21:47:04 +03:00
Bosché Aurélien c426bc1621 Fixed the commented example at the end of the mu4e-main.el file.
Now queuing/unqueuing should work fine in any mu4e mode if one executes
those definitions.
2014-05-24 14:44:39 +02:00
Bosché Aurélien 44d44f1a0c Added the forgotten (mu4e-main-mode) 2014-05-24 12:22:47 +02:00
Bosché Aurélien 20e8c9963e Corrected a small bug 2014-05-22 22:49:02 +02:00
Bosché Aurélien edfe1df20a Set revert-buffer-function in the right place 2014-05-21 22:06:57 +02:00
Bosché Aurélien a02947b975 revert-buffer support complete 2014-05-21 21:33:02 +02:00
Bosché Aurélien 118ce389a5 Various little changes 2014-05-21 21:21:02 +02:00
Thierry Volpiatto 92d5ed112b * mu4e/mu4e-main.el (mu4e~main-toggle-mail-sending-mode): Save position when toggling. 2014-03-13 16:12:54 +01:00
Josiah Schwab b29489e272 fix main search shortcut typo 2014-01-31 10:41:56 -08:00
djcb b1e5873f39 * tweak 2014-01-25 20:08:16 -08:00
djcb 5a066de5ff * mu4e-main: fix the main menu regexps 2014-01-25 20:03:37 -08:00
djcb 957c5ceaef * mu4e: fix regexp 2014-01-25 02:48:17 +02:00
djcb a655640e7b * mu4e-main: allow for non-alphanum shortcuts 2014-01-12 13:07:36 +02:00
djcb a92bc970c8 * mu4e: fix faces in the mu4e-main 2013-10-19 13:26:09 +03:00
djcb b92e2d20fd * mu4e: fix some minor things in the main page 2013-10-14 22:30:29 +03:00
djcb 9abaf83fbd * mu4e: don't balk on searches with no results and some cleanups 2013-10-14 00:07:27 +03:00
Thierry Volpiatto ac89861b96 * mu4e/mu4e-main.el (mu4e-interrupt-update-mail): Move to mu4e-utils.el.
* mu4e/mu4e-utils.el (mu4e~interrupt-update-mail): Renamed with mu4e~ prefix and add docstring.
(mu4e--update-buffer-name): same.
2013-10-09 06:38:02 +02:00
Thierry Volpiatto 8da15dc8f2 * mu4e/mu4e-main.el (mu4e-interrupt-update-mail): New function to stop update process.(SIGINT) (mu4e~main-view): Use it and bind it to S.
* mu4e/mu4e-utils.el (mu4e-update-mail-and-index): Fix Window and buffer process.
2013-10-08 14:44:26 +02:00
djcb 401f30ee26 * mu4e: workaround(?) for the issue with '*' in the main action strings 2013-06-16 23:01:06 +03:00
jmickey c24b30984e Spelling fix for smtp-mail-queue-dir
* mu4e/mu4e-main.el (mu4e~main-toggle-mail-sending-mode): correct
  error message to say `smtpmail-queue-dir' instead of
  `smtp-queue-dir'

Signed-off-by: jmickey <jmickey@netapp.com>
2013-02-06 10:44:55 -08:00
Jonas Bernoulli 8a3d4c27de improve doc-strings
The first sentence should summarize the variable's or function's
purpose and it should fit on the first line.  Change existing
doc-string by:

* Move first sentence onto first line even if that makes it _a bit_
  long.
* Move additional notes out of first sentence and add them later,
  possibly as complete sentences.
* If I am uncertain whether doing the above would alter the meaning,
  _don't_ do it.
* If fitting the initial sentence on the first line would require a
  complete rewrite of the doc-string _don't_ do so unless it is very
  easy to do.
* Remove indentation from second and later lines if it is there to
  align them with the first in the source code, instead of in
  `describe-*' output.
* Make "pullet point" lists a bit more consistent.

Obviously this does not fix all problems but it's a start.
2012-11-10 14:01:17 +01:00
djcb f64922e026 * mu4e: update the mail/indexing update process:
- M-x mu4e-update-mail-and-index (C-S-U in main/headers/view/compose, with
  prefix arg, run in background
  - M-x mu4e-update-index to only update the index
  - document / add to FAQ
2012-10-25 11:59:50 +03:00
djcb 5b8de3a97b * mu4e: advertise guile support 2012-10-17 23:36:35 +03:00
djcb e342f9a5c4 * mu4e: use (user-error ..), not (error ..) for user errors 2012-09-06 10:33:53 +03:00
djcb ace830f284 * mu4e: small fix 2012-09-03 10:29:34 +03:00
djcb c8065a0e1b * mu4e: show 'C' in first line of main page to indicate crypto support 2012-09-01 20:05:17 +03:00
djcb 12226c19c0 * mu4e: make elint-clean 2012-08-14 10:20:27 +03:00
djcb dc62bd6c75 * rename emacs/ => mu4e/ 2012-07-10 20:00:06 +03:00