Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!alberta!ncc!isagate!steve From: steve@edm.isac.CA (Steve Hole) Newsgroups: comp.emacs Subject: Re: Why does completion require an alist? Keywords: completions alist Message-ID: <1990Sep3.210627.19773@edm.isac.CA> Date: 3 Sep 90 21:06:27 GMT References: <9008311659.AA14901@STEVE-DALLAS.MIT.EDU> Reply-To: steve@edm.isac.ca (Steve Hole) Organization: ISA Corporation Lines: 25 This is something that I asked some time ago and got no response on. I thought then that I might have been set up that way in anticipation of using it to something more interesting. I modified the original function (just prototyped as a lisp function for now), that uses the second element in each dotted pair as a documentation string. I had to modify the display algorithm for the possible completions to display the second element in a nice way in the possible completions list, but voila, instant non-obtrusive selection menu. I often do this kind of thing: (let ((my-list '(("joe" "This is option joe") ("fred" "This is option fred") ("henry" "This is option henry") ("sam" "This is option sam")))) (setq response (completing-read "Which guy?" my-list nil t))) This lets me select from a set of options with encoded or non-obvious values by attaching supplementary information to them. Makes for interfaces for my programming tools and all I have to do is define new sets of lists for the things I would like them to select. -- Steve Hole mail: steve@edm.isac.ca ISA Corp. uucp: !{uunet, alberta}!ncc!isagate!steve Edmonton, Alberta, Canada phone: (403) 441-4121