summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2021-08-28 11:34:28 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2021-08-29 20:30:29 +0300
commitbfd0618e58f8236251061b9d6561b1f7327e5b71 (patch)
tree8cd0dcac2d5ab762b3ff165f234524349a3d4937
parentd7055b7ed821427a8d9517df68813e7c25a44bb3 (diff)
mu4e-context: fix some flycheck warnings
-rw-r--r--mu4e/mu4e-context.el34
1 files changed, 19 insertions, 15 deletions
diff --git a/mu4e/mu4e-context.el b/mu4e/mu4e-context.el
index afecb4a..4282834 100644
--- a/mu4e/mu4e-context.el
+++ b/mu4e/mu4e-context.el
@@ -33,15 +33,15 @@
(defvar smtpmail-smtp-user)
(defvar mu4e-view-date-format)
-(defvar mu4e-contexts nil "The list of `mu4e-context' objects
-describing mu4e's contexts.")
+(defvar mu4e-contexts nil
+ "The list of `mu4e-context' objects describing mu4e's contexts.")
(defvar mu4e-context-changed-hook nil
"Hook run just *after* the context changed.")
(defvar mu4e~context-current nil
- "The current context; for internal use. Use
- `mu4e-context-switch' to change it.")
+ "The current context; for internal use.
+Use `mu4e-context-switch' to change it.")
(defun mu4e-context-current (&optional output)
"Get the currently active context, or nil if there is none.
@@ -55,8 +55,8 @@ none."
ctx))
(defun mu4e-context-label ()
- "Propertized string with the current context name, or \"\" if
- there is none."
+ "Propertized string with the current context name.
+An empty string \"\" if there is none."
(if (mu4e-context-current)
(concat "[" (propertize (mu4e~quote-for-modeline
(mu4e-context-name (mu4e-context-current)))
@@ -84,7 +84,7 @@ none."
(defun mu4e~context-ask-user (prompt)
- "Let user choose some context based on its name."
+ "Let user choose some context based on its name with PROMPT."
(when mu4e-contexts
(let* ((names (cl-map 'list (lambda (context)
(cons (mu4e-context-name context) context))
@@ -93,8 +93,8 @@ none."
(or context (mu4e-error "No such context")))))
(defun mu4e-context-switch (&optional force name)
- "Switch context to a context with NAME which is part of
-`mu4e-contexts'; if NAME is nil, query user.
+ "Switch to a context with NAME.
+Context must be part of `mu4e-contexts'; if NAME is nil, query user.
If the new context is the same and the current context, only
switch (run associated functions) when prefix argument FORCE is
@@ -130,18 +130,22 @@ non-nil."
context))
(defun mu4e~context-autoswitch (&optional msg policy)
- "When contexts are defined but there is no context yet, switch
-to the first whose :match-func return non-nil. If none of them
-match, return the first. For MSG and POLICY, see `mu4e-context-determine'."
+ "Automatically switch to some context.
+
+When contexts are defined but there is no context yet, switch to
+the first whose :match-func return non-nil. If none of them
+match, return the first. For MSG and POLICY, see
+`mu4e-context-determine'."
(when mu4e-contexts
(let ((context (mu4e-context-determine msg policy)))
(when context (mu4e-context-switch
nil (mu4e-context-name context))))))
(defun mu4e-context-determine (msg &optional policy)
- "Return the first context with a match-func that returns t. MSG
-points to the plist for the message replied to or forwarded, or
-nil if there is no such MSG; similar to what
+ "Return the first context where match-func evaluate to non-nil.
+
+MSG points to the plist for the message replied to or forwarded,
+or nil if there is no such MSG; similar to what
`mu4e-compose-pre-hook' does.
POLICY specifies how to do the determination. If POLICY is