discussion and development of piem
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: jlicht@fsfe.org
Cc: piem@inbox.kyleam.com
Subject: Re: [PATCH v3 0/5] New piem-debbugs integration
Date: Sat, 10 Jun 2023 19:16:58 -0400	[thread overview]
Message-ID: <874jne29hx.fsf@kyleam.com> (raw)
In-Reply-To: <20230610095858.26982-1-jlicht@fsfe.org>

jlicht@fsfe.org writes:

> From: Jelle Licht <jlicht@fsfe.org>
>
> V3 of this series addresses most of the shortcomings identified in the
> review of V2, with a point-by-point response still on its way.

Thanks, v2 vs v3 range-diff included below.  Pushed (0a8def10) with one
minor that I'll mention in a direct reply.

1:  d079d395 ! 1:  8f41c76e piem: Add :gnu-package keyword to piem-inboxes
    @@ Metadata
      ## Commit message ##
         piem: Add :gnu-package keyword to piem-inboxes
     
    -    With the `:gnu-package` keyword, users can configure a regex to match
    +    With the `:gnu-package` keyword, users can configure a string to match
         against the X-GNU-PR-PACKAGE email header for the GNU Bug Tracker.
     
      ## Documentation/piem.texi ##
    @@ piem.el: (defun piem--merge-config-inboxes ()
                            (group (one-or-more not-newline)) "."
                            (group
     -                       (or "address" "coderepo" "listid" "maildir" "url"))
    -+                       (or "address" "coderepo" "listid" "maildir" "url" "gnu-package"))
    ++                       (or "address" "coderepo"
    ++                           "listid" "maildir"
    ++                           "url" "gnu-package"))
                            string-end)
                        key)
                   (let* ((inbox-name (match-string 1 key))
2:  cfd68e3a ! 2:  614c8fac gnus: Skip adding mboxrd from-line when not needed.
    @@ Metadata
     Author: Jelle Licht <jlicht@fsfe.org>
     
      ## Commit message ##
    -    gnus: Skip adding mboxrd from-line when not needed.
    +    gnus: Skip adding mboxrd from-line when not needed
    +
    +    When using Gnus over NNTP, `gnus-summary-display-article' shows a
    +    plain message, but when debbugs.el visits an issue message with Gnus,
    +    it's already in mbox format.
    +
    +    Link: https://inbox.kyleam.com/piem/87cz2dun0y.fsf@kyleam.com
     
      ## piem-gnus.el ##
     @@ piem-gnus.el: (defun piem-gnus-get-mid ()
    @@ piem-gnus.el: (defun piem-gnus-get-mid ()
                mid)))))
      
     +(defun piem-gnus--from-line (buffer)
    -+  "Returns a cons of the first line of BUFFER, if it is an
    -+mbboxrd from-line (or nil if none), and the remaining lines of
    -+BUFFER."
    ++  "Split a buffer into from-line and the rest of the message.
    ++
    ++Returns a cons of the first line of BUFFER, if it is an mboxrd
    ++from-line (or nil if none), and the remaining lines of BUFFER."
     +  (with-current-buffer buffer
     +    (let ((start (point-min))
     +          (end (point-max)))
3:  3d0fd6b7 ! 3:  7bd0c696 piem: Add piem-inbox-by-gnu-package-match.
    @@ Metadata
     Author: Jelle Licht <jlicht@fsfe.org>
     
      ## Commit message ##
    -    piem: Add piem-inbox-by-gnu-package-match.
    +    piem: Add piem-inbox-by-gnu-package-match
     
      ## piem.el ##
     @@ piem.el: (defun piem--message-fetch-decoded-fields (headers)
    @@ piem.el: (defun piem--message-fetch-decoded-fields (headers)
      
     +(defun piem-inbox-by-gnu-package-match (gnu-package)
     +  "Return inbox based on matching :gnu-package properties.
    -+GNU-PACKAGE should be a string. This function is intended to be
    ++GNU-PACKAGE should be a string.  This function is intended to be
     +used by libraries implementing a function for
     +`piem-get-inbox-function'."
     +  (when gnu-package
    @@ piem.el: (defun piem--message-fetch-decoded-fields (headers)
     +               (p-package (plist-get info :gnu-package)))
     +          (when (and gnu-package
     +                     p-package
    -+                     (string-match-p p-package gnu-package))
    ++                     (string-match-p (regexp-quote p-package)
    ++                                     gnu-package))
     +            (throw 'hit (car inbox))))))))
     +
      (defun piem-inbox-by-header-match ()
4:  033dfd22 < -:  -------- gnus: Add support for matching inbox by X-GNU-PR-PACKAGE header.
-:  -------- > 4:  7d8ce7f0 piem-inbox-by-header-match: Fallback to matching via :gnu-package
5:  d74e4f02 ! 5:  0377247e Add basic integration for debbugs.
    @@ Metadata
     Author: Jelle Licht <jlicht@fsfe.org>
     
      ## Commit message ##
    -    Add basic integration for debbugs.
    +    Add basic integration for debbugs
    +
    + ## Documentation/piem.texi ##
    +@@ Documentation/piem.texi: Registering inboxes
    + 
    + @node Enabling integration libraries
    + @section Enabling integration libraries
    ++@findex piem-debbugs-mode
    + @findex piem-elfeed-mode
    + @findex piem-eww-mode
    + @findex piem-gnus-mode
    +@@ Documentation/piem.texi: Enabling integration libraries
    + currently has libraries to support
    + 
    + @itemize
    ++@item Debbugs
    + @item EWW
    + @item Elfeed
    + @item Gnus
    +
    + ## Makefile ##
    +@@ Makefile: EMACS   = emacs
    + # Rely on EMACSLOADPATH for everything but the current directory.
    + BATCH   = $(EMACS) --batch -Q -L . -L tests
    + 
    +-EL = piem.el piem-b4.el piem-elfeed.el piem-eww.el piem-gnus.el \
    +-     piem-lei.el piem-maildir.el piem-notmuch.el piem-rmail.el \
    +-     tests/piem-lei-tests.el tests/piem-rmail-tests.el tests/piem-tests.el
    ++EL = piem.el piem-b4.el piem-debbugs.el piem-elfeed.el piem-eww.el	\
    ++     piem-gnus.el piem-lei.el piem-maildir.el piem-notmuch.el		\
    ++     piem-rmail.el tests/piem-lei-tests.el tests/piem-rmail-tests.el	\
    ++     tests/piem-tests.el
    + ELC = $(EL:.el=.elc)
    + 
    + all: compile Documentation/piem.info piem-autoloads.el
    +@@ Makefile: docs: Documentation/piem.html Documentation/piem.info
    + 
    + piem-b4.elc: piem-b4.el piem.elc
    + piem-elfeed.elc: piem-elfeed.el piem.elc
    ++piem-debbugs.elc: piem-debbugs.el piem.elc
    + piem-eww.elc: piem-eww.el piem.elc
    + piem-gnus.elc: piem-gnus.el piem.elc
    + piem-lei.elc: piem-lei.el piem.elc
     
      ## piem-debbugs.el (new) ##
     @@
    -+;;; piem-debbugs.el --- debbugs.el integration for piem  -*- lexical-binding: t; -*-
    ++;;; piem-debbugs.el --- Debbugs integration for piem  -*- lexical-binding: t; -*-
     +
     +;; Copyright all piem contributors <piem@inbox.kyleam.com>
     +
    -+;; Author: Kyle Meyer <kyle@kyleam.com>
    ++;; Author: Jelle Licht <jlicht@fsfe.org>
     +;; Keywords: vc, tools
    -+;; Package-Requires: ((emacs "26.3"))
    ++;; Package-Requires: ((emacs "26.3")(debbugs "0.29"))
     +
     +;; This program is free software; you can redistribute it and/or modify
     +;; it under the terms of the GNU General Public License as published by
    @@ piem-debbugs.el (new)
     +
     +;; This library provides a minor mode, `piem-debbugs-mode', that modifies
     +;; `piem' variables to teach functions like `piem-inbox' how to
    -+;; extract information from debbugs buffers.
    ++;; extract information from Debbugs buffers.
     +
     +;;; Code:
     +
    -+(require 'debbugs)
    ++(require 'debbugs-gnu)
     +(require 'piem)
     +
     +(defgroup piem-debbugs nil
    -+  "debbugs integration for piem."
    ++  "Debbugs integration for piem."
     +  :group 'piem)
     +
     +(defun piem-debbugs-get-inbox ()
    -+  "Return inbox name from a debbugs buffer."
    -+  (when (derived-mode-p 'debbugs-gnu-mode)
    ++  "Return inbox name from a Debbugs buffer."
    ++  (when (and (derived-mode-p 'debbugs-gnu-mode)
    ++             (boundp 'debbugs-gnu-local-query))
     +    (when-let ((gnu-package (alist-get 'package debbugs-gnu-local-query)))
     +      (piem-inbox-by-gnu-package-match gnu-package))))
     +
     +(defun piem-debbugs-get-mid ()
    -+  "Return the message ID of a debbugs buffer."
    ++  "Return the message ID of a Debbugs buffer."
     +  (when (derived-mode-p 'debbugs-gnu-mode)
     +    (let ((msgid (alist-get 'msgid (debbugs-gnu-current-status))))
     +      (when (stringp msgid)
    @@ piem-debbugs.el (new)
     +
     +;;;###autoload
     +(define-minor-mode piem-debbugs-mode
    -+  "Toggle debbugs support for piem.
    ++  "Toggle Debbugs support for piem.
     +With a prefix argument ARG, enable piem-debbugs mode if ARG is
     +positive, and disable it otherwise.  If called from Lisp, enable
     +the mode if ARG is omitted or nil."

  parent reply	other threads:[~2023-06-10 23:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08 16:59 [PATCH 1/2] piem: Add :gnu-package keyword to piem-inboxes jlicht
2023-06-08 16:59 ` [PATCH 2/2] gnus: Skip adding mboxrd from-line when not needed jlicht
2023-06-09 12:48 ` [PATCH v2 0/5] New piem-debbugs integration jlicht
2023-06-09 12:48   ` [PATCH v2 1/5] piem: Add :gnu-package keyword to piem-inboxes jlicht
2023-06-10  4:52     ` Kyle Meyer
2023-06-10 10:02       ` Jelle Licht
2023-06-09 12:48   ` [PATCH v2 2/5] gnus: Skip adding mboxrd from-line when not needed jlicht
2023-06-10  4:55     ` Kyle Meyer
2023-06-10 10:07       ` Jelle Licht
2023-06-09 12:48   ` [PATCH v2 3/5] piem: Add piem-inbox-by-gnu-package-match jlicht
2023-06-10  4:57     ` Kyle Meyer
2023-06-10 10:08       ` Jelle Licht
2023-06-09 12:48   ` [PATCH v2 4/5] gnus: Add support for matching inbox by X-GNU-PR-PACKAGE header jlicht
2023-06-10  4:58     ` Kyle Meyer
2023-06-10 10:08       ` Jelle Licht
2023-06-09 12:48   ` [PATCH v2 5/5] Add basic integration for debbugs jlicht
2023-06-10  4:59     ` Kyle Meyer
2023-06-10 10:11       ` Jelle Licht
2023-06-10  5:00   ` [PATCH v2 0/5] New piem-debbugs integration Kyle Meyer
2023-06-10  9:58 ` [PATCH v3 " jlicht
2023-06-10  9:58   ` [PATCH v3 1/5] piem: Add :gnu-package keyword to piem-inboxes jlicht
2023-06-10  9:58   ` [PATCH v3 2/5] gnus: Skip adding mboxrd from-line when not needed jlicht
2023-06-10  9:58   ` [PATCH v3 3/5] piem: Add piem-inbox-by-gnu-package-match jlicht
2023-06-10 23:17     ` Kyle Meyer
2023-06-10  9:58   ` [PATCH v3 4/5] piem-inbox-by-header-match: Fallback to matching via :gnu-package jlicht
2023-06-10  9:58   ` [PATCH v3 5/5] Add basic integration for debbugs jlicht
2023-06-10 23:16   ` Kyle Meyer [this message]
2023-06-10 23:46     ` [PATCH v3 0/5] New piem-debbugs integration Jelle Licht
2023-06-11  0:55       ` Kyle Meyer

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=874jne29hx.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=jlicht@fsfe.org \
    --cc=piem@inbox.kyleam.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).