Commit Graph

85 Commits

Author SHA1 Message Date
Jean-Philippe Bernardy 73b87c16f7 mu4e: Make :show-target be the identity by default
- This is certainly a better default than crashing
- The user is likely to omit this function in a majority of cases.
2014-11-30 23:13:00 +01:00
Jean-Philippe Bernardy 28baa5a778 Fixed typo 2014-11-30 13:33:30 +01:00
Jean-Philippe Bernardy f6e5f3df7f pass the message structure to the mark actions
This allows to re-tag a message in a mark action.

Two examples of what one can do with this stuff:

1. G-mail archiving:
(archive
   :char       "a"
   :prompt     "archive"
   :show-target (lambda (target) "archive")
   :action      (lambda (docid msg target)
                  (mu4e~proc-move docid nil "-N")
                  (mu4e-action-retag-message msg "-\\Inbox")))

2. Tagging:
(tag
  :char       "g"
  :prompt     "gtag"
  :ask-target (lambda () (read-string "What tag do you want to add?"))
  :show-target (lambda (target) target)
  :action      (lambda (docid msg target)
                 (mu4e~proc-move docid nil "-N")
                 (mu4e-action-retag-message msg (concat "+" target))))
2014-11-30 13:33:29 +01:00
Jean-Philippe Bernardy a6c4785577 fix the target display
show the target when the shown-target is non-nil (not the target).
2014-11-30 13:33:29 +01:00
Jean-Philippe Bernardy 818eedf59f mu4e: marks: clarify the way targets are obtained.
:get-target is split into:
- :ask-target (run once per bulk operation)
- :dyn-target (run once per message)

A side benefit is that the existence of the target of a move is not
checked for every message when doing bulk moves.
2014-11-27 19:16:05 +01:00
Jean-Philippe Bernardy 3981f5412f documentation fix 2014-11-27 19:16:05 +01:00
Jean-Philippe Bernardy ad8488368b always recompute the dynamic target for a mark
This is a bug fix. Previously, recomputing was done only for refile,
which is wrong: trash target can also be dynamic, and we want to allow
the user to configure more dynamic targets.
2014-11-27 19:16:05 +01:00
Jean-Philippe Bernardy a1181aa096 Put the definitions of marks in a single structure
This commit puts all what defines a mark (how to display, how to handle
targets, what action to apply, ...) in a single entry of a list. The list
is stored in a variable.
This should allow for customization of marks.
2014-11-26 21:39:17 +01:00
mjn c99ccf9a19 Lightly copyedit the documentation and docstrings 2014-08-08 13:18:29 +02:00
djcb bfda09028b * mu4e: fix byte-compiler warning 2013-12-16 21:59:47 -08:00
djcb 06b3142e60 * mu4e: check marks also when coming from mu4e-main; fixes issue #244 2013-06-29 13:06:51 +03:00
James Felix Black 7e78b6eb65 added a "untrash" function, perfectly analogous to "unflag", that simply removes the T flag from a message 2013-06-28 12:36:54 -07:00
djcb fa514435ea * merge branch 'master' of github.com:djcb/mu 2013-06-13 23:56:35 +03:00
djcb c581468ac3 * mu4e: some minor changes 2013-06-13 23:53:11 +03:00
djcb 74feeded3b * mu4e: check marks in headers context (fixes issue #200) 2013-06-08 17:32:10 +03:00
djcb 4de859668c * cosmetics 2013-05-13 00:05:14 +03:00
Wataru MIYAGUNI 522f4104f9 Change refile target in region email.
Now, mark commands with region on headers view,
target of the first email is reflected in the rest of email.

```
              Date         From     Subject
--------------------------------------------
              2012-12-05   Github   ...
              2012-12-05   Yahoo!   ...
              2012-12-05   Work     ...

  refiling to

              Date         From     Subject
--------------------------------------------
r -> /github  2012-12-05   Github   ...
r -> /github  2012-12-05   Yahoo!   ...
r -> /github  2012-12-05   Work     ...
```

In this patch, change target in region email.

```
              Date         From     Subject
--------------------------------------------
r -> /github  2012-12-05   Github   ...
r -> /yahoo   2012-12-05   Yahoo!   ...
r -> /work    2012-12-05   Work     ...
```
2012-12-05 16:46:12 +09: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 feba2bb377 * mu4e: fix target == nil case in mu4e-mark-set (thanks to Jonas Bernoulli)
Previously when TARGET was nil, point was moved which changed the
region that is later used to determine the messages to be marked.
2012-10-29 12:25:07 +02:00
djcb dc5f27c899 * mu4e: check for marks when auto-updating (don't do it if there are any) 2012-10-24 23:49:26 +03:00
djcb f0caaa6e7c * mu4e-mark: fix thread-based marking for marks with targets 2012-10-13 22:13:17 +03:00
djcb fff5113f98 * mu4e: fix mu4e marking / regions 2012-10-09 18:30:56 +03:00
djcb f334e7ae71 * mu4e: fixup directory creation 2012-10-09 00:15:02 +03:00
djcb 23fc0b4a63 * mu4e: offer to create target dirs when they do not exist yet 2012-10-09 00:03:24 +03:00
djcb 0eada7c9ba * mu4e-mark: fix ambiguous shortcuts in `mu4e~mark-get-markpair' 2012-10-06 22:21:16 +03:00
djcb a9f555fc90 * mu4e: use <insert> as binding for deferred ('something') marking, just like
midnight commander
2012-10-06 20:47:59 +03:00
djcb 679a214ba0 * mu4e: mu4e-mark: mark all messages in region, even if point does not point
at msg
2012-10-01 21:37:26 +03:00
djcb 5779820ba0 * mu4e: dynamic folder updates 2012-09-27 21:53:21 +03:00
djcb dde75fbb86 * mu4e: implement automatic refiling with 'r' 2012-09-27 12:53:16 +03:00
djcb bd0cba007b * mu4e: allow functions for special folders, implement for marking (WIP) 2012-09-27 12:01:26 +03:00
djcb 5c2025a12c * mu4e: mu4e-message part 3 2012-09-26 17:28:30 +03:00
djcb e342f9a5c4 * mu4e: use (user-error ..), not (error ..) for user errors 2012-09-06 10:33:53 +03:00
djcb e77abbeb29 * mu4e: fix mu4e-mark-handle-when-leaving (mu4e-headers-leave-behavior) 2012-08-17 08:34:08 +03:00
djcb dc62bd6c75 * rename emacs/ => mu4e/ 2012-07-10 20:00:06 +03:00