diff --git a/mu4e/mu4e-context.el b/mu4e/mu4e-context.el index fa3f3a9f..9d8e6a83 100644 --- a/mu4e/mu4e-context.el +++ b/mu4e/mu4e-context.el @@ -37,9 +37,16 @@ describing mu4e's contexts.") "The current context; for internal use. Use `mu4e-context-switch' to change it.") -(defun mu4e-context-current () - "Get the currently active context, or nil if there is none." - mu4e~context-current) +(defun mu4e-context-current (&optional output) + "Get the currently active context, or nil if there is none. +When OUTPUT is non-nil, echo the name of the current context or +none." + (interactive "p") + (let ((ctx mu4e~context-current)) + (when output + (mu4e-message "Current context: %s" + (if ctx (mu4e-context-name ctx) ""))) + ctx)) (defun mu4e-context-label () "Propertized string with the current context name, or \"\" if @@ -155,4 +162,3 @@ match, POLICY determines what to do: (otherwise nil)))))) (provide 'mu4e-context) -