From 28b889404a73093ace55868e28fa41cdb5d4a3fb Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 23 May 2020 10:52:03 -0700 Subject: add notmuch-slurp-debbug-at-point Signed-off-by: Sean Whitton --- debian/changelog | 7 +++++++ mailscripts.el | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 11aa2dc..6565a39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mailscripts (0.20-2) UNRELEASED; urgency=medium + + * mailscripts.el: + - new command: notmuch-slurp-debbug-at-point + + -- Sean Whitton Sat, 23 May 2020 10:49:57 -0700 + mailscripts (0.20-1) unstable; urgency=medium * imap-dl: Fix failure when python3-gssapi isn't installed (Closes: #955011). diff --git a/mailscripts.el b/mailscripts.el index 2280f5a..3e5b3b5 100644 --- a/mailscripts.el +++ b/mailscripts.el @@ -1,10 +1,10 @@ ;;; mailscripts.el --- functions to access tools in the mailscripts package ;; Author: Sean Whitton -;; 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.") @@ -55,6 +56,16 @@ If NO-OPEN, don't open the thread." (unless no-open (notmuch-show (concat "Bug#" bug)))) +;;;###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." -- cgit v1.2.3