1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- (require 'org)
- (require 'url)
- (defun org-browser-url-store-link ()
- "Store a browser URL as an org link from the bookmarklet"
- (if (boundp 'org-browser-url-args)
- (let* ((stored (url-generic-parse-url org-browser-url-args))
- (path (split-string (aref stored 6) "/"))
- (parsed (url-generic-parse-url
- (mapconcat 'identity (cddr path) "/")))
- (type (aref parsed 1))
- (link (aset parsed 7 (aref stored 7)))
- (link (url-recreate-url parsed))
- (description (url-unhex-string (nth 1 path))))
- (org-store-link-props
- :type type :link link :description description))))
- (add-hook 'org-store-link-functions 'org-browser-url-store-link)
- (provide 'org-browser-url)
|