Changeset 12745


Ignore:
Timestamp:
Sep 2, 2009, 7:01:47 PM (10 years ago)
Author:
gfoy
Message:

Added 'Show Callers', control-meta-c

Location:
trunk/source/contrib/foy/hemlock-commands-cm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/contrib/foy/hemlock-commands-cm/hemlock-commands-1.lisp

    r12735 r12745  
    1515;;;
    1616;;;      Mod History, most recent first:
     17;;;      9/2/9   Removed doc-path from hemlock-commands-menu.
    1718;;;      8/31/9  version 0.1b1
    1819;;;              First cut.
     
    4243  ((tool-menu :initform nil :accessor tool-menu)
    4344   (sub-title :initform "basic commands" :reader sub-title)
    44    (doc-path :initform (merge-pathnames ";ReadMe.rtf" cl-user::*hemlock-commands-directory*) :reader doc-path)
    4545   (text-view :initform nil :accessor text-view))
    4646  (:documentation "A popup menu listing a useful subset of Hemlock commands: Hemlock's Greatest Hits, for new users.")
     
    6767             (setf (key-event menu-item) key-event)
    6868             (#/addItem: menu menu-item))))
    69     (setf (tool-menu menu) (cmenu:add-default-tool-menu menu :doc-file (doc-path menu)))
     69    (setf (tool-menu menu) (cmenu:add-default-tool-menu menu))
    7070   
    7171    ;;; Hemlock's Greatest Hits:
     
    7777    (create-menu-item "Current Function Arglist  (control-x, control-a)"
    7878                      #k"control-x control-a")
    79     #|
     79    (create-menu-item "Goto Definition  (meta-.)"
     80                      #k"meta-.")
    8081    (create-menu-item "Show Callers  (control-meta-c)"
    8182                      #k"control-meta-c")
    82     |#
    83     (create-menu-item "Goto Definition  (meta-.)"
    84                       #k"meta-.")
    8583    (#/addItem: menu (#/separatorItem ns:ns-menu-item))
    8684    (create-menu-item "Macroexpand-1 Expression  (control-m)"
  • trunk/source/contrib/foy/hemlock-commands-cm/hemlock-commands-new.lisp

    r12735 r12745  
    1313;;;
    1414;;;      Mod History, most recent first:
     15;;;      9/2/9   Added "Show Callers" command.
    1516;;;      8/31/9  version 0.1b1
    1617;;;              First cut.
     
    143144(hi::bind-key "Symbol Documentation" #k"control-x control-d")
    144145
    145 
    146 #|
    147146(hi:defcommand "Show Callers" (p)
    148147  "Display a scrolling list of the callers of the symbol at point.
    149148   Double-click a row to go to the caller's definition."
    150149  (declare (ignore p))
    151   (let ((symbol (parse-symbol)))
     150  (let* ((symbol (parse-symbol))
     151         (callers (ccl::callers symbol)))
    152152    (cond (symbol
    153            (make-instance 'gui::sequence-window-controller
    154              :title (format nil "Callers of ~a" symbol)
    155              :sequence (mapcar #'(lambda (entry)
    156                                    (if (listp entry)
    157                                      (car (last entry))
    158                                      entry))
    159                                (ccl::callers symbol))
    160              :result-callback #'hemlock::edit-definition
    161              :display #'princ))
     153           (if callers
     154             (make-instance 'gui::sequence-window-controller
     155               :title (format nil "Callers of ~a" symbol)
     156               :sequence (mapcar #'(lambda (entry)
     157                                     (if (listp entry)
     158                                       (car (last entry))
     159                                       entry))
     160                                 (ccl::callers symbol))
     161               :result-callback #'hemlock::edit-definition
     162               :display #'princ)
     163             (gui::alert-window :title "Notification"
     164                                :message (format nil "Could not find any callers for ~S" symbol))))
    162165          (t
    163166           (hi::editor-error "Could not parse a valid symbol at point.")))))
    164167
    165168(hi::bind-key "Show Callers" #k"control-meta-c")
    166 |#
    167169
    168170
Note: See TracChangeset for help on using the changeset viewer.