help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to exit function from inside its `interactive' call?


From: Thorsten Jolitz
Subject: Re: How to exit function from inside its `interactive' call?
Date: Thu, 07 Aug 2014 10:33:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Nicolas Richard <address@hidden> writes:

> Thorsten Jolitz <address@hidden> writes:
>> That works, thanks!
>> Did not know about `top-level'. 
>
> There is an obvious shortcoming : if you're in the middle of a recursive
> edit, you'll be back to top level.

I see.

> Why not simply throw an error ?
>
> (defun foo ()
>   (interactive
>    (user-error "Interrupted"))
>   (message "JJJJJJJJJJJJJJ")) 

Mhhh ... because actually no error occured, the function is simply done
at that point, and I did not want to produce an error?

But when called interactively, its more like an (error-) message anyway,
so I might as well use this. Thanks.

-- 
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]