Here’s an idea that just came to me at work. Lots of Emacs users defalias or fset yes-or-no-p as an alias for y-or-n-p to reduce the annoyance factor (see YesOrNoP), and I’m no exception.
There are a few kinds of uses of these functions:
1. When you always say the same thing, over and over and over, and the question is just to nag you because someone thinks that you don’t know what you’re doing (see MeatBall:HumaneInterface).
2. When you usually say the same thing, but sometimes don’t and, if the wrong answer were to be given automatically, catastrophe would ensue
What I’m proposing is to eliminate the nagging of (1) while preserving the behavior of (2), with a two-step replacement of y-or-n-p:
1. The Logging y-or-n-p
The idea here is you wrap around y-or-n-p a function that records what the question string was and how you replied, to some persistent storage.
Once you’ve been running with this for a while (months? a year?), you look at the log file. Some fairly simple processing should produce a list of likely (1) candidates.
2. The cached y-or-n-p
This one consults a cache of known (1) questions and answers, and whenever the arg string is in there, it auto returns the cached response instead of prompting you. If it’s not, it calls the normal y-or-n-p.
This is really quite easy to code up and I might get to it at some point but probably not soon.
This code will have to take changing prompts into account. For example, how do you deal with the question “Do you want to delete foo?” given that “Do you want to delete bar?” was answered with yes?