I\'m trying to temporarily turn off the yes-or-no-p
within a function that is defined elsewhere and then restore things to the way they were. Using flet<
Here's how I'd recommend you do it:
(defvar stfu-inhibit-yonp nil)
(defadvice yes-or-no-p (around stfu activate)
(if stfu-inhibit-yonp (setq ad-return t) ad-do-it))
(defadvice y-or-n-p (around stfu activate)
(if stfu-inhibit-yonp (setq ad-return t) ad-do-it))
(defadvice elmo-dop-queue-flush (around stfu activate)
(let ((stfu-inhibit-yonp t))
ad-do-it))
Contrary to CL's flet
this will make it clear (e.g. in C-h f yes-or-no-p
) that something's going on with yes-or-no-p.