From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:203:375::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12.migadu.com with LMTPS id 8A06ImwEhWRUVAAATFOONw (envelope-from ) for ; Sun, 11 Jun 2023 01:17:00 +0200 Received: from mta1.migadu.com ([2001:41d0:203:375::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uJAJIWwEhWQTKgEAG6o9tA (envelope-from ) for ; Sun, 11 Jun 2023 01:17:00 +0200 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1686439020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=zmtolGuXDW5r9MjoBUy9++1VLzB3IfrdKYrp1ztMagQ=; b=d54nxbfWDfyLiTIPRzicTQmDQoCeo4ZbFu6GjN4LlJSBz+xq4qVKY8bHdhTrNB3+M2/4bq YAs10xejfsFg172IomCPLJNwDmRdDY42R0qjirjbjFYoQkS9ZaIAs1UkuKwI1T3FDVLOxE atAAiysLeFbFncP3z529JTQbFhQu3HtkQ+nW6dDTKiVmbF+LQL3Nc0BDH329Uk+4hB+qvl c5qzxL3WhPUMDLkMpvOMv7qB5T4MTEe5TTvR7qGYUBaWTaMJiLGKBPz61FlNoyNARJ3y4j EqjI0raQoX46APQQLgGp0HfQdf3QQtcn0+kQTBeTkE/GJzV/GbCP6uBCqLHsTg== From: Kyle Meyer To: jlicht@fsfe.org Cc: piem@inbox.kyleam.com Subject: Re: [PATCH v3 0/5] New piem-debbugs integration In-Reply-To: <20230610095858.26982-1-jlicht@fsfe.org> Date: Sat, 10 Jun 2023 19:16:58 -0400 Message-ID: <874jne29hx.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-TUID: 0n5WbsTgTBuu jlicht@fsfe.org writes: > From: Jelle Licht > > 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 ## 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 ## 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 ## 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 + -+;; Author: Kyle Meyer ++;; Author: Jelle Licht +;; 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."