[Org] A custom link type for RFCs
This commit is contained in:
parent
f518c0ca3d
commit
f2115f5587
6
init.el
6
init.el
|
@ -569,7 +569,8 @@ search commands like `db/helm-shortcuts’."
|
||||||
db/bookmark-add-url
|
db/bookmark-add-url
|
||||||
db/lookup-smime-key
|
db/lookup-smime-key
|
||||||
db/org-onenote-open
|
db/org-onenote-open
|
||||||
db/org-outlook-open))
|
db/org-outlook-open
|
||||||
|
db/org-rfc-open))
|
||||||
|
|
||||||
(use-package hydra
|
(use-package hydra
|
||||||
:commands (defhydra))
|
:commands (defhydra))
|
||||||
|
@ -782,6 +783,9 @@ search commands like `db/helm-shortcuts’."
|
||||||
;; Skip some org mode regions to be skipped by ispell
|
;; Skip some org mode regions to be skipped by ispell
|
||||||
(add-hook 'org-mode-hook #'endless/org-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
|
;; Some timers
|
||||||
|
|
||||||
(unless (memq #'org-clock-save
|
(unless (memq #'org-clock-save
|
||||||
|
|
|
@ -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)
|
(unless (file-executable-p db/path-to-outlook)
|
||||||
(user-error "Path for Outlook is not executable, please customize `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)))
|
(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
|
;;; Bookmarks
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue