Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ulowell!bbn!news From: news@bbn.COM (News system owner ID) Newsgroups: comp.emacs Subject: Re: webster and functions on words Message-ID: <37521@bbn.COM> Date: 21 Mar 89 17:25:28 GMT References: <37520@bbn.COM> Reply-To: sboisen@bbn.com Organization: Bolt Beranek and Newman, Inc., Cambridge, MA Lines: 42 In-reply-to: dsill@RELAY.NSWC.NAVY.MIL's message of 21 Mar 89 16:37:34 GMT > From: dsill@RELAY.NSWC.NAVY.MIL > Newsgroups: comp.emacs > Date: 21 Mar 89 16:37:34 GMT > > Perhaps the function ``interactive'' could be modified to include a > code, say "w", meaning "the complete word to the left of point". But > that would only solve half the problem. There would still need to be > some way to handle defaults. How about a general default mechanism > added to ``interactive''? Something like: > (interactive "wISpell word (%s): ") > (interactive "aDescribe function (default %s): ") > which would result in: > ISpell word (prefrobnicate): > Describe function (default interactive): > Well, something like this is already there: look for example at the way find-tag and find-tag-tag are implemented, and you'll see a more complex interaction between finding some string from the buffer and constructing a call to interactive with it (i changed my definition of find-tag-tag because i didn't like the way it lost if point is just inside a left paren). The crucial documentation from C-h d interactive is this prose: The argument of interactive is usually a string containing a code letter followed by a prompt... If the argument is not a string, it is evaluated to get a list of arguments to pass to the function. And so you can call arbitrary bits of code to supply defaults by looking at the buffer in smart ways. I also wish there were a more standard way to do this, but maybe that's hoping for too much (sometimes you want completion, sometimes you want to obey syntactic conventions of the language in the buffer, etc.). ........................................ Sean Boisen -- sboisen@bbn.com BBN Systems and Technologies Corporation, Cambridge MA Disclaimer: these opinions void where prohibited by lawyers. Sean