diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-06-07 15:19:15 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-06-07 15:19:15 -0700 |
commit | f0e8b3011d830c311c53a389909982ceb44f25a0 (patch) | |
tree | b35fbae2c78646e135817e90facdf04790074709 /mailscripts.el | |
parent | d127bf670061df22ed3f86a1efec4fcb6d09a1b9 (diff) | |
parent | 42e8b6cb2ccdbc7a91b322383c1f3b20d745e095 (diff) | |
download | mailscripts-f0e8b3011d830c311c53a389909982ceb44f25a0.tar.gz |
Merge tag 'debian/0.21-1' into buster-bpo
mailscripts release 0.21-1 for unstable (sid) [dgit]
[dgit distro=debian no-split --quilt=linear]
# gpg: Signature made Mon 01 Jun 2020 10:17:16 AM MST
# gpg: using RSA key 9B917007AE030E36E4FC248B695B7AE4BF066240
# gpg: Good signature from "Sean Whitton <spwhitton@spwhitton.name>" [ultimate]
# Primary key fingerprint: 8DC2 487E 51AB DD90 B5C4 753F 0F56 D055 3B6D 411B
# Subkey fingerprint: 9B91 7007 AE03 0E36 E4FC 248B 695B 7AE4 BF06 6240
Diffstat (limited to 'mailscripts.el')
-rw-r--r-- | mailscripts.el | 31 |
1 files changed, 26 insertions, 5 deletions
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 |