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

View File

@ -128,8 +128,8 @@ is either a headers or view buffer."
:char ("r" . "") :char ("r" . "")
:prompt "refile" :prompt "refile"
:dyn-target (lambda (target msg) (mu4e-get-refile-folder msg)) :dyn-target (lambda (target msg) (mu4e-get-refile-folder msg))
:action (lambda (docid msg target) (mu4e~proc-move docid :action (lambda (docid msg target)
(mu4e~mark-check-target target) "-N"))) (mu4e~proc-move docid (mu4e~mark-check-target target) "-N")))
(delete (delete
:char ("D" . "") :char ("D" . "")
:prompt "Delete" :prompt "Delete"
@ -139,13 +139,14 @@ is either a headers or view buffer."
:char ("+" . "") :char ("+" . "")
:prompt "+flag" :prompt "+flag"
:show-target (lambda (target) "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 (move
:char ("m" . "") :char ("m" . "")
:prompt "move" :prompt "move"
:ask-target mu4e~mark-get-move-target :ask-target mu4e~mark-get-move-target
:action (lambda (docid msg target) (mu4e~proc-move docid :action (lambda (docid msg target)
(mu4e~mark-check-target target) "-N"))) (mu4e~proc-move docid (mu4e~mark-check-target target) "-N")))
(read (read
:char ("!" . "") :char ("!" . "")
:prompt "!read" :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 ;; 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 ;; target (the target folder) the other ones get a pseudo "target", as
;; info for the user. ;; 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 (get-markkar
(lambda (char) (lambda (char)
(if (listp char) (if (listp char)
@ -255,11 +257,12 @@ The following marks are available, and the corresponding props:
(funcall show-fct target) (funcall show-fct target)
(if target (format "%S" target))))) (if target (format "%S" target)))))
(unless docid (mu4e-warn "No message on this line")) (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 (save-excursion
(when (mu4e~headers-mark docid markkar) (when (mu4e~headers-mark docid markkar)
;; update the hash -- remove everything current, and if add the new stuff, ;; update the hash -- remove everything current, and if add the new
;; unless we're unmarking ;; stuff, unless we're unmarking
(remhash docid mu4e~mark-map) (remhash docid mu4e~mark-map)
;; remove possible overlays ;; remove possible overlays
(remove-overlays (line-beginning-position) (line-end-position)) (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) (when (and shown-target mu4e-headers-show-target)
(let* ((targetstr (propertize (concat "-> " shown-target " ") (let* ((targetstr (propertize (concat "-> " shown-target " ")
'face 'mu4e-system-face)) 'face 'mu4e-system-face))
;; mu4e~headers-goto-docid docid t \will take us just after the ;; mu4e~headers-goto-docid docid t \will take us just after
;; docid cookie and then we skip the mu4e~mark-fringe ;; the docid cookie and then we skip the mu4e~mark-fringe
(start (+ (length mu4e~mark-fringe) (start (+ (length mu4e~mark-fringe)
(mu4e~headers-goto-docid docid t))) (mu4e~headers-goto-docid docid t)))
(overlay (make-overlay start (+ start (length targetstr))))) (overlay (make-overlay start (+ start (length targetstr)))))
@ -410,7 +413,8 @@ If NO-CONFIRMATION is non-nil, don't ask user for confirmation."
(progn (progn
(run-hook-with-args (run-hook-with-args
'mu4e-mark-execute-pre-hook mark msg) '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-error "Unrecognized mark %S" mark))))
mu4e~mark-map)) mu4e~mark-map))
(mu4e-mark-unmark-all) (mu4e-mark-unmark-all)
@ -453,7 +457,8 @@ action', return nil means 'don't do anything'."
(unless (zerop marknum) ;; nothing to do? (unless (zerop marknum) ;; nothing to do?
(when (eq what 'ask) (when (eq what 'ask)
(setq what (mu4e-read-option (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) '( ("apply marks" . apply)
("ignore marks?" . ignore))))) ("ignore marks?" . ignore)))))
;; we determined what to do... now do it ;; 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 ;; 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> ;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
@ -27,7 +27,6 @@
(require 'mu4e-utils) (require 'mu4e-utils)
(require 'mu4e-meta) (require 'mu4e-meta)
(require 'mu4e-proc-mu) (require 'mu4e-proc-mu)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -207,7 +206,7 @@ The server output is as follows:
(funcall mu4e-temp-func (funcall mu4e-temp-func
(plist-get sexp :temp) ;; name of the temp file (plist-get sexp :temp) ;; name of the temp file
(plist-get sexp :what) ;; what to do with it (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 :docid) ;; docid of the message
(plist-get sexp :param)));; parameter for the action (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)))))) (setq sexp (mu4e~proc-eat-sexp-from-buf))))))
(defun mu4e~escape (str) (defun mu4e~escape (str)
"Escape STRING for transport -- put it in quotes, and escape existing quotation. "Escape STRING for transport -- put it in quotes, and escape
In particular, backslashes and double-quotes." existing quotation. In particular, backslashes and
double-quotes."
(let ((esc (replace-regexp-in-string "\\\\" "\\\\\\\\" str))) (let ((esc (replace-regexp-in-string "\\\\" "\\\\\\\\" str)))
(format "\"%s\"" (replace-regexp-in-string "\"" "\\\\\"" esc)))) (format "\"%s\"" (replace-regexp-in-string "\"" "\\\\\"" esc))))