Commit f1b2d20f authored by Kungsgeten's avatar Kungsgeten Committed by Jason Blevins

Add org-store-link support from deft-mode buffer. (#29)

parent 981dd9a2
......@@ -1698,6 +1698,27 @@ Otherwise, quick create a new file."
;; If a buffer is no longer open, remove it from auto save list.
(delq buf deft-auto-save-buffers))))
;;; Org-link
(defun org-deft-store-link ()
"Store the deft widget at point as an org-mode link."
(when (equal major-mode 'deft-mode)
(let ((link (concat "deft:" (substring (deft-filename-at-point)
(1+ (length deft-directory)))))
(title (deft-file-title (deft-filename-at-point))))
(org-store-link-props
:type "deft"
:link link
:description title))))
(org-add-link-type
"deft"
(lambda (handle)
(org-open-file-with-emacs
(expand-file-name handle deft-directory))))
(add-hook 'org-store-link-functions 'org-deft-store-link)
;;; Mode definition
(defun deft-show-version ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment