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

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

Re: Using interactive functions in functions


From: Stefan Monnier <address@hidden>
Subject: Re: Using interactive functions in functions
Date: 06 Dec 2002 18:18:18 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Bill" == Bill Wohler <wohler@newt.com> writes:
>   Consider the following fragment which runs tags-query-replace on a
>   number of strings:
>     (let ((strings '("foo" "bar")))
>       (while strings
>       (tags-query-replace (car strings) "newstring")
>       (setq strings (cdr strings)))
>   However, this loop ends when tags-query-replace returns the first time
>   so "bar" is never replaced.
>   What magic do I need to wrap tags-query-replace in to continue with
>   the rest of the strings?

I'm not sure exactly how tags-query-replace terminates, but if
it ends up short-circuiting the loop above, then it's either through
`signal' or `throw'.  A quick investigation shows it's probably not
`throw', so try something like

         (condition-case err
             (tags-query-replace ...)
           (error
            (if (examine err if you feel like it)
                (do something)
              (do something else))))


-- Stefan


reply via email to

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