summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2015-11-06 12:51:18 +0100
committerGuido Günther <agx@sigxcpu.org>2015-11-06 12:51:18 +0100
commit564a7466ca3baa9d790c94b9c4b8dc7a655edf51 (patch)
tree54805705095747c29966643b049748585dc5c81c
parent25c85a3bd36df03bc66bd7dcae5ce00664afaaf6 (diff)
Add some helper functions for blog entries
-rw-r--r--blog.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/blog.el b/blog.el
new file mode 100644
index 0000000..a8827ad
--- /dev/null
+++ b/blog.el
@@ -0,0 +1,17 @@
+;Markdown mode doesn't provide anything
+;(require 'markdown)
+
+(defun blog-insert-cve-markdown-link ()
+ "Read 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 "CVE Number: ")))
+ (url (concat "http://security-tracker.debian.org/tracker/" text))
+ )
+ (when bounds (delete-region (car bounds) (cdr bounds)))
+ (markdown-insert-reference-link text "" url "")))