Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bbn!jr@bbn.com From: jr@bbn.com (John Robinson) Newsgroups: comp.emacs Subject: Re: ARGH! Ahem. Umm, answering prompts & abbreviating Summary: close, but the cigar requires recompiling Message-ID: <35648@bbn.COM> Date: 6 Feb 89 15:26:20 GMT References: <17901@vax5.CIT.CORNELL.EDU> Sender: news@bbn.COM Reply-To: jr@bbn.com (John Robinson) Distribution: comp Organization: BBN Systems and Technologies Corporation, Cambridge MA Lines: 49 In-reply-to: tale@its.rpi.edu (David C Lawrence) In article , tale@its (David C Lawrence) writes: >In article <17901@vax5.CIT.CORNELL.EDU> rad@vax5.CIT.CORNELL.EDU writes: > >> Well. Does anyone have something that will let me type 'y' or 'n' in >> response to any prompt that asks for 'yes' or 'no'? ... > >> I'd give my left arm for a hook/hack/etc. that would do this for me. (Well, >> maybe not the whole arm, but you get the point. ;^) > >(defun yes-or-no-p (prompt) > "This is -not- the original yes-or-no-p, it is a workaround that >calls y-or-n-p in place of it." > (y-or-n-p prompt)) If you really want to make them the same, right down to the documentation, try: (fset 'yes-or-no-p (symbol-function 'y-or-n-p)) Both of these attempts, however, will fail to change the behavior of uses of this function by C code. This includes: buffer.c:574: tem = Fyes_or_no_p (format1 ("Buffer %s modified; kill anyway? ", emacs.c:452: && (answer = Fyes_or_no_p (format1 ( "%d modified buffer%s exist%s, do you really want to exit? ", emacs.c:461: && (answer = Fyes_or_no_p (format1 ( "Subprocesses are executing; kill them and exit? ")), fileio.c:956: tem = Fyes_or_no_p (format1 ("File %s already exists; %s anyway? ", The latter use is in the function with the flowery name barf_or_query_if_file_exists(), which is called with four completions for the %s in its format string: fileio.c:986: barf_or_query_if_file_exists (newname, "copy to it", fileio.c:1066: barf_or_query_if_file_exists (newname, "rename to it", fileio.c:1114: barf_or_query_if_file_exists (newname, "make it a new name", fileio.c:1152: barf_or_query_if_file_exists (newname, "make it a link", No doubt some of these are the annoying ones. To change them requires modifying the source and recompiling. At that point, maybe a defvar for a user customization would be in order, like say yes_or_no_p_relax. >I'm kind of full up on left arms; would you happen to have a leg to >spare instead? I've got a left hook I'd trade for an arm... -- /jr jr@bbn.com or bbn!jr