discussion and development of piem
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Xinglu Chen <public@yoctocell.xyz>
Cc: piem@inbox.kyleam.com
Subject: Re: [PATCH v2] notmuch: Configure mailing list archive links
Date: Sat, 06 Feb 2021 10:58:58 -0500
Message-ID: <878s81jigt.fsf@kyleam.com> (raw)
In-Reply-To: <8e8677cde716973081232aa65a37fa2fc621b15f.1612600790.git.public@yoctocell.xyz>

Xinglu Chen writes:

> This adds an entry to `notmuch-show-stash-ml-archive-link-alist` that
> reads the `piem-inboxes` variable and returns the public-inbox archive
> url.  This means that users don't have to manually add public-inbox
> archive urls to `notmuch-show-stash-ml-archive-link-alist`.

s/notmuch-show-stash-ml-archive/notmuch-show-stash-mlarchive/

(fixed when applying)

> +(defun piem-notmuch-show-get-public-inbox-link (mid)
> +  "Given the message-id MID, return the public-inbox url.
> +This will lookup the url in the `piem-inboxes' variable."
> +  (let* ((inbox (piem-notmuch-get-inbox))
> +         (link (or (piem-inbox-get :url inbox)
> +                   (user-error "No url was found for %s" inbox))))
> +    (concat
> +     (piem--ensure-trailing-slash link)
> +     (piem-escape-mid mid))))

Looks good.  I've also added a user-error when piem-notmuch-get-inbox
returns nil to give an error that's slightly more informative than "No
url was found for nil".

> +
>  ;;;###autoload
>  (define-minor-mode piem-notmuch-mode
>    "Toggle Notmuch support for piem.
>  With a prefix argument ARG, enable piem-notmuch mode if ARG is
>  positive, and disable it otherwise.  If called from Lisp, enable
> -the mode if ARG is omitted or nil."
> +the mode if ARG is omitted or nil.
> +
> +This will add a new entry to
> +`notmuch-show-stash-mlarchive-link-alist' which till determine
> +the archive url by reading the `piem-inboxes’ variable.  You can
> +also set `notmuch-show-shas-mlarchive-link-default' to \"piem\"

Made a few typo fixes:
s/will/till/
s/’/'/
s/notmuch-show-shas-/notmuch-show-stash-/

> +to make this the default behavior when calling
> +`notmuch-show-stash-mlarchive-link'."

Pushed (fad8d59).  Thanks.

diff --git a/piem-notmuch.el b/piem-notmuch.el
index 2d6c5a3..27edfae 100644
--- a/piem-notmuch.el
+++ b/piem-notmuch.el
@@ -109,7 +109,8 @@ (defun piem-notmuch-am-ready-mbox ()
 (defun piem-notmuch-show-get-public-inbox-link (mid)
   "Given the message-id MID, return the public-inbox url.
 This will lookup the url in the `piem-inboxes' variable."
-  (let* ((inbox (piem-notmuch-get-inbox))
+  (let* ((inbox (or (piem-notmuch-get-inbox)
+                    (user-error "No inbox associated with current buffer")))
          (link (or (piem-inbox-get :url inbox)
                    (user-error "No url was found for %s" inbox))))
     (concat
@@ -119,14 +120,15 @@ (defun piem-notmuch-show-get-public-inbox-link (mid)
 ;;;###autoload
 (define-minor-mode piem-notmuch-mode
   "Toggle Notmuch support for piem.
+
 With a prefix argument ARG, enable piem-notmuch mode if ARG is
 positive, and disable it otherwise.  If called from Lisp, enable
 the mode if ARG is omitted or nil.
 
 This will add a new entry to
-`notmuch-show-stash-mlarchive-link-alist' which till determine
-the archive url by reading the `piem-inboxes’ variable.  You can
-also set `notmuch-show-shas-mlarchive-link-default' to \"piem\"
+`notmuch-show-stash-mlarchive-link-alist' which will determine
+the archive url by reading the `piem-inboxes' variable.  You can
+also set `notmuch-show-stash-mlarchive-link-default' to \"piem\"
 to make this the default behavior when calling
 `notmuch-show-stash-mlarchive-link'."
   :global t

  reply	other threads:[~2021-02-06 15:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 17:10 [PATCH] " Xinglu Chen
2021-02-06  4:54 ` Kyle Meyer
2021-02-06  8:07   ` Xinglu Chen
2021-02-06  8:44 ` [PATCH v2] " Xinglu Chen
2021-02-06 15:58   ` Kyle Meyer [this message]
2021-02-06 16:17     ` Xinglu Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://git.kyleam.com/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878s81jigt.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=piem@inbox.kyleam.com \
    --cc=public@yoctocell.xyz \
    --subject='Re: [PATCH v2] notmuch: Configure mailing list archive links' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

discussion and development of piem

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.kyleam.com/piem/0 piem/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 piem piem/ https://inbox.kyleam.com/piem \
		piem@inbox.kyleam.com
	public-inbox-index piem

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.piem


code repositories for project(s) associated with this inbox:

	https://git.kyleam.com/piem/

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git