Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!gateway!RELAY.NSWC.NAVY.MIL!dsill From: dsill@RELAY.NSWC.NAVY.MIL Newsgroups: comp.emacs Subject: webster and functions on words Message-ID: <37520@bbn.COM> Date: 21 Mar 89 16:37:34 GMT Sender: news@bbn.COM Organization: BBN news/mail gateway Lines: 51 Yesterday I posted a version of webster that provided the current word as the default word to be spelled, defined, or ended. Also yesterday, Dirk Grunwald posted a version of webster that provided webster-word and webster-define to spell or define, respectively, the word to the left of point. There is an inconsistency in the way Emacs functions on words work. Some, like ispell-word or webster-word, operate on a word in the current buffer. Others, like apropos or webster, read their argument from the minibuffer, after prompting. Some of the latter, like unix-apropos and webster as I modified it, provide a default response of the current word. Personally, I think it's better to have one function that can operate on either the current word or one read from the minibuffer than to have two separate functions. The former has the advantage of showing the operator exactly what word will be operated on if the default is taken. The only thing that could be considered a drawback of this approach is that it requires the operator to confirm his choice by pressing return. What's the consensus: two separate functions, one operating on the current word and one reading from the minibuffer; or one function reading from the minibuffer providing the current word as a default? A related problem is that these functions determine the current word differently. Most, like ispell-word, use the regular expression \\w to find the complete word to the left of point. Others, like webster-word, use the partial word from point to the beginning of the word to the left of point. 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): Comments? Flames? Implementations? ================ Above opinions are mine. "The ultimate metric that I would like to propose for user friendliness is quite simple: if this system were a person, how long would it take before you punched it in the nose?" -- Tom Carey