Skip to content

Instantly share code, notes, and snippets.

@m0smith
Created October 30, 2016 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m0smith/1d4279dd406920d357ca324e5628a38f to your computer and use it in GitHub Desktop.
Save m0smith/1d4279dd406920d357ca324e5628a38f to your computer and use it in GitHub Desktop.
(defun list-to-hash (coll)
(let ((rtnval (make-hash-table :test 'equal)))
(cl-loop for r across coll
when r
do (puthash (elt r 1) nil rtnval))
rtnval))
(defun jdee-open-source-resource-in-archive-p (archive resource)
""
(interactive)
(when (and (file-exists-p archive)
(not (file-directory-p archive)))
(let ((buffer (find-file-noselect archive)))
(when buffer
(with-current-buffer buffer
(let* ((files archive-files)
(r (list-to-hash files)))
(if (eq 'missing (gethash resource r 'missing))
nil
(list archive resource))))))))
(defun jdee-open-source-resource-in-classpath (resource)
(cl-loop for p in jdee-global-classpath
for rtnval = (jdee-open-source-resource-in-archive-p r resource)
when rtnval
return rtnval))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment