Speaking of adding shortcuts–one of the first things I found myself desperately wanting in OM was a fast way to om-inspect
an object. I was pleased by how easy it is: inserting one line into the definition of boxframe-default-list
, as follows, adds an ‘Inspect’ entry to the contextual menu for boxes:
(defun boxframe-default-list (object)
(list (list
(om-new-leafmenu "Copy" #'(lambda () (copy (om-view-window object))))
(om-new-leafmenu "Cut" #'(lambda () (cut (om-view-window object))))
(om-new-leafmenu "Duplicate" #'(lambda () (duplicate-window (om-view-window object))))
)
(list
(om-new-leafmenu "Get Info" #'(lambda () (get-info-window (om-view-window object))))
(om-new-leafmenu "Show Documentation" #'(lambda () (show-big-doc object))
; ***********************************************************************
(om-new-leafmenu "Inspect" #'(lambda () (om-inspect object))));*
; ***********************************************************************
(list
(if (lock-button object)
(om-new-leafmenu "Unlock Eval" #'(lambda () (apply-win (om-view-window object) 'add-rem-lock-button)))
(om-new-leafmenu "Lock Eval" #'(lambda () (apply-win (om-view-window object) 'add-rem-lock-button))))
(om-new-leafmenu "Eval Box" #'(lambda ()
(om-eval-enqueue
`(progn
(eval-box ,object)
(clear-ev-once ,(om-view-container object)))))))))
Although much better than what I was doing before–using *current-workspace*
–this is still a hack. Is there a better way to make custom shortcuts?
-Jonathan