-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfuncs.el
30 lines (27 loc) · 924 Bytes
/
funcs.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
;;; funcs.el --- Orgwiki Layer functions File for Spacemacs
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: Swaroop C H <[email protected]>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;;; Code:
;; Modified version of `org-wiki-asset-insert-file'
(defun spacemacs/orgwiki-insert-asset-link ()
"Insert link [[file:<page>/<file>]] to asset file of current page at point.
Insert an asset file of current page at point providing a Helm completion.
Example: [[Linux/LinuxManual.pdf]]"
(interactive)
(let ((pagename (file-name-base (buffer-file-name))))
(org-wiki--asset-helm-selection
pagename
(lambda (file)
(insert (format "[[file:%s/%s]]"
pagename
file
)))))
(when org-startup-with-inline-images
(org-display-inline-images)))