* mu4e: fix mu4e marking / regions
This commit is contained in:
@ -52,7 +52,6 @@ particularly fast).")
|
|||||||
(defvar mu4e~mark-map nil
|
(defvar mu4e~mark-map nil
|
||||||
"Map (hash) of docid->markinfo; when a message is marked, the
|
"Map (hash) of docid->markinfo; when a message is marked, the
|
||||||
information is added here.
|
information is added here.
|
||||||
|
|
||||||
markinfo is a cons cell consisting of the following:
|
markinfo is a cons cell consisting of the following:
|
||||||
\(mark . target)
|
\(mark . target)
|
||||||
where
|
where
|
||||||
@ -75,8 +74,7 @@ where
|
|||||||
|
|
||||||
(defun mu4e~mark-initialize ()
|
(defun mu4e~mark-initialize ()
|
||||||
"Initialize the marks subsystem."
|
"Initialize the marks subsystem."
|
||||||
(make-local-variable 'mu4e~mark-map)
|
(set (make-local-variable 'mu4e~mark-map) (make-hash-table)))
|
||||||
(setq mu4e~mark-map (make-hash-table :size 16)))
|
|
||||||
|
|
||||||
(defun mu4e~mark-clear ()
|
(defun mu4e~mark-clear ()
|
||||||
"Clear the marks subsystem."
|
"Clear the marks subsystem."
|
||||||
@ -116,11 +114,11 @@ The following marks are available, and the corresponding props:
|
|||||||
(delete '("D" . "delete"))
|
(delete '("D" . "delete"))
|
||||||
(flag '("+" . "flag"))
|
(flag '("+" . "flag"))
|
||||||
(move `("m" . ,target))
|
(move `("m" . ,target))
|
||||||
(read '("r" . "read"))
|
(read '("!" . "read"))
|
||||||
(trash `("d" . ,target))
|
(trash `("d" . ,target))
|
||||||
(unflag '("-" . "unflag"))
|
(unflag '("-" . "unflag"))
|
||||||
(unmark '(" " . nil))
|
(unmark '(" " . nil))
|
||||||
(unread '("o" . "unread"))
|
(unread '("?" . "unread"))
|
||||||
(otherwise (mu4e-error "Invalid mark %S" mark))))
|
(otherwise (mu4e-error "Invalid mark %S" mark))))
|
||||||
(markkar (car markcell))
|
(markkar (car markcell))
|
||||||
(target (cdr markcell)))
|
(target (cdr markcell)))
|
||||||
@ -183,11 +181,11 @@ headers in the region. Optionally, provide TARGET (for moves)."
|
|||||||
(mu4e-mark-at-point mark (funcall get-target target))
|
(mu4e-mark-at-point mark (funcall get-target target))
|
||||||
;; mark all messages in the region.
|
;; mark all messages in the region.
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let ((b (region-beginning)) (e (region-end)))
|
(let ((cant-go-further) (eor (region-end)))
|
||||||
(goto-char b)
|
(goto-char (region-beginning))
|
||||||
(while (<= (line-beginning-position) e)
|
(while (and (<= (point) eor) (not cant-go-further))
|
||||||
(mu4e-mark-at-point mark (funcall get-target target))
|
(mu4e-mark-at-point mark (funcall get-target target))
|
||||||
(forward-line 1)))))))
|
(setq cant-go-further (not (mu4e-headers-next)))))))))
|
||||||
|
|
||||||
(defun mu4e-mark-restore (docid)
|
(defun mu4e-mark-restore (docid)
|
||||||
"Restore the visual mark for the message with DOCID."
|
"Restore the visual mark for the message with DOCID."
|
||||||
|
|||||||
Reference in New Issue
Block a user