Commit Graph

187 Commits

Author SHA1 Message Date
djcb b31ba3dd81 mu4e: seems the keymaps might not be defined (workaround)
Users were seeing:
,----
| Debugger entered--Lisp error: (wrong-type-argument keymapp nil)
|   signal(wrong-type-argument (keymapp nil))
|   define-key-after(nil [mu4e-hard-newlines] (menu-item "Format=flowed"
| mu4e-toggle-use-hard-newlines :button (:toggle . use-hard-newlines) :help
| "Toggle format=flowed" :visible (eq major-mode (quote mu4e-compose-mode))
| :enable mu4e-compose-format-flowed) sep)
|   mu4e-compose-mode()
|   byte-code("..." [original-msg mu4e-compose-parent-message
| mu4e-compose-context-policy winconf includes att make-local-variable put
| permanent-local t mu4e~context-autoswitch run-hooks mu4e-compose-pre-hook
| current-window-configuration nil (mu4e-draft-open compose-type
| original-msg) ((quit (byte-code "..." [winconf set-window-configuration
| mu4e-message "Operation aborted" throw --cl-block-mu4e~compose-handler--
| nil] 3))) mu4e~draft-insert-mail-header-separator mml-attach-file plist-get
| :file-name :mime-type mu4e~compose-set-friendly-buffer-name
| set-buffer-modified-p (new forward) message-goto-to message-goto-body
| mu4e~compose-type mu4e~compose-hide-headers mu4e-compose-mode delete-frame
| --dolist-tail-- compose-type mu4e-compose-in-new-frame message-exit-actions
| message-postpone-actions] 6)
|   mu4e~compose-handler(new)
|   mu4e-compose(new)
|   mu4e-compose-new()
`----
2016-07-03 23:29:05 +03:00
Thierry Volpiatto fa2427e6f9 Fix window restoration when C-g'ing on reply.
* mu4e/mu4e-compose.el (mu4e~compose-handler):
Save and restore window config.
2016-06-09 07:22:56 +02:00
djcb ed16684f45 mu4e: cosmetics 2016-06-08 19:25:52 +03:00
Christophe Troestler 834b0671c8 Add a menu entry to attach captured messages
Without this menu entry, one has to remember the command name which is
not convenient.  This entry also helps to discover the "capture" feature.
2016-05-10 21:55:54 +02:00
Christophe Troestler d063889e4c Set mu4e-compose-format-flowed to nil by default
Requested by Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> not to disturb
existing users.
2016-05-07 18:12:10 +02:00
Christophe Troestler af523cd05a Add the menu entry in the function defining the mode
This ensures that `(lookup-key message-mode-map [menu-bar text])'
returns a valid keymap.
2016-05-07 03:28:09 +02:00
Christophe Troestler d2ae534ad8 With use-hard-newlines, M-q reformat the paragraph as a single line 2016-05-07 02:58:17 +02:00
Christophe Troestler b6a1e1cef8 Add a menu entry to toggle format=flowed 2016-05-07 02:58:17 +02:00
Christophe Troestler 0d939f6852 By default, compose messages as format=flowed
Fixes https://github.com/djcb/mu/issues/836
2016-05-07 02:58:17 +02:00
djcb 975d270dd3 mu4e: don't strip references for fwd messages
Don't remove the references header for forwarded message because there's
no "in-reply-to"
2016-03-24 20:27:47 +02:00
djcb 2b0d75b295 mu4e: don't use message-kill-actions for closing frames
Seems it is handled by the other actions already, and kills one-too-many
frames.
2016-02-21 16:33:55 +02:00
djcb a0f0e95344 mu4e: better handling of closing compose frames
Use message-mode actions to close the compose
frame (`mu4e-compose-in-new-frame') whenever we're finished editing a
message.
2016-02-20 12:25:21 +02:00
djcb b72db626f3 mu4e: implement resending
Implement the special compose type 'resend', for resending existing
messages, possibly with changes.
2016-02-16 08:29:06 +02:00
Lukas Fürmetz 46ca26457a mu4e: restore window-layout after `message-kill-buffer'
Replaces `message-kill-buffer' with `mu4e-message-kill-buffer'. This new
function is a wrapper around the original. It restores the window-layout
of mu4e after cancelling a message in mu4e-compose-mode.
2016-02-02 21:08:38 +02:00
djcb 144e2a8f1b mu4e: Contact completion - better sorting / display
Improve the contact-sorting algorithm, and make it better cooperate with
completion-at-point functions.

Also deal better with broken rewritten contacts, and document how
rewriting should done (docstrings and reference doc).
2016-01-09 21:27:52 +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 8e43e8cac3 mu4e: use substring when completing contacts
Make substring the first completion strategy.
2015-12-30 17:42:08 +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 f645a12075 mu4e: improve sorting of contacts for completion
set up the extra machinery for making sure emacs does not try to re-sort
our already-sorted contacts.... Also try to improve the sorting strategy
itself.
2015-12-29 18:53:57 +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
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
Foivos S. Zakkak 0032ccf73c When mu4e-context-determine fails, prompt user 2015-12-16 16:51:54 +02:00
djcb 40b8fe138b mu4e: context: auto-detect context using the match function
When composing a new message, attempt to auto-detect the context for
that, using the context's 'match-func'.
2015-12-13 17:46:02 +02:00
djcb a2409b62ca mu4e: when in-reply-to: is removed, remove references: too
When user removes the In-Reply-To header, also remove the (hidden)
References header when sending the message, effectively making the
message appear at the top-level.

Mention in the doc, NEWS.
2015-11-22 12:17:36 +02:00
Foivos S. Zakkak 2cf741e996 Make `mu4e-compose-in-new-frame` always kill frame
When `message-kill-buffer-on-exit` was set to nil mu4e would not close
the new frame.  Closing the new frame should be independent of killing
the buffer.  This patch corrects this.

(relates to #615)
2015-06-07 14:00:20 +03:00
Foivos S. Zakkak 51628e2229 Fix else case in if statement of #615 2015-05-25 16:50:33 +03:00
Pan Jie 64959382b9 Mu4e: add support for composing in a new frame
Adds the variable mu4e-compose-in-new-frame and when set to t, message
are composed in a new frame rather than the current one.
2015-05-24 11:48:37 +03:00
djcb 097b4232e2 mu4e: compose: tells us what you saved when saving a message
Provide the number of lines saved in a draft message
2015-03-21 15:23:35 +02:00
djcb 64ed6e71c1 mu4e: append `substring' to the completion-styles for address-completion 2014-12-06 14:23:55 +02:00
djcb fcdb2c1a04 mu4e: clean up address completion 2014-11-30 16:29:10 +02:00
Foivos S. Zakkak c5fd36a67f Fix replying to gpg encrypted mails (#186) 2014-10-15 02:42:57 +03:00
djcb 34f42e799b mu4e: unbreak sending mail when gnus-agents is unplugged in gnus (#462) 2014-10-12 10:36:33 +03:00
djcb 54a6ef7401 Some documentation fixes
(Thanks to Joe Corneli)
2014-09-23 02:40:35 +03:00
Thierry Volpiatto 2382abddf3 * mu4e/mu4e-compose.el (mu4e~compose-handler): Kill buffer on quit, transformed in defun*. 2014-06-18 15:33:55 +02:00
djcb 5ab30cbc09 * mu4e: don't add rogue \n where re-editing 2014-05-04 10:51:44 -07:00
Thierry Volpiatto 1b8373f438 * mu4e/mu4e-compose.el (mu4e-sent-handler): Honour `message-kill-buffer-on-exit'. 2014-03-28 13:38:46 +01:00
Damien Cassou 8a1d00c436 Use message-signature-separator 2014-01-09 18:18:36 +01:00
Damien Cassou ae25096db6 Better `M-<` and `M->` when composing a message.
This commit provides the following 2 functions that help the user go to
interesting positions at the beginning and end of the message being
composed. These 2 functions are bound to the standard `M-<` and `M->`
keys (or more precisely, to the keys where 'beginning-of-buffer and
'end-of-buffer are bound).

mu4e-compose-goto-top: Go to the beginning of the message or buffer.
  Go to the beginning of the message or, if already there, go to the
  beginning of the buffer.

mu4e-compose-goto-bottom Go to the end of the message or buffer.
  Go to the end of the message (before signature) or, if already there,
  go to the end of the buffer.
2014-01-09 18:16:36 +01:00
djcb 44e92305e3 * mu4e: make sure the sent-hook is only defined as *local* in mu4e-compose 2013-10-22 20:34:43 +03:00
djcb 9c8101d949 * mu4e: centralize some of the fontification code; cleanup signature support 2013-10-20 15:41:47 +03:00
Thierry Volpiatto aa7592d1c3 * mu4e/mu4e-compose.el (mu4e~compose-handler): Wait buffer setup before calling mu4e-compose-mode. 2013-10-17 15:15:14 +02:00
djcb a3b3bafc81 * mu4e: update mu4e-compose-pre-hook documentation 2013-09-28 10:36:57 -07:00
djcb 15936cfd9a * cosmetics 2013-06-16 23:06:38 +03:00
djcb ec28eb340f * mu4e: widen before sending messages 2013-06-14 08:42:44 +03:00
djcb 59d0a30ba6 * make mu4e-compose-hidden-headers a public defvar; implements issue #237 2013-06-08 17:54:35 +03:00
djcb 92ec6f7584 * mu4e-compose: unset the new flags when forwarding/replying to messages; fixes #214. 2013-05-27 04:58:47 -07:00
djcb 52d89bd1f8 * mu4e: fix warning 2013-05-26 12:35:14 +03:00
djcb f01f85d7e7 * mu4e: hide headers again after (widen) 2013-05-22 08:06:19 +03:00
djcb 222d8c3627 * improve message-composition / draft handling 2013-05-21 08:05:06 +03:00
djcb 362bcbda17 * mu4e: fix some weirdness with editing drafts 2013-05-20 06:53:55 +03:00
djcb dfb6382c04 * mu4e-compose: disable org-contacts when completion is enabled 2013-05-15 22:09:17 +03:00
djcb 69e8c1b864 * mu4e: unbreak mu4e~compose-setup-fcc-maybe, in particular, 'delete; 2013-04-23 19:51:45 +03:00
djcb b02e929960 * mu4e-compose: allow mu4e-sent-message-behavior to be a function (thanks to egh) 2013-04-21 12:40:57 +03:00
Sasha Kovar 4e132ef74c mu4e: small doc update 2013-02-21 10:47:03 -08:00
djcb d1a42504b2 * mu4e: surpress compilation warning 2013-01-26 10:58:24 +02:00
djcb 70b20694af * mu4e: try to go back to some mu4e buffer after message composition 2013-01-04 21:40:12 +02:00
Dirk-Jan C. Binnema 17f3ef0c4b Merge pull request #113 from tarsius/custom
* various improvements for 'defcustom' usage and explicitly offer `turn-on-visual-line-mode' as hook function.
2012-12-15 02:42:06 -08:00
djcb a9d3e6e503 * make sure mu4e-compose-parent-message is available in mu4e-compose-mode as
well (thanks to Tsunenobu Kai)
2012-12-15 12:01:50 +02:00
Jonas Bernoulli faa0e6f55f mu4e-sent-messages-behavior: fix custom type defintion 2012-12-12 20:03:36 +01:00
Jonas Bernoulli 17be9ec05a mu4e: autoload major entry points
Autoload functions `mu4e' and `mu4e~compose-mail' and the definition of
the mail-user-agent `mu4e-user-agent'.  The last to are required so
that `compose-mail' can be used without explicitly loading mu4e.

Also require `mu4e' in mu4e-compose.el (after providing mu4e-compose
to avoid a circular dependencies).  This is required because the
autoload definitions only cause mu4e-compose but not mu4e to be loaded
when using `compose-mail', but if mu4e isn't loaded various handlers
are not loaded (and possibly there are other problems if mu4e is not
fully loaded).
2012-11-14 13:48:06 +01:00
Jonas Bernoulli 6424a82d60 mu4e: add function mu4e-user-agent
Without this `mail-user-agent' cannot be set to `mu4e-user-agent'
through customize, as the custom type expects a function.  Not sure
whether this function is actually ever used; if it is then returning
the symbol is probably the correct thing to do, as other such
functions suggest.
2012-11-14 13:48:06 +01: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
Jonas Bernoulli ec106e38bf fix defcustom types and improve their doc-strings 2012-11-09 13:45:19 +01:00
djcb 2e6f8ba015 * mu4e: set mail-header-separator to some sane value 2012-11-04 20:41:09 +02:00
djcb 339d1ff036 * mu4e: refactor part of mu4e-compose into the new mu4e-draft.el 2012-10-31 20:33:46 +02:00
djcb bb8bb20970 * mu4e: mu4e-compose: fix sent-handler when using org, fix remembering draft
maildir, update doc
2012-10-29 12:27:32 +02: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 3e522598d2 * mu4e: cleanup dynamic folder usage in mu4e-compose 2012-10-01 21:18:06 +03:00
djcb 72e043a010 * mu4e: cleanup mu4e-compose-pre-hook a bit 2012-10-01 16:43:47 +03:00
djcb c7bb9aef9a * mu4e: cosmetics 2012-09-28 17:10:34 +03:00
djcb 58b6be1d97 * mu4e: allow functions for special folders (WIP), implement for msg composition 2012-09-27 10:03:58 +03:00
djcb 5c2025a12c * mu4e: mu4e-message part 3 2012-09-26 17:28:30 +03:00
djcb 7d831184b7 * mu4e: abstract access to the mu4e-message plist 2012-09-26 12:25:38 +03:00
djcb ee78475bd8 * mu4e: improve docs for capturing / attaching message (and set them to message/rfc822) 2012-09-25 09:37:37 +03:00
djcb 177cdfe9b9 * mu4e: switch to mu4e-compose-mode as late as possible 2012-09-25 07:10:41 +03:00
djcb 66e89e75fe * mu4e: explicitly set value for mail-header-separator (to prevent user misconfiguration) 2012-09-09 13:16:19 +03:00
djcb e342f9a5c4 * mu4e: use (user-error ..), not (error ..) for user errors 2012-09-06 10:33:53 +03:00
djcb ed516d54d7 * mu4e: improve `mu4e-compose-pre-hook', document it 2012-08-29 18:00:23 +03:00
djcb c17d3911bd * mu4e: add mu4e-compose-pre-hook (WIP, experimental etc.) 2012-08-28 18:57:31 +03:00
djcb 19c6858b3f * mu4e-compose: fix small issue with completion / cosmetics 2012-08-19 09:55:28 +03:00
djcb 8853f0daa5 * mu4e: make address completion case-insensitive 2012-08-16 20:47:36 +03:00
djcb 12226c19c0 * mu4e: make elint-clean 2012-08-14 10:20:27 +03:00
djcb b4443d1eae * mu4e-compose.el: don't add superfluous newlines when saving 2012-07-31 17:03:53 +03:00
djcb f00673e468 * minor 2012-07-24 01:34:06 +03:00
djcb b35f9aa9f8 * mu4e-compose: fix message sending for (near) empty messages 2012-07-23 00:55:12 +03:00
djcb dc62bd6c75 * rename emacs/ => mu4e/ 2012-07-10 20:00:06 +03:00