summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog17
-rw-r--r--debian/control1
-rw-r--r--mailscripts.el31
-rwxr-xr-xmbox-extract-patch2
4 files changed, 46 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 7b863c9..501fd47 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
+mailscripts (0.21-1) unstable; urgency=medium
+
+ * mailscripts.el:
+ - new command: notmuch-slurp-debbug-at-point
+ - notmuch-slurp-this-debbug: if fail to extract bug number from
+ subject line, prompt user for one
+ - notmuch-slurp-debbug: invoke notmuch to determine the thread-id
+ rather than passing the search query directly to `notmuch-show'.
+ That is not how `notmuch-show' is meant to be called and can result
+ in strange behaviour.
+ * mbox-extract-patch: When inserting trailers, ensure there is a blank
+ line before the block of trailers.
+ * Add a Homepage: to the Debian packaging metadata (Closes: #961664).
+ Thanks to Daniel Kahn Gillmor for the patch.
+
+ -- Sean Whitton <spwhitton@spwhitton.name> Mon, 01 Jun 2020 10:11:47 -0700
+
mailscripts (0.20-1~bpo10+1) buster-backports; urgency=medium
* Rebuild for buster-backports.
diff --git a/debian/control b/debian/control
index 0eb4ea2..4dc17f7 100644
--- a/debian/control
+++ b/debian/control
@@ -18,6 +18,7 @@ Build-Depends:
python3-argcomplete,
Vcs-Git: https://git.spwhitton.name/mailscripts
Vcs-Browser: https://git.spwhitton.name/mailscripts
+Homepage: https://git.spwhitton.name/mailscripts
Package: elpa-mailscripts
Architecture: all
diff --git a/mailscripts.el b/mailscripts.el
index 2280f5a..50e3b89 100644
--- a/mailscripts.el
+++ b/mailscripts.el
@@ -1,10 +1,10 @@
;;; mailscripts.el --- functions to access tools in the mailscripts package
;; Author: Sean Whitton <spwhitton@spwhitton.name>
-;; Version: 0.20
+;; Version: 0.21
;; Package-Requires: (notmuch projectile)
-;; Copyright (C) 2018, 2019 Sean Whitton
+;; Copyright (C) 2018, 2019, 2020 Sean Whitton
;; 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
@@ -23,6 +23,7 @@
(require 'notmuch)
(require 'projectile)
+(require 'thingatpt)
(defgroup mailscripts nil
"Customisation of functions in the mailscripts package.")
@@ -53,15 +54,35 @@ If NO-OPEN, don't open the thread."
(interactive "sBug number: ")
(call-process-shell-command (concat "notmuch-slurp-debbug " bug))
(unless no-open
- (notmuch-show (concat "Bug#" bug))))
+ (let* ((search (concat "Bug#" bug))
+ (thread-id (car (process-lines notmuch-command
+ "search"
+ "--output=threads"
+ "--limit=1"
+ "--format=text"
+ "--format-version=4" search))))
+ (notmuch-show thread-id nil nil nil
+ (concat "*notmuch-show-" search "*")))))
+
+;;;###autoload
+(defun notmuch-slurp-debbug-at-point ()
+ "Slurp Debian bug with bug number at point and open the thread in notmuch."
+ (interactive)
+ (save-excursion
+ ;; the bug number might be prefixed with a # or 'Bug#'; try
+ ;; skipping over those to see if there's a number afterwards
+ (skip-chars-forward "#bBug" (+ 4 (point)))
+ (notmuch-slurp-debbug (number-to-string (number-at-point)))))
;;;###autoload
(defun notmuch-slurp-this-debbug ()
"When viewing a Debian bug in notmuch, download any missing messages."
(interactive)
(let ((subject (notmuch-show-get-subject)))
- (when (string-match "Bug#\\([0-9]+\\):" subject)
- (notmuch-slurp-debbug (match-string 1 subject) t))
+ (notmuch-slurp-debbug
+ (if (string-match "Bug#\\([0-9]+\\):" subject)
+ (match-string 1 subject)
+ (read-string "Bug number: ")) t)
(notmuch-refresh-this-buffer)))
;;;###autoload
diff --git a/mbox-extract-patch b/mbox-extract-patch
index 276895b..31e6ceb 100755
--- a/mbox-extract-patch
+++ b/mbox-extract-patch
@@ -178,6 +178,8 @@ package Mail::Message {
}
}
+ $i == 0 or $lines[$i - 1] =~ /^$/ or unshift @new_ts, "\n";
+
splice @lines, $i, 0, @new_ts;
my $body = Mail::Message::Body->new(
charset => "PERL",