At 04:52 AM 8/14/00 -0400, Daniel Hegyi wrote:
>Hi,
>
>I'm trying to create a function that compiles *and* runs my java
>program. I've created a hook that executes another function at the end
>of a compilation.
>
>
>;; To be used as a hook at the end of a java compilation
>(defun end-of-java-compile (bufname msg)
> "To be used as a hook at the end of a java compilation"
> (if (not (eq (string-match "finished" msg) nil)
> (progn
> (message "This works here.")
> (jde-run)
> )
> )
> )
>
>;; Set function to be called at end of java compilation
>(setq compilation-finish-function 'end-of-java-compile)
>
>
>
>The output at the end of the compilation is:
>
>This works here.
>error in process sentinel: Wrong type argument: stringp, nil [2 times]
>
>
>Does anybody have an idea what the problem might be?
>
;; To be used as a hook at the end of a java compilation
(defun end-of-java-compile (bufname msg)
"To be used as a hook at the end of a java compilation"
(if (not (eq (string-match "finished" msg) nil)
^^^
If this is nil, string-match generates the error you are seeing.
(progn
(message "This works here.")
(jde-run)
)
)
)
You might want to use the new variable jde-compile-finish-hook for this
purpose.
- Paul