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

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

Re: How to avoid y-or-n-p in a program?


From: Thorsten Jolitz
Subject: Re: How to avoid y-or-n-p in a program?
Date: Fri, 14 Mar 2014 15:26:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> when in a program function A calls another (external) function B that
>> asks the user a y-or-n-p question, and you want to avoid that and
>> instead code in function A that the answer is always Y, so that the
>> prompt never shows up - how do you do that?
>
> The recommended way:
> - change B so that it doesn't call y-or-n-p unconditionally.
> - change A to adjust to the new behavior of B.

Is it generally considered a (kind of) bug when a COMMAND (not a
function) calls y-or-n-p unconditionally (or enforces user input in
other ways)?

Enforcing user interaction (and lack of function arguments) makes
(re)using such commands in programs quite difficult, but maybe they are
not intended for that anyway?

Would the "recommended way" be applied in this case too? Should one
rather patch the called command B instead of looking for a workaround on
the calling side?

-- 
cheers,
Thorsten




reply via email to

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