This commit is contained in:
djcb 2017-09-17 13:18:06 +03:00
parent cb0025b352
commit 77b8f034e9
3 changed files with 31 additions and 25 deletions

View File

@ -1107,12 +1107,12 @@ the query history stack."
(mu4e~quote-for-modeline mu4e~headers-last-query)
'face 'mu4e-modeline-face)
" "
(mu4e-context-label)
(if (and mu4e-display-update-status-in-modeline
(buffer-live-p mu4e~update-buffer)
(process-live-p (get-buffer-process mu4e~update-buffer)))
(propertize " (updating)" 'face 'mu4e-modeline-face)
"")))))
(mu4e-context-label)
(if (and mu4e-display-update-status-in-modeline
(buffer-live-p mu4e~update-buffer)
(process-live-p (get-buffer-process mu4e~update-buffer)))
(propertize " (updating)" 'face 'mu4e-modeline-face)
"")))))
;; when the buffer is already visible, select it; otherwise,
;; switch to it.
@ -1311,7 +1311,8 @@ descendants."
;; FIXME: e.g., for refiling we should evaluate this
;; for each line separately
(mu4e~mark-get-markpair
(if subthread "Mark subthread with: " "Mark whole thread with: ") t))))
(if subthread "Mark subthread with: " "Mark whole thread with: ")
t))))
(mu4e-headers-mark-thread-using-markpair markpair subthread))
(defun mu4e-headers-mark-subthread (&optional markpair)

View File

@ -128,8 +128,8 @@ is either a headers or view buffer."
:char ("r" . "")
:prompt "refile"
:dyn-target (lambda (target msg) (mu4e-get-refile-folder msg))
:action (lambda (docid msg target) (mu4e~proc-move docid
(mu4e~mark-check-target target) "-N")))
:action (lambda (docid msg target)
(mu4e~proc-move docid (mu4e~mark-check-target target) "-N")))
(delete
:char ("D" . "")
:prompt "Delete"
@ -139,13 +139,14 @@ is either a headers or view buffer."
:char ("+" . "")
:prompt "+flag"
:show-target (lambda (target) "flag")
:action (lambda (docid msg target) (mu4e~proc-move docid nil "+F-u-N")))
:action (lambda (docid msg target)
(mu4e~proc-move docid nil "+F-u-N")))
(move
:char ("m" . "")
:prompt "move"
:ask-target mu4e~mark-get-move-target
:action (lambda (docid msg target) (mu4e~proc-move docid
(mu4e~mark-check-target target) "-N")))
:action (lambda (docid msg target)
(mu4e~proc-move docid (mu4e~mark-check-target target) "-N")))
(read
:char ("!" . "")
:prompt "!read"
@ -242,7 +243,8 @@ The following marks are available, and the corresponding props:
;; get a cell with the mark char and the 'target' 'move' already has a
;; target (the target folder) the other ones get a pseudo "target", as
;; info for the user.
(markdesc (cdr (or (assq mark mu4e-marks) (mu4e-error "Invalid mark %S" mark))))
(markdesc (cdr (or (assq mark mu4e-marks)
(mu4e-error "Invalid mark %S" mark))))
(get-markkar
(lambda (char)
(if (listp char)
@ -255,11 +257,12 @@ The following marks are available, and the corresponding props:
(funcall show-fct target)
(if target (format "%S" target)))))
(unless docid (mu4e-warn "No message on this line"))
(unless (eq major-mode 'mu4e-headers-mode) (mu4e-error "Not in headers-mode"))
(unless (eq major-mode 'mu4e-headers-mode)
(mu4e-error "Not in headers-mode"))
(save-excursion
(when (mu4e~headers-mark docid markkar)
;; update the hash -- remove everything current, and if add the new stuff,
;; unless we're unmarking
;; update the hash -- remove everything current, and if add the new
;; stuff, unless we're unmarking
(remhash docid mu4e~mark-map)
;; remove possible overlays
(remove-overlays (line-beginning-position) (line-end-position))
@ -271,8 +274,8 @@ The following marks are available, and the corresponding props:
(when (and shown-target mu4e-headers-show-target)
(let* ((targetstr (propertize (concat "-> " shown-target " ")
'face 'mu4e-system-face))
;; mu4e~headers-goto-docid docid t \will take us just after the
;; docid cookie and then we skip the mu4e~mark-fringe
;; mu4e~headers-goto-docid docid t \will take us just after
;; the docid cookie and then we skip the mu4e~mark-fringe
(start (+ (length mu4e~mark-fringe)
(mu4e~headers-goto-docid docid t)))
(overlay (make-overlay start (+ start (length targetstr)))))
@ -410,7 +413,8 @@ If NO-CONFIRMATION is non-nil, don't ask user for confirmation."
(progn
(run-hook-with-args
'mu4e-mark-execute-pre-hook mark msg)
(funcall (plist-get (cdr markdescr) :action) docid msg target))
(funcall (plist-get (cdr markdescr) :action)
docid msg target))
(mu4e-error "Unrecognized mark %S" mark))))
mu4e~mark-map))
(mu4e-mark-unmark-all)
@ -453,7 +457,8 @@ action', return nil means 'don't do anything'."
(unless (zerop marknum) ;; nothing to do?
(when (eq what 'ask)
(setq what (mu4e-read-option
(format "There are %d existing mark(s); should we: " marknum)
(format "There are %d existing mark(s); should we: "
marknum)
'( ("apply marks" . apply)
("ignore marks?" . ignore)))))
;; we determined what to do... now do it

View File

@ -1,6 +1,6 @@
;; mu4e-proc.el -- part of mu4e, the mu mail user agent
;;
;; Copyright (C) 2011-2016 Dirk-Jan C. Binnema
;; Copyright (C) 2011-2017 Dirk-Jan C. Binnema
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
@ -27,7 +27,6 @@
(require 'mu4e-utils)
(require 'mu4e-meta)
(require 'mu4e-proc-mu)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -207,7 +206,7 @@ The server output is as follows:
(funcall mu4e-temp-func
(plist-get sexp :temp) ;; name of the temp file
(plist-get sexp :what) ;; what to do with it
;; (pipe|emacs|open-with...)
;; (pipe|emacs|open-with...)
(plist-get sexp :docid) ;; docid of the message
(plist-get sexp :param)));; parameter for the action
@ -226,8 +225,9 @@ The server output is as follows:
(setq sexp (mu4e~proc-eat-sexp-from-buf))))))
(defun mu4e~escape (str)
"Escape STRING for transport -- put it in quotes, and escape existing quotation.
In particular, backslashes and double-quotes."
"Escape STRING for transport -- put it in quotes, and escape
existing quotation. In particular, backslashes and
double-quotes."
(let ((esc (replace-regexp-in-string "\\\\" "\\\\\\\\" str)))
(format "\"%s\"" (replace-regexp-in-string "\"" "\\\\\"" esc))))