Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove hardcoded path names in some variables

  • Loading branch information...
commit 4bed09a6a2c00fcb3481d1ec894173806cc88bd9 1 parent fc7c1cd
@leoliu authored
Showing with 15 additions and 5 deletions.
  1. +15 −5 docsetutil.el
View
20 docsetutil.el
@@ -26,9 +26,6 @@
(eval-when-compile (require 'cl))
(require 'url-parse)
-(defvar docsetutil-program "/Developer/usr/bin/docsetutil")
-(defvar docsetutil-docset-path "/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleSnowLeopard.CoreReference.docset")
-(defvar docsetutil-browse-url-function 'browse-url)
(defvar docsetutil-docset-search-paths
;; See: http://goo.gl/jiYPv
'("/Applications/Xcode.app/Contents/Developer/Documentation/DocSets"
@@ -40,8 +37,13 @@
"A list of directories where XCode search for docsets.")
-(defvar docsetutil-search-history nil)
-(defconst docsetutil-api-regexp "^ \\(.*?\\) \\(.*?\\) -- \\(.*\\)$")
+(defvar docsetutil-program "docsetutil"
+ "Executable for docsetutil.
+
+Normally it resides in one of the following directories:
+ /Applications/Xcode.app/Contents/Developer/usr/bin/
+or
+ /Developer/usr/bin/")
(defun docsetutil-all-docsets ()
"Return all docsets in `docsetutil-docset-search-paths'."
@@ -53,6 +55,14 @@
when (file-directory-p dir)
collect dir)))
+(defvar docsetutil-docset-path (car (last (docsetutil-all-docsets)))
+ "The docset to use by `docsetutil-search'.")
+
+(defvar docsetutil-browse-url-function 'browse-url)
+
+(defvar docsetutil-search-history nil)
+(defconst docsetutil-api-regexp "^ \\(.*?\\) \\(.*?\\) -- \\(.*\\)$")
+
;;;###autoload
(defun docsetutil-choose-docset (docset)
"Choose a DOCSET from all found by `docsetutil-all-docsets'."
Please sign in to comment.
Something went wrong with that request. Please try again.