"Ben Wing" <ben(a)666.com> writes:
> I cant find a way to handle menu generation(by :filter
> function) errors.
>
> For example i have a command:
>
> (defun my-cmd ()
> (interactive)
> (popup-menu (list "test0"
>:filter (lambda (a)
> (/ nil 0)))))
>
> I specially added an error condition in :filter.
>
> and here is how i tried to handle this error
>
> (condition-case nil
> (call-interactively 'my-cmd)
> (nil (message "menu failed")))
>
> But this did not worked as i expected it to work.
>
> The thing that i have pretty complicated :filter functions
> for menus and they easily can fail, and i need a way to
> handle such failures.
This is definitely not going to work because the filter functions trap
errors themselves at their borders to prevent major internal badness. You
have to put the condition-case *inside* the filter.
Thanks! I also came to this solution, and it is far suitable for me,
thanks again.
--
lg