diff options
author | Guido Günther <agx@sigxcpu.org> | 2015-11-06 12:51:18 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-11-06 12:51:18 +0100 |
commit | 564a7466ca3baa9d790c94b9c4b8dc7a655edf51 (patch) | |
tree | 54805705095747c29966643b049748585dc5c81c /blog.el | |
parent | 25c85a3bd36df03bc66bd7dcae5ce00664afaaf6 (diff) |
Add some helper functions for blog entries
Diffstat (limited to 'blog.el')
-rw-r--r-- | blog.el | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 ""))) |