diff options
Diffstat (limited to 'blog.el')
-rw-r--r-- | blog.el | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 ""))) |