Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sbcs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!bellcore!decvax!mcnc!philabs!sbcs!podar From: podar@sbcs.UUCP (Sunil Podar) Newsgroups: net.emacs Subject: a simple problem for 4.2 gosling-emacs Message-ID: <271@sbcs.UUCP> Date: Fri, 3-May-85 22:56:40 EDT Article-I.D.: sbcs.271 Posted: Fri May 3 22:56:40 1985 Date-Received: Mon, 6-May-85 01:32:39 EDT Distribution: net Organization: Computer Science Dept, SUNY@Stony Brook Lines: 36 I wanted to write a very simple mlisp function, but couldn't get it to do what I wanted; This is for Gosling emacs on 4.2BSD. Here is what I eventually settled with: ;------------------------------------- (defun (forget-it buff-name (setq buff-name (get-tty-string (concat ": delete-buffer [" (current-buffer-name) "] "))) (if (= buff-name "") (delete-buffer (current-buffer-name)) (delete-buffer buff-name)))) ;;;------------------------------------- The problem is that I wanted to use "get-tty-buffer" in place of "get-tty-string" so that name-completion would be provided, which is a very useful (& sometimes essential) feature for many buffer names are often very cryptic (e.g. **Scratch Stuff**) and "get-tty-string" needs to have the entire name specified exactly. Moreover I wanted to provide a default for which you merely had to press , but get-tty-buffer does not have provision for such, pressing return gives you a whole list of buffers. One ugly way around is to have two separate functions(bound to two keys , one for deleting current buffer & other for other buffers. Another ugly way around is to first use a "get-tty-character" and then if answer <> "" then ask-again, this time with no default & get-tty-buffer. In short, is there a way to give default to get-tty-buffer without having to modify the c-code that handles buffers. I am sure the other similar commands like "get-tty-file", etc. have the same problem, excepting of course "get-tty-char.../string". Any ideas? Thanks in advance. I think it is a fairly simple problem, perhaps net.emacs should be spared the answers,if any,well I leave it upto people.net.emacs. -- Sunil Podar CSNET: podar@sbcs.csnet SUNY at Stony Brook ARPA: podar%suny-sb.csnet@csnet-relay.arpa UUCP: {allegra, hocsd, philabs, ogcvax} !sbcs!podar