[Org] Add link types for Outlook and OneNote
This commit is contained in:
parent
71a11c52db
commit
63b2e34be4
19
init.el
19
init.el
|
@ -567,7 +567,9 @@ search commands like `db/helm-shortcuts’."
|
||||||
db/pretty-print-xml
|
db/pretty-print-xml
|
||||||
db/bookmark-add-external
|
db/bookmark-add-external
|
||||||
db/bookmark-add-url
|
db/bookmark-add-url
|
||||||
db/lookup-smime-key))
|
db/lookup-smime-key
|
||||||
|
db/org-onenote-open
|
||||||
|
db/org-outlook-open))
|
||||||
|
|
||||||
(use-package hydra
|
(use-package hydra
|
||||||
:commands (defhydra))
|
:commands (defhydra))
|
||||||
|
@ -643,6 +645,16 @@ search commands like `db/helm-shortcuts’."
|
||||||
hydra-org-clock/body
|
hydra-org-clock/body
|
||||||
db/make-org-capture-frame))
|
db/make-org-capture-frame))
|
||||||
|
|
||||||
|
(defcustom db/path-to-onenote "c:/Program Files (x86)/Microsoft Office/Office15/ONENOTE.EXE"
|
||||||
|
"Path to OneNote executable, for opening corresponding org-mode links."
|
||||||
|
:group 'personal-settings
|
||||||
|
:type 'file)
|
||||||
|
|
||||||
|
(defcustom db/path-to-outlook "c:/Program Files (x86)/Microsoft Office/Office15/OUTLOOK.EXE"
|
||||||
|
"Path to Outlook executable, for opening corresponding org-mode links."
|
||||||
|
:group 'personal-settings
|
||||||
|
:type 'file)
|
||||||
|
|
||||||
(use-package org
|
(use-package org
|
||||||
:commands (org-store-link)
|
:commands (org-store-link)
|
||||||
:bind (:map org-mode-map
|
:bind (:map org-mode-map
|
||||||
|
@ -762,6 +774,11 @@ search commands like `db/helm-shortcuts’."
|
||||||
(when (eq system-type 'cygwin)
|
(when (eq system-type 'cygwin)
|
||||||
(add-to-list 'org-file-apps '(t . "cygstart %s") t))
|
(add-to-list 'org-file-apps '(t . "cygstart %s") t))
|
||||||
|
|
||||||
|
;; Custom link types for Windows
|
||||||
|
(when (eq system-type 'windows-nt)
|
||||||
|
(org-link-set-parameters "onenote" :follow #'db/org-onenote-open)
|
||||||
|
(org-link-set-parameters "outlook" :follow #'db/org-outlook-open))
|
||||||
|
|
||||||
;; 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)
|
||||||
|
|
||||||
|
|
|
@ -507,6 +507,18 @@ This is done only if the value of this variable is not null."
|
||||||
(call-process "xrandr" nil nil nil
|
(call-process "xrandr" nil nil nil
|
||||||
"--output" "HDMI-3" "--off"))
|
"--output" "HDMI-3" "--off"))
|
||||||
|
|
||||||
|
(defun db/org-onenote-open (path)
|
||||||
|
"Visit OneNote document on PATH."
|
||||||
|
(unless (file-executable-p db/path-to-onenote)
|
||||||
|
(user-error "Path for OneNote is not executable, please customize `db/path-to-onenote’."))
|
||||||
|
(start-process "OneNote" nil db/path-to-onenote "/hyperlink" path))
|
||||||
|
|
||||||
|
(defun db/org-outlook-open (id)
|
||||||
|
"Open the Outlook item identified by ID.
|
||||||
|
ID should be an Outlook GUID."
|
||||||
|
(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)))
|
||||||
|
|
||||||
;;; Bookmarks
|
;;; Bookmarks
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue