Commit Graph

403 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema b7b97212ce mu4e: move search functionality to mu4e-search
Move out of mu4e-headers; rename variables and callers.
2023-01-01 15:01:08 +02:00
Dirk-Jan C. Binnema 155d7be1d4 mu4e-view: "detach" headers view when quitting in single-window mode
Otherwise the headers view seems to get confused (thinking it is still
showing a message).
2022-12-28 20:59:20 +02:00
Dirk-Jan C. Binnema fe88890419 mu4e-view: update mu4e-view-fields
Remove obsolete fields; update docstring.
2022-12-24 15:28:46 +02:00
Dirk-Jan C. Binnema 1799c69451 mu4e-view: rename mu4e~view -> mu4e--view
Our long-running migration from mu4e~ -> mu4e-- takes another step.
2022-12-24 10:02:21 +02:00
Dirk-Jan C. Binnema 3568e6784a mu4e~view-in-headers-context: don't display buffer
Displaying the buffer doesn't look very nice in single-window mode.
2022-12-19 23:24:40 +02:00
Dirk-Jan C. Binnema fcda5dcc5f mu4e-view: Re-add mu4e-view-quit
Add special handling for single-window/other for view buffer quitting

Fixes #2386.
2022-12-19 23:00:49 +02:00
Dirk-Jan C. Binnema 34815a1961 mu4e: use mu4e-view-rendered-hook
Instead of the older mu4e-after-view-message-hook; update version where
it go obsolete.
2022-12-15 11:52:50 +02:00
Dirk-Jan C. Binnema 83ed407dbc mu4e-view: use kill-buffer-and-window
...for the last remaining mu4e~view-quit-buffer.

Fixes issue #2381
2022-12-15 11:47:12 +02:00
Dirk-Jan C. Binnema 56d8f4cd25 mu4e: rename mu4e-after-view-message-hook into mu4e-view-rendered-hook
For consistency.
2022-12-15 00:05:26 +02:00
Dirk-Jan C. Binnema 00d3e9208d mu4e-view: whitespace fixes 2022-12-15 00:05:11 +02:00
Tassilo Horn cbeed9ef28 bug-reference: Add clarifying comment / checked-headers as variable 2022-12-14 18:34:24 +01:00
Dirk-Jan C. Binnema fdbf912e06 mu4e-view: use kill-buffer-and-window for quitting
That restores the classic mu4e style. I.e.,

With default settings, e.g.

    case 1: - (1)go to inbox -> (2)see headers -> (3)open message ->
    window splits -> (4)read message -> (5)'q' . Window closes and we're
    back to (2). All good!

