summaryrefslogtreecommitdiff
path: root/blog.el
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2015-12-05 18:14:12 +0100
committerGuido Günther <agx@sigxcpu.org>2015-12-06 15:00:27 +0100
commit9da6cdecbb55dc3696fc2c94d47d193f4cf5e9c2 (patch)
tree8537867d8db0ee32c33ba926e3f05164cb229392 /blog.el
parentb5bcc322b78af39a7b422a1337f413e82cb93f84 (diff)
Add blog-insert-debian-bts-markdown-link
This allows to easily link to Debian's BTS
Diffstat (limited to 'blog.el')
-rw-r--r--blog.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/blog.el b/blog.el
index cf9f5d7..5c8dc0d 100644
--- a/blog.el
+++ b/blog.el
@@ -15,3 +15,21 @@
)
(when bounds (delete-region (car bounds) (cdr bounds)))
(markdown-insert-reference-link text "" url "")))
+
+(defun blog-insert-debian-bts-markdown-link ()
+ "Read CVE/DSA number and create link to security tracker"
+ (interactive)
+ (let* (
+ (bounds (or (and (markdown-use-region-p)
+ (cons (region-beginning) (region-end)))
+ (markdown-bounds-of-thing-at-point 'symbol)))
+ (text (if bounds
+ (buffer-substring (car bounds) (cdr bounds))
+ (read-string "Bugnumber Number: ")))
+ (bugnum (if (string-prefix-p "#" text)
+ (substring text 1)
+ text))
+ (url (concat "http://bugs.debian.org/" bugnum))
+ )
+ (when bounds (delete-region (car bounds) (cdr bounds)))
+ (markdown-insert-reference-link text "" url "")))