diff --git a/mu4e/mu4e-actions.el b/mu4e/mu4e-actions.el index 967aaae5..5744e738 100644 --- a/mu4e/mu4e-actions.el +++ b/mu4e/mu4e-actions.el @@ -1,6 +1,6 @@ ;;; mu4e-actions.el -- part of mu4e, the mu mail user agent -*- lexical-binding: t -*- -;; Copyright (C) 2011-2022 Dirk-Jan C. Binnema +;; Copyright (C) 2011-2023 Dirk-Jan C. Binnema ;; Author: Dirk-Jan C. Binnema ;; Maintainer: Dirk-Jan C. Binnema @@ -34,6 +34,7 @@ (require 'mu4e-message) (require 'mu4e-search) (require 'mu4e-contacts) +(require 'mu4e-lists) ;;; Count lines @@ -249,21 +250,26 @@ the message." msgid (and (eq major-mode 'mu4e-view-mode) (not (eq mu4e-split-view 'single-window)))))))) -(defun mu4e-actions-browse-list-archive (msg) + +;;; Mailing list URLS + +(defun mu4e-action-browse-list-archive (msg) "Browse the archive for a mailing list message MSG. -See `mu4e-list-archives-resolve'." +See `mu4e-mailing-list-archive-url'." (interactive (list (mu4e-message-at-point))) - (when-let ((url (mu4e-list-archives-resolve msg))) - (browse-url url))) + (if-let ((url (mu4e-mailing-list-archive-url msg))) + (browse-url url) + (mu4e-warn "No archive available for this message"))) -(defun mu4e-actions-kill-list-archive (msg) - "Kill the archive url for a mailing list message MSG. -See `mu4e-list-archives-resolve'." +(defun mu4e-action-copy-list-archive-url (msg) + "Copy the archive url for a mailing list message MSG. +See `mu4e-mailing-list-archive-url'." (interactive (list (mu4e-message-at-point))) - (let ((url (mu4e-list-archives-resolve msg))) - (if (stringp url) (kill-new url) - (user-error "Cannot get url for this message")))) + (let ((url (mu4e-mailing-list-archive-url msg))) + (if (stringp url) + (kill-new url) + (mu4e-warn "Cannot get archive URL for this message")))) -;;; _ +;;; (provide 'mu4e-actions) ;;; mu4e-actions.el ends here diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 2fd53e65..068a108b 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -239,7 +239,7 @@ Must have the same length as `mu4e-headers-thread-connection-prefix'.") (defcustom mu4e-headers-actions '( ("capture message" . mu4e-action-capture-message) - ("browse online archive" . mu4e-actions-browse-list-archive) + ("browse online archive" . mu4e-action-browse-list-archive) ("show this thread" . mu4e-action-show-thread)) "List of actions to perform on messages in the headers list. The actions are cons-cells of the form (NAME . FUNC) where: diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 4fe14e2b..55911b05 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -1,6 +1,6 @@ ;;; mu4e-view.el -- part of mu4e, the mu mail user agent -*- lexical-binding: t -*- -;; Copyright (C) 2021-2022 Dirk-Jan C. Binnema +;; Copyright (C) 2021-2023 Dirk-Jan C. Binnema ;; Author: Dirk-Jan C. Binnema ;; Maintainer: Dirk-Jan C. Binnema @@ -75,7 +75,7 @@ etc., see the gnus documentation for details." (defcustom mu4e-view-actions (delq nil `(("capture message" . mu4e-action-capture-message) ("view in browser" . mu4e-action-view-in-browser) - ("browse online archive" . mu4e-actions-browse-list-archive) + ("browse online archive" . mu4e-action-browse-list-archive) ,(when (fboundp 'xwidget-webkit-browse-url) '("xview in xwidget" . mu4e-action-view-in-xwidget)) ("show this thread" . mu4e-action-show-thread)))