summaryrefslogtreecommitdiff
path: root/mailscripts.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-05-23 10:52:03 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-05-23 10:52:03 -0700
commit28b889404a73093ace55868e28fa41cdb5d4a3fb (patch)
tree627d2b82a22914ca96a19f22796fa2ad1f10e12e /mailscripts.el
parentab4acbc313dc1a20e166045e61c603053c4f00dc (diff)
downloadmailscripts-28b889404a73093ace55868e28fa41cdb5d4a3fb.tar.gz
add notmuch-slurp-debbug-at-point
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'mailscripts.el')
-rw-r--r--mailscripts.el15
1 files changed, 13 insertions, 2 deletions
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 <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.")
@@ -56,6 +57,16 @@ If NO-OPEN, don't open the thread."
(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."
(interactive)