-
Notifications
You must be signed in to change notification settings - Fork 2
/
org-annotate-dired.el
35 lines (26 loc) · 1.13 KB
/
org-annotate-dired.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;;; org-annotate-dired.el --- Support for links to files in dired in Org mode
;; Copyright (C) 2020
;; Author: George Moutsopoulos <[email protected]>
;; Version: 1.0
;; Package-Requires: ((org-mode) (org-annotate-code))
;; Keywords: annotate, capture, code, comments
;;; Commentary:
;; This package provides links that point to files when in dired.
;; It integrates with org-annotate-code to provide annotations to them.
;;; Code:
(require 'org-annotate-code)
(require 'ol)
(defun org-annotate-dired-get-filename ()
"Return filename at point."
(expand-file-name (dired-get-filename)))
(defun org-annotate-dired-make-annotation-from-filename (filename)
"Make annotation from FILENAME."
(list (list :id (format "[[file:%s]]" filename)
:heading filename)))
(defun org-annotate-code-info-at-point-dired ()
"Return a plist with word info at point."
(let ((filename (org-annotate-dired-get-filename)))
(org-annotate-dired-make-annotation-from-filename filename)))
(add-to-list 'org-annotate-code-info-alist (cons 'dired-mode 'org-annotate-code-info-at-point-dired))
(provide 'org-annotate-dired)
;;; org-annotate-dired.el ends here