[Ecls-list] Question about top level prompt.

Jason Aquilina jfa7600 at yahoo.com.au
Wed May 21 04:48:47 UTC 2008


I would like to hook into the top level prompt and have a user define 
function called that outputs the prompt. There appears to be a hook in 
the top level prompt *tpl-prompt-hook* which is referenced in ECL's top 
level prompt function - line 407 in src/lsp/top.lsp

    (defun tpl-prompt ()
      (fresh-line)
      (when *tpl-prompt-hook*
        (funcall *tpl-prompt-hook*))
      (format t "~A~V,,,'>A "
          (if (eq *package* (find-package 'user)) "" (package-name 
*package*))
          (- *tpl-level* *step-level* -1)
          ""))

This almost does what I want except after the hook is called it goes on 
to output its own prompt. The only other place that makes use of the 
hook is in the function invoke-debugger defined in 
src/clos/conditions.lsp at line 756 - but this is in a #|..|# comment 
block that goes from
line 742 until the end of file.

Would it be possible to have tpl-prompt changed to

    (defun tpl-prompt ()
      (fresh-line)
      (if *tpl-prompt-hook*
          (funcall *tpl-prompt-hook*)
          (format t "~A~V,,,'>A "
              (if (eq *package* (find-package 'user)) "" (package-name 
*package*))
              (- *tpl-level* *step-level* -1)
              "")))

or is there a better way to get the functionality I require.

Regards,
Jason Aquilina.





More information about the ecl-devel mailing list