Accessing CLHS from dash(OSX) and velocity (Windows)
Hi,
Some time ago I've written about quite good tool called Dash which allows to open quickly multiple documentation on OSX, including CLHS, and my binding to LW IDE for OSX which allows quickly look-up in CLHS.#+:mswindows
(fli:define-foreign-function (shell-execute "ShellExecute" :dbcs)
((hwnd fli-hwnd)
(lp-operation :pointer)
(lp-file :pointer)
(lp-parameters :pointer)
(lp-directory :pointer)
(n-show-cmd :int32))
:result-type (:unsigned :long)
:documentation "Performs an operation on a specified file.")
(defun open-in-dash (name)
(let ((url (concatenate 'string "dash://" name)))
#+:mswindows
(let ((null-ptr (fli:make-pointer :address 0 :type :void)))
(fli:with-foreign-string (text element-count byte-count
:external-format :unicode)
url
(declare (ignore element-count byte-count))
(shell-execute 0 null-ptr text null-ptr null-ptr 5)))
#+:cocoa
(objc:invoke (objc:invoke "NSWorkspace" "sharedWorkspace") "openURL:" (objc:invoke "NSURL" "URLWithString:" url))))
(editor:defcommand "Search In Dash" (p &optional name)
"Search current word in Dash"
"Search current word in Dash"
(let* ((name (format nil "~a" (editor:get-symbol-from-point (editor:current-point)))))
(open-in-dash name)))
(editor:bind-key "Search In Dash" "Ctrl-F1" :global)