Skip to content

Instantly share code, notes, and snippets.

@larsen
Created June 28, 2016 15:34
Show Gist options
  • Select an option

  • Save larsen/86aa9efc9022647a5b98a17b3f00f971 to your computer and use it in GitHub Desktop.

Select an option

Save larsen/86aa9efc9022647a5b98a17b3f00f971 to your computer and use it in GitHub Desktop.
Automatic webjump list from org
(defun get-webjump-sites ()
(with-current-buffer (get-file-buffer "~/Dropbox/stefanorodighiero.net/links.org")
(delq nil
(mapcar
(lambda (i)
(let ((item-string (cdr (assoc "ITEM" i)))
(regex "\\[\\[\\(.*\\)\\]\\[\\(.*\\)\\]\\]"))
(if (posix-string-match regex item-string)
`(,(match-string 2 item-string) . ,(match-string 1 item-string)))))
(org-map-entries 'org-entry-properties nil 'file)))))
(setq webjump-sites (get-webjump-sites))
@larsen
Copy link
Author

larsen commented Jun 28, 2016

(defun get-webjump-sites2 ()
  (let ((regex "\\[\\[\\(.*\\)\\]\\[\\(.*\\)\\]\\]"))
    (with-current-buffer (get-file-buffer "~/Dropbox/stefanorodighiero.net/links.org")
      (loop for i in (org-map-entries 'org-entry-properties nil 'file)
            for item-string = (cdr (assoc "ITEM" i))
            if (string-match regex item-string)
            collect `(,(match-string 2 item-string) . ,(match-string 1 item-string))))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment