Changeset 15626


Ignore:
Timestamp:
Jan 30, 2013, 3:01:27 PM (7 years ago)
Author:
gfoy
Message:

Added support for AppKiDo? lookup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cocoa-ide-contrib/foy/hemlock-commands-cm/hemlock-commands-new.lisp

    r15619 r15626  
    1313;;;
    1414;;;      Mod History, most recent first:
     15;;;      1/30/13 Added support for AppKiDo lookup.
    1516;;;      1/28/13 Improved parse-symbol.
    1617;;;      9/2/9   Added "Show Callers" command.
     
    2425(defParameter *mcl-doc* (merge-pathnames ";MCL-doc.lisp" cl-user::*hemlock-commands-directory*))
    2526
    26 ;;; Hemlock has some internal code to do this, but it appears to be broken
    27 ;;; and definitely does not work for ObjC methods.
    2827(defun parse-symbol ()
    2928  "Parse and return the symbol at point."
     
    3534      ;; NOTE: mark-symbol no longer removes the #\# in 1.9 trunk
    3635      (let* ((string (hi::region-to-string (hi::region mark1 mark2)))
    37              (objc-p (when string (char= (elt string 0) #\#)))
     36             (objc-p (when string (and (char= (elt string 0) #\#) (char= (elt string 1) #\/))))
    3837             (colons-start-position (when string
    3938                                      (unless objc-p (position #\: string))))
     
    127126       :text-view text-view :symbol sym) t)))
    128127
    129 ;;; This is inappropriately marking the buffer as modified.  Added a workaround.
     128(defun display-appkido-doc (symbol-string)
     129  "If AppKiDo is available, display the doc"
     130  (hemlock-ext:string-to-clipboard symbol-string)
     131  (#_NSPerformService #@"Look Up in AppKiDo" (gui::general-pasteboard)))
     132     
    130133(defCommand "Symbol Documentation" (p)
    131134  "Display the documentation for the symbol at point."
     
    137140           (text-view (when pane (gui::text-pane-text-view pane))))
    138141      (cond ((and sym text-view)
    139              (cond ((eq (symbol-package sym) (find-package :common-lisp))
     142             (cond ((eq package (find-package :common-lisp))
    140143                    (or (display-ccl-doc sym text-view)
    141144                        (display-mcl-doc sym text-view)
    142145                        (gui::lookup-hyperspec-symbol sym text-view)))
     146                   ((eq package (find-package "NEXTSTEP-FUNCTIONS"))
     147                    (display-appkido-doc (symbol-name sym)))
    143148                   (t
    144149                    (or (display-ccl-doc sym text-view)
Note: See TracChangeset for help on using the changeset viewer.