The more complicated step is

    case 2: (4) read message -> (5) reply to message -> (6) done
    replying -> back to (4) but for some reason when pressing 'q' now,
    the window is not closed, but replaced by the headers window (so we
    have 2 now. [ I think it should behave just like in case 1 ]

This fixes that.
2022-12-13 23:50:38 +02:00
Dirk-Jan C. Binnema 9ae567f5f5 mu4e-view: whitespace cleanup 2022-12-13 23:49:57 +02:00
Dirk-Jan C. Binnema 85f60647b9 mu4e-view: bind 'P' to mu4e-headers-toggle-property
And remove the obsolete older mu4e-headers-toggle-*.
2022-12-11 13:54:57 +02:00
Dirk-Jan C. Binnema ff9fc73e5a mu4e-view: whitespace/newline fixes 2022-12-11 13:31:13 +02:00
Mickey Petersen 8ac172cd08 Resize headers window after displaying a message 2022-12-03 17:13:20 +00:00
Mickey Petersen d43c0030e3 Ensure the linked headers buffer state is not lost 2022-12-03 17:13:20 +00:00
Mickey Petersen 32aefe508f Correct documentation 2022-12-03 17:13:20 +00:00
Mickey Petersen 37e8328975 mu4e-loading-mode is now a minor mode 2022-12-03 17:13:20 +00:00
Mickey Petersen 514b921813 Render with current buffer set to the view 2022-12-01 07:34:22 +00:00
Mickey Petersen 3b44ad9514 Ensure the windows belonging to the now-defunct view buffer are destroyed 2022-11-30 15:33:41 +00:00
Mickey Petersen d6c67a401d Check for detached view in the navigation context macro 2022-11-30 15:33:07 +00:00
Mickey Petersen 69a17bfcb9 Multiple buffer support and standardised window and buffer handling 2022-11-29 11:33:07 +00:00
Aleksei Atavin 0f097e00c6
mu4e: temporary reset browse-url-handlers in view in xwidget action
If `browse-url-handlers` is set `mu4e-action-view-in-xwidget` function
tries to open url in the handler first instead of xwidget. This is
happening because `browse-url` first checks `browse-url-handlers` and
`browse-url-browser-function` after.

Signed-off-by: Aleksei Atavin <axeoman@gmail.com>
2022-10-28 22:52:16 +03:00
Dirk-Jan C. Binnema 7f0497638c
Merge pull request #2329 from seanfarley/smf/save-excursion-html
mu4e-view: use `save-excursion' around toggling html
2022-09-08 07:04:04 +03:00
Sean Farley 243b862776 mu4e-view: use `save-excursion' around toggling html
Previously, the cursor would be moved to the first html attachment which
would break using mu4e keybindings (e.g. delete). With this change, the
cursor isn't moved at all, presumably the expected behavior.
2022-09-03 17:01:41 -05:00
Dirk-Jan C. Binnema 68753f9e84 mu4e: move all obsolete aliases to mu4e-obsolete
Unclutter the rest of the code a bit.
2022-08-20 14:24:24 +03:00
Dirk-Jan C. Binnema 46476fc001 mu4e: add mu4e-copy-thing-at-point
Copy the thing (url or email) at point, similar to the feature in the
pre-gnus view. Bind to 'c' in the message-view.
2022-07-13 23:35:16 +03:00
Dirk-Jan C. Binnema 7b83605019 mu4e-view: fix naming of temp files 2022-06-07 23:06:33 +03:00
Dirk-Jan C. Binnema 59022e066d mu4e: revamp emacs bookmark support
The support for emacs in bookmarks in mu4e-contrib has been broken for a while;
we removed it an now re-implement it as part of mu4e-proper.

Fixes: issue #2255.
2022-05-29 12:31:39 +03:00
Dirk-Jan C. Binnema a1f0c5e9eb mu4e: fix emacs-29 bytecompiler warnings
Wrong single quotes.
2022-05-28 00:51:08 +03:00
Dirk-Jan C. Binnema aea2f58c77 mu4e: add command mu4e-sexp-at-point
Add command ~mu4e-sexp-at-point~ for showing/hiding the s-expression for the
message-at-point. Useful for development / debugging. Bound to ~,~ in headers and
view mode.
2022-05-14 20:45:33 +03:00
Tassilo Horn 34fe094561 Simplify mu4e-view-mode-map creation and fix `-` binding
`mu4e-view-mode-map` was initialized from a sparse keymap and eventually passed
to `suppress-keymap` in order to remove bindings to `self-insert-command` which
obviously make no sense in read-only buffers.  However, `suppress-keymap` also
remaps all digits and the minus sign to make prefix args, i.e., pressing 8
would be equal to `C-u 8` and `-` got bound to `negative-argument` instead of
`mu4e-view-mark-for-unflag` as defined.

While `suppress-keymap` has a `NODIGITS` arg to suppress the rebinding of
digits and minus sign (which would also mean that pressing a digit would try
inserting that digit and lead to an error), I chose the more straight-forward
solution and start from an empty rather than a sparse keymap and added the
`digit-argument` bindings for 0..9 explicitly.
2022-05-11 21:08:47 +02:00
Dirk-Jan C. Binnema 48311ea18d mu/mu4e: tweak :list vs :mailing list 2022-05-07 20:48:21 +03:00
Tassilo Horn 0baa735f18 Allow a function as mu4e-view-open-program 2022-04-29 14:03:05 +02:00
Dirk-Jan C. Binnema 20568cba70 mu4e-view: open tmp files read-only
When using the "open-in-emacs" handler, open the temp file as read-only. It's a
temp file, so editing isn't very useful.
2022-01-24 19:00:19 +02:00
Dirk-Jan C. Binnema a4707afe12 mu4e: cleanups and flycheck fixes
- Remove some unused faces
- Fix some flycheck warnings
- Replace some `cl-` functions with `pcase` and `seq`
2022-01-23 14:27:00 +02:00
Dirk-Jan C. Binnema e5ead56b2a mu4e-view: fix flycheck warnings
Let's make things clean.
2022-01-15 12:00:27 +02:00
Dirk-Jan C. Binnema 904214ba17 mu4e-view: double-check message file exists
So we can warn user early.
2022-01-15 10:20:32 +02:00
Dirk-Jan C. Binnema b072b4a57e mu4e-view: Add defcustom mu4e-view-open-program
When xdg-open is not enough.
2022-01-12 22:32:21 +02:00
Dirk-Jan C. Binnema 324b6f5022 mu4e-view: experiment xwidget support
Add experimental support for displaying html messages in an xwidget; this
doesn't work for all messages.
2022-01-10 22:07:06 +02:00
Dirk-Jan C. Binnema 42d5cde612 mu4e-view: catch epg error
Give a bit more user-feedback when e.g. EPG fails to decrypt a message.
2022-01-09 14:08:24 +02:00
Dirk-Jan C. Binnema bbf55256e5 mu4e-view: add massage toggle for text filling
For some mis-rendered messages, it can be useful to toggle filling, so add this
as an massage ('M') option.
2021-12-25 11:01:33 +02:00
Dirk-Jan C. Binnema 8dcdd0a815 mu4e-view: add toggle to show all mime-parts
Add a toggle to show (links for) all top-level MIME-parts, so you can e.g.
perform actions on 'inline' images.
2021-12-19 23:15:42 +02:00
Dirk-Jan C. Binnema 4a0490acbf
Merge pull request #2152 from progfolio/fix/osbolete-fn
mu4e-search-edit: Fix obsolete alias; update documentation
2021-10-13 14:47:48 +03:00
Dirk-Jan C. Binnema 5db8fdc49d mu4e: Do not defvar abbrev tables
I'm not quite sure why it was done in the first place, and it seems to have
unwanted side-effects. So let's turn it off and see if anything breaks.

Fixes: #2146.
2021-10-06 08:11:30 +03:00
Nicholas Vollmer baae737674 mu4e-search-edit: Fix obsolete alias; update documentation
Replace obsolete variable alias with obsolete function alias for mu4e-headers-search-edit.
Update docstring for mu4e-view-search-edit to reference the new function.
2021-10-03 10:33:49 -04:00
Thierry Volpiatto a6207d6d08
Reset `gnus-article-buffer` in mu4e-view
This is needed when gnus is used along mu4e for other purpose like
reading News, in this case gnus rename `gnus-article-buffer` and we
end up with an unrelated buffer-name in mu4e.
2021-09-30 16:56:46 +02:00
Dirk-Jan C. Binnema 162f5896ae mu4e-view: port of save-attachment fix
Port of #b349b24 (courtesy of danielfleischer) to not fail to detect attachments
in certain messages.
2021-08-30 18:35:35 +03:00
Dirk-Jan C. Binnema dc14f93c06 mu4e: remove mu4e-utils
No longer needed; remove all traces.
2021-08-30 08:36:41 +03:00
Dirk-Jan C. Binnema 42f2e73025 mu4e-view: remove overlays when erasing
erase-buffer is not enough (you'd see '[1][2]' etc. in the buffer beginning)
2021-08-29 21:40:42 +03:00
Dirk-Jan C. Binnema a6514fd683 mu4e-server: rename from mu4e-proc
Rename mu4e-proc.el into mu4e-server.el

Rename mu4e~proc... into mu4e--server...

Update users, too.
2021-08-29 21:40:42 +03:00
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 e6be09e626 mu4e-view: remove old view
Remove the pre-Gnus view, and remove the infrastructure to handle both the new
and old views.
2021-08-29 20:30:29 +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 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 e2655ba34b mu4e-view: re-enable the gnus/old split
re-enable the gnus/old split (the key was re-implementing
mu4e-view-message-text for gnus)

split helpers into mu4e-view-common

as a bonus 'go to url' now also works with gnus
2021-03-10 20:53:33 +02:00
Dirk-Jan C. Binnema 316633e1b2 mu4e: unsplit the gnus/old views
Was not quite working.
2021-03-07 23:27:45 +02:00
Dirk-Jan C. Binnema f002379a87 mu: move mu-view-fields to mu-view.el
We need it in both mu-view-old and mu-view-gnus.
2021-03-07 22:03:36 +02:00
Dirk-Jan C. Binnema ed2e0ed0c3 mu4e-view: make the gnus-based view the default one
Use
  (setq mu4e-view-use-gnus nil)
to use the old one.
2021-03-07 17:35:30 +02:00
Dirk-Jan C. Binnema c1f08e1683 mu4e-view: split in -gnus and -old
Split out the gnus-based and "old" view code into separate files, and
ensure only one of them is loaded.

Do some initial cleanups, more will follow.
2021-03-07 16:42:55 +02:00
Thierry Volpiatto 117f438e10
Fix error in mu4e-view-gnus-save-mime-parts
where `handle' may not be a list (here a marker when I had error).

So ensure it is a list.
2021-02-23 21:24:44 +01:00
Christophe Troestler a1664d2189 Fix the decoding of accents in Gnus view
Followup on https://github.com/djcb/mu/issues/1823
Fixes https://github.com/djcb/mu/issues/1886
2021-01-16 12:38:41 +01:00
Dirk-Jan C. Binnema 5ca25e9e89
Merge pull request #1898 from Chris00/describe-binding
Restore C-h b default behavior
2021-01-15 21:16:26 +02:00
Dirk-Jan C. Binnema bcd96d8a1e mu4e-view: use mm-insert-file-contents
Which should avoid some encoding troubles.
2021-01-15 21:07:38 +02:00
Christophe Troestler 4acfce6e2c Restore C-h b default behavior
Fixes https://github.com/djcb/mu/issues/1842
2021-01-13 11:49:32 +01:00
Dirk-Jan C. Binnema 5213adeb2c
Merge pull request #1875 from thierryvolpiatto/save_attachment
Fix #1790 by providing mu4e-view-gnus-save-mime-parts
2021-01-11 09:45:12 +02:00
Dirk-Jan C. Binnema 4dbc6ac399 mu4e-view: Use 'mu4e not "mu4e" when extracting
And param is a string.

Fixes: #1869.
Fixes: #1865.
2021-01-03 15:27:16 +02:00
Thierry Volpiatto 00651acaab
Fix #1790 by providing mu4e-view-gnus-save-mime-parts
in replacement of mu4e-view-save-attachment-multi for gnus viewers.

The alias mu4e-view-save-attachment have been replaced by a wrapper function
that calls either mu4e-view-save-attachment-multi or
mu4e-view-gnus-save-mime-parts depending of the context.
2020-12-27 09:46:18 +01:00
Thierry Volpiatto 4830e7de14
Remove null byte added probably by error 2020-12-26 08:49:19 +01:00
Thierry Volpiatto 0fbe6edc4e
No need to call `read-only-mode` when buffer is already read-only
In mu4e~view-gnus, mu4e-view-mode derive from gnus-article-mode which derive
from gnus-mode which derive from special-mode:
(get 'mu4e-view-mode 'mode-class) => special.
2020-11-16 07:48:33 +01:00
Dirk-Jan C. Binnema df0f78d891
Merge pull request #1836 from thierryvolpiatto/disable_mm-verify-option
Disable `mm-verify-option` let-bounded in `mu4e~view-gnus`
2020-11-15 17:20:23 +02:00
Thierry Volpiatto 41682af7b1
Disable `mm-verify-option` let-bounded in `mu4e~view-gnus`
When this option is set to 'known and the needed key is not yet in the user's
keyring, mu4e may hangs forever unable to verify email so lets user set this
variable globally to 'never to prevent this issue.
2020-11-15 08:19:15 +01:00
Thierry Volpiatto 0109172ad4
Use functions instead of lambdas in add-hook calls 2020-11-13 11:38:50 +01:00
Dirk-Jan C. Binnema 861194f9a1 mu4e-view: insert-file-contents (gnus mode)
It seems the earlier version (using insert-file-contents-literally, then
trying to fix it has some problems)

HT: thierryvolpiatto

Fixes: #1823.
2020-11-11 21:57:29 +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 5e069d9a6f mu4e: support regexp patterns for personal addresses 2020-10-17 15:38:24 +03:00
Dirk-Jan C. Binnema f18044f5b7 mu4e: gnus-view: Make sure to clean up gnus mm buffers (typo)
Fix typo in previous.
2020-08-09 17:17:23 +03:00
Dirk-Jan C. Binnema 0d6bf906fe mu4e: gnus-view: Make sure to clean up gnus mm buffers
After leaving a gnus-view buffer, we should clean up the the mm-*
buffers it creates; we were leaking those.

Fixes issue #1781
2020-08-09 17:12:40 +03:00
Dirk-Jan C. Binnema 6d73ca8ec3 mu4e: fix mu4e~proc-view-path
Ensure parameters match.
2020-07-25 17:20:39 +03:00
Dirk-Jan C. Binnema 3dc4b93989 mu4e/server: implement mark-as-read for (view ...)
Instead of a multi-step process to display an unread message (ie. get
the original, notice it's unread, then update it, replace the message
with update one etc.), we now handle that in the (view /./..) command on
the server side.

Simplifies things, and is faster (which could be noticeable, esp. if
e.g. signature verification is part of the process)
2020-06-13 16:56:41 +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 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
Marcel van der Boom fa5b181e25 Merge remote-tracking branch 'upstream/master' 2020-05-19 09:09:08 +02:00
Marcel van der Boom 01736c9a65 Add missing space between signature verification and signers 2020-05-19 09:08:30 +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
Dirk-Jan C. Binnema f016f257f9 mu4e: support 'no trash flag' for all mark-for-trash
Use a non-macro implementation for mu4e-(view|headers)-mark-for-trash,
and honor the no-trash flag.

Fixes #1687.
2020-05-16 12:43:23 +03:00
Jonas Bernoulli 564d892701 Fix typos 2020-05-12 23:56:55 +02:00
Derek Upham d17abfc324 Make mu4e~view-message available to mu4e-view-mode-hooks.
This requires setting the buffer-local variable before calling the
major mode function, and protecting the variable from the standard
mode-change cleanup.
2020-05-06 20:23:29 -07: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 b37569964a mu4e-view: fix gnus-button click for emacs 26
There are some behavioral differences causing the RET binding in emacs
26.3 (an possibly others) to be active even in gnus mode; this breaks
clicking URLs.

Attempt to work around that.
2020-04-21 00:09:45 +03:00
Alex Murray 43dd60e523
Fix displaying ical attachments after PR #1633 2020-04-08 13:29:16 +09:30
Christophe Troestler ed123431db Fix displaying ical attachments with no charset
Fixes https://github.com/djcb/mu/issues/1625
2020-04-05 22:58:20 +02:00
Dirk-Jan C. Binnema f8774ff98c mu4e: support prefix arguments with mu4e~native-def
Fixes #1611.
2020-03-11 20:47:25 +02:00
Dirk-Jan C. Binnema 59fb743851
Merge pull request #1607 from yellowmoneybank/typo
Fix Gnus typos
2020-03-06 21:16:19 +02:00
Philip K d4b40ac202 Unquoted mu4e-view-use-gnus in unless form 2020-03-06 15:31:20 +01:00
Philip K 5b570cee20 Fix Gnus typos 2020-03-06 15:30:36 +01:00
Dirk-Jan C. Binnema c3771cba3e Merge branch 'gpg' 2020-03-05 22:40:16 +02:00
Moritz Müller 090ff42c50 mu4e: Add a mime-type-check when importing a pgp-key from an attachment 2020-03-05 22:39:45 +02:00
Moritz Müller 81e0c49084 mu4e: Add option to attachment-options to import gpg public key
This pull request adds an option to the attachment-options that allows
to import pgp-public-keys.
2020-03-05 22:39:33 +02:00