* mu4e-utils.el: warn when no actions are defined + some cosmetics
This commit is contained in:
@ -124,7 +124,7 @@ paths."
|
||||
(string-match "\\.\\{1,2\\}$" de)))
|
||||
(directory-files (concat path mdir))))
|
||||
;; 2. get the list of dirs with a /cur leaf dir
|
||||
(maildirs))
|
||||
(maildirs))
|
||||
(dolist (dir subdirs)
|
||||
(if (string= dir "cur")
|
||||
;; be pedantic, and insist on there being a new/tmp as well
|
||||
@ -146,7 +146,7 @@ top-level Maildir here."
|
||||
(file-directory-p (concat path "/tmp"))
|
||||
(file-directory-p (concat path "/new")))
|
||||
'("/"))
|
||||
(mu4e--get-maildirs-1 path)))
|
||||
(mu4e--get-maildirs-1 path)))
|
||||
|
||||
|
||||
(defun mu4e-ask-maildir (prompt)
|
||||
@ -343,7 +343,7 @@ processing takes part in the background, unless buf is non-nil."
|
||||
(let* ((status (process-status proc))
|
||||
(code (process-exit-status proc))
|
||||
;; sadly, fetchmail returns '1' when there is no mail; this is not really
|
||||
;; an error of course, but it's hard to distinguish from a genuine error
|
||||
;; an error of course, but it's hard to distinguish from a genuine error
|
||||
(maybe-error (or (not (eq status 'exit)) (/= code 0))))
|
||||
(message nil)
|
||||
;; there may be an error, give the user up to 5 seconds to check
|
||||
@ -351,8 +351,8 @@ processing takes part in the background, unless buf is non-nil."
|
||||
(sit-for 5))
|
||||
(mu4e-proc-index mu4e-maildir)
|
||||
(let ((buf (process-buffer proc)))
|
||||
(when (buffer-live-p buf)
|
||||
(kill-buffer buf))))))))
|
||||
(when (buffer-live-p buf)
|
||||
(kill-buffer buf))))))))
|
||||
|
||||
|
||||
(defun mu4e-display-manual ()
|
||||
@ -397,17 +397,19 @@ point in eiter the headers buffer or the view buffer."
|
||||
"Ask user with PROMPT to choose some action from ACTIONS. ACTIONS
|
||||
is a list of actions like `mu4e-view-attachments-actions',
|
||||
`mu4e-view-actions', `mu4e-header-actions'. Then, call the function
|
||||
for this action, with the currrent message plist as the argument."
|
||||
(let ((kar (mu4e-read-option prompt actions)))
|
||||
(dolist (action actions)
|
||||
(let ((shortcut (cadr action)) (func (nth 2 action)))
|
||||
(when (eq kar shortcut)
|
||||
for this action, with the currrent message plist as the argument."
|
||||
(if (null actions)
|
||||
(message "No actions of this type defined")
|
||||
(let ((kar (mu4e-read-option prompt actions)))
|
||||
(dolist (action actions)
|
||||
(let ((shortcut (cadr action)) (func (nth 2 action)))
|
||||
(when (eq kar shortcut)
|
||||
(funcall func msg)))))))
|
||||
|
||||
(defun mu4e-capture-message ()
|
||||
"Capture the path of the message at point."
|
||||
(interactive)
|
||||
(setq mu4e-captured-message (mu4e-message-at-point t))
|
||||
(setq mu4e-captured-message (mu4e-message-at-point t))
|
||||
(message "Message has been captured"))
|
||||
|
||||
(defun mu4e-kill-buffer-and-window (buf)
|
||||
@ -489,7 +491,7 @@ process."
|
||||
|
||||
(defun mu4e-proc-is-running ()
|
||||
"Whether the mu process is running."
|
||||
(buffer-live-p mu4e-mu-proc))
|
||||
(buffer-live-p mu4e-mu-proc))
|
||||
|
||||
(defun* mu4e (&key (hide-ui nil))
|
||||
"Start mu4e . We do this by sending a 'ping' to the mu server
|
||||
@ -502,7 +504,7 @@ non-nil, don't show the UI."
|
||||
(unless hide-ui
|
||||
(mu4e-main-view))
|
||||
(progn
|
||||
;; otherwise, check whether all is okay;
|
||||
;; otherwise, check whether all is okay;
|
||||
(mu4e-check-requirements)
|
||||
;; explicit version checks are a bit questionable,
|
||||
;; better to check for specific features
|
||||
@ -560,13 +562,13 @@ either 'to-server, 'from-server or 'misc. This function is meant for debugging."
|
||||
(misc 'font-lock-variable-name-face)
|
||||
(otherwise (error "Unsupported log type"))))
|
||||
(msg (propertize (apply 'format frm args) 'face msg-face)))
|
||||
(goto-char (point-max))
|
||||
(goto-char (point-max))
|
||||
(insert tstamp
|
||||
(case type
|
||||
(from-server " <- ")
|
||||
(to-server " -> " )
|
||||
(otherwise " "))
|
||||
msg "\n")
|
||||
msg "\n")
|
||||
|
||||
;; if `mu4e-log-max-lines is specified and exceeded, clearest the oldest
|
||||
;; lines
|
||||
@ -576,7 +578,7 @@ either 'to-server, 'from-server or 'misc. This function is meant for debugging."
|
||||
(goto-char (point-max))
|
||||
(forward-line (- mu4e-log-max-lines lines))
|
||||
(beginning-of-line)
|
||||
(delete-region (point-min) (point)))))))))
|
||||
(delete-region (point-min) (point)))))))))
|
||||
|
||||
(defun mu4e-toggle-logging ()
|
||||
"Toggle between enabling/disabling debug-mode (in debug-mode,
|
||||
|
||||
Reference in New Issue
Block a user