From f2115f5587c7765d8846fab382b00aceff3270e6 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Fri, 31 May 2019 21:38:05 +0200 Subject: [PATCH] [Org] A custom link type for RFCs --- init.el | 6 +++++- site-lisp/db-utils.el | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 19ed725..8d98d58 100644 --- a/init.el +++ b/init.el @@ -569,7 +569,8 @@ search commands like `db/helm-shortcuts’." db/bookmark-add-url db/lookup-smime-key db/org-onenote-open - db/org-outlook-open)) + db/org-outlook-open + db/org-rfc-open)) (use-package hydra :commands (defhydra)) @@ -782,6 +783,9 @@ search commands like `db/helm-shortcuts’." ;; Skip some org mode regions to be skipped by ispell (add-hook 'org-mode-hook #'endless/org-ispell) + ;; Link type for RFCs + (org-link-set-parameters "rfc" :follow #'db/org-rfc-open) + ;; Some timers (unless (memq #'org-clock-save diff --git a/site-lisp/db-utils.el b/site-lisp/db-utils.el index 359ae37..750223b 100644 --- a/site-lisp/db-utils.el +++ b/site-lisp/db-utils.el @@ -519,6 +519,13 @@ This is done only if the value of this variable is not null." (unless (file-executable-p db/path-to-outlook) (user-error "Path for Outlook is not executable, please customize `db/path-to-outlook’.")) (w32-shell-execute "open" db/path-to-outlook (concat "/select outlook:" id))) + +(defun db/org-rfc-open (number) + "Open browser to show RFC of given NUMBER." + (unless (string-match "[1-9][0-9]*" number) + (user-error "Not a valid number for an RFC: %s" number)) + (browse-url (concat "https://tools.ietf.org/html/rfc" number))) + ;;; Bookmarks