- Emacs Lisp 100%
| LICENSE | Add license text | |
| mu4e-walk.el | Make mu4e-walk-extend-key more restrictive | |
| README.org | Update README.org | |
| screencast.gif | README.org: Add screencast | |
mu4e-walk: Send email addresses for a walk
https://melpa.org/packages/mu4e-walk-badge.svg
Move email addresses around when composing emails with mu4e in Emacs.
/timmli/mu4e-walk/media/branch/master/screencast.gif (The screencast shows the Monokai theme.)
This README uses Org mode.
Features
When composing an email with mu4e, one can move around email addresses in the header with just one key stroke:
- Move email address "vertically" between address fields (identified with
message-email-recipient-header-regexp) - Move email address "horizontally" within an address field
- Also works with regions!
- Switch "vertically" and "horizontally" between email addresses.
- Delete an email address at point.
Installation
Dependencies
- mu4e (mainly because it hooks into
mu4e-compose-mode)
Installation with Melpa
Assuming use-package, just add the following to your init file:
(use-package mu4e-walk
:after mu4e
:ensure t
:config
(add-hook 'mu4e-compose-mode-hook 'mu4e-walk-add-keybindings-compose-mode) ; Optional
)
Installation from Github
Download mu4e-walk.el to your .emacs.d folder and add the following code to your init file:
(use-package mu4e-walk
:after mu4e
:load-path "relative/path/to/mu4e-walk.el")
:config
(add-hook 'mu4e-compose-mode-hook 'mu4e-walk-add-keybindings-compose-mode) ; Optional
)
Usage
The most important functions and keybindings are:
| Function | Keybinding |
|---|---|
mu4e-walk-up |
M-<up> |
mu4e-walk-down |
M-<down> |
mu4e-walk-left |
M-<left> |
mu4e-walk-right |
M-<right> |
mu4e-walk-switch-up |
C-<up> |
mu4e-walk-switch-down |
C-<down> |
mu4e-walk-switch-left |
C-<left> |
mu4e-walk-switch-right |
C-<right> |
mu4e-walk-delete-email-address-at-point |
M-<delete> M-<delete> |
Configuration
For customizing the keybindings, take a look at the function mu4e-walk-add-keybindings-compose-mode.
By default, it looks like this:
(defun mu4e-walk-add-keybindings-compose-mode ()
"Function which is added to a mode hook."
(use-local-map (copy-keymap mu4e-compose-mode-map))
(mu4e-walk-extend-key "M-<up>" 'mu4e-walk-up)
(mu4e-walk-extend-key "M-<down>" 'mu4e-walk-down)
(mu4e-walk-extend-key "M-<left>" 'mu4e-walk-left)
(mu4e-walk-extend-key "M-<right>" 'mu4e-walk-right))
One can change the keybindings by modifying the first argument of mu4e-walk-extend-key in the definition, for example:
(defun mu4e-walk-add-keybindings-compose-mode ()
"Function which is added to a mode hook."
(use-local-map (copy-keymap mu4e-compose-mode-map))
(mu4e-walk-extend-key "C-<up>" 'mu4e-walk-up)
(mu4e-walk-extend-key "C-<down>" 'mu4e-walk-down)
(mu4e-walk-extend-key "C-<left>" 'mu4e-walk-left)
(mu4e-walk-extend-key "C-<right>" 'mu4e-walk-right))
The reason for using mu4e-walk-add-keybindings-compose-mode is that the mu4e-walk keybindings should only be active in the header of a message. When the cursor is in the body, the global keybindings should be used. (In my case, this is move-text-up etc.)
Ideas & plans
As for my own needs, mu4e-walk is currently feature-complete.
Alternative and related Emacs packages
As far as I know, there are no similar packages.