Changeset 11131


Ignore:
Timestamp:
Oct 17, 2008, 1:12:47 PM (11 years ago)
Author:
gz
Message:

From working-0711 branch, tty-inspector changes:

  • New command :Q exits call to inspect regardless of current nesting level
  • :pop reshows the object being returned to
  • description of :SHOW now refers to ccl:@, just so it's mentioned somewhere.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/describe.lisp

    r10116 r11131  
    17631763
    17641764(defvar *inspector-ui* ())
     1765(defvar *previous-inspector-ui* nil)
    17651766
    17661767(defclass inspector-ui ()
     
    18121813(ccl::define-toplevel-command
    18131814    :tty-inspect pop ()
    1814     "exit current inspector"
     1815    "exit current inspector level"
    18151816    (invoke-restart 'exit-inspector))
     1817
     1818(ccl::define-toplevel-command
     1819    :tty-inspect q ()
     1820    "exit inspector"
     1821  (invoke-restart 'end-inspect))
    18161822
    18171823(ccl::define-toplevel-command
    18181824    :tty-inspect show ()
    1819     "re-show currently inspected object"
     1825    "re-show currently inspected object (the value of CCL:@)"
    18201826    (ui-present *inspector-ui*))
    18211827
     
    18641870  (let* ((level (inspector-ui-level ui)))
    18651871    (restart-case
    1866      (ccl:with-terminal-input
    1867          (ccl::with-toplevel-commands :tty-inspect
    1868            (ccl::read-loop
    1869             :prompt-function #'(lambda (stream)
    1870                                  (if (eql level 0)
    1871                                    (format stream "~&Inspect> ")
    1872                                    (format stream "~&Inspect ~d> " level))))))
    1873      (exit-inspector () (terpri *debug-io*)))))
     1872        (ccl:with-terminal-input
     1873          (ccl::with-toplevel-commands :tty-inspect
     1874            (ccl::read-loop
     1875             :prompt-function #'(lambda (stream)
     1876                                  (if (eql level 0)
     1877                                    (format stream "~&Inspect> ")
     1878                                    (format stream "~&Inspect ~d> " level))))))
     1879      (exit-inspector ()
     1880        (if *previous-inspector-ui*
     1881          (ui-present *previous-inspector-ui*)
     1882          (terpri *debug-io*))))))
    18741883
    18751884(defmethod inspector-ui-inspect-nth ((ui inspector-tty-ui) n)
     
    18891898
    18901899(defmethod inspector-ui-inspect ((ui inspector-ui))
    1891   (let* ((*inspector-ui* ui))
     1900  (let* ((*previous-inspector-ui* *inspector-ui*)
     1901         (*inspector-ui* ui))
    18921902    (ui-initialize ui)
    18931903    (ui-present ui)
     
    19051915(defun inspect (thing)
    19061916  (let* ((ccl::@ thing))
    1907     (funcall *default-inspector-ui-creation-function* thing)))
    1908 
     1917    (restart-case (funcall *default-inspector-ui-creation-function* thing)
     1918      (end-inspect () thing))))
Note: See TracChangeset for help on using the changeset viewer.