Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!bbn!jr@bbn.com From: jr@bbn.com (John Robinson) Newsgroups: comp.emacs Subject: Re: switch-to-buffer NORECORD Message-ID: <35945@bbn.COM> Date: 13 Feb 89 19:33:54 GMT References: <6314@phoenix.Princeton.EDU> Sender: news@bbn.COM Reply-To: jr@bbn.com (John Robinson) Organization: BBN Systems and Technologies Corporation, Cambridge MA Lines: 33 In-reply-to: eliot@phoenix.Princeton.EDU (Eliot Handelman) In article <6314@phoenix.Princeton.EDU>, eliot@phoenix (Eliot Handelman) writes: >If I'm bapping around between two files that I'm editing and a lisp >process, I want the default value sent to switch-to-buffer to be >the last file visited, not the *lisp* buffer. It turns out that >switch to buffer has a second optional value, called NORECORD, which >should do what I want. Now if only I could figure out how to use it. I don't know how to do this interactively, but you could define a new function: (defun bury-and-switch-to-buffer (to-buffer) "Select buffer BUFFER in the current window, burying window's previoius buffer." (interactive "BBury current buffer and switch to buffer: ") (bury-buffer (current-buffer)) (switch-to-buffer to-buffer nil)) And then do something like: (global-set-key "B" 'bury-and-switch-to-buffer) Now, when you want to leave the *lisp* window and not come back to it, use ^XB to pick its replacement. One could get more fancy and make the burying behavior conditional on whether a prefix argumenbt was provided, and then get it all on ^Xb (normal switch-to-buffer), but hey, it's Monday. (By the way, I found that the optional NORECORD argument to switch-to-buffer seemed not to work.) -- /jr jr@bbn.com or bbn!jr