doomemacs/modules/app/email/autoload/evil.el
Henrik Lissner 77e4cc4d58
💥 Remove :feature category
:feature was a "catch-all" category. Many of its modules fit better in
other categories, so they've been moved:

- feature/debugger -> tools/debugger
- feature/evil -> editor/evil
- feature/eval -> tools/eval
- feature/lookup -> tools/lookup
- feature/snippets -> editor/snippets
- feature/file-templates -> editor/file-templates
- feature/workspaces -> ui/workspaces

More potential changes in the future:

- A new :term category for terminal emulation modules (eshell, term and
  vterm).
- A new :os category for modules dedicated to os-specific functionality.
  The :tools macos module would fit here, but so would modules for nixos
  and arch.
- A new :services category for web-service integration, like wakatime,
  twitter, elfeed, gist and pastebin services.
2019-04-24 18:16:04 -04:00

21 lines
895 B
EmacsLisp

;; app/email/autoload/evil.el -*- lexical-binding: t; -*-
;;;###if (featurep! :editor evil)
;;;###autoload
(defun +email/mark (&optional beg end)
"Mark all messages within the current selection in mu4e's header view. Uses
`this-command-keys' to see what flag you mean."
(interactive)
(let* ((beg (or beg (and (region-active-p) evil-visual-beginning) (line-beginning-position)))
(end (or end (and (region-active-p) evil-visual-end) (line-end-position)))
(key (this-command-keys))
(command
(car (cl-find-if (lambda (mark) (equal (car (plist-get (cdr mark) :char)) key))
mu4e-marks))))
(unless command
(error "Not a valid mark command: %s" key))
(when (bound-and-true-p evil-mode)
(evil-normal-state))
(goto-char beg)
(dotimes (_ (count-lines beg end))
(mu4e-headers-mark-and-next command))))