Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!psuvax1!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!zephyr.ens.tek.com!tektronix!psueea!qiclab!mntgfx!sequent!paulr From: paulr@sequent.UUCP (Paul Reger) Newsgroups: gnu.emacs Subject: emacs file1 file2 ---> initiates emacs with multiple buffers. Keywords: Multiple buffers, Message-ID: <22598@sequent.UUCP> Date: 3 Oct 89 16:54:54 GMT Reply-To: paulr@sequent.UUCP (Paul Reger) Distribution: gnu Organization: Sequent Computer Systems, Inc Lines: 31 Awhile back I posted to this group asking if I initiated emacs with multiple file arguments: emacs file1 file2 ... filen How would I go about making emacs come up with 2 buffers or maybe just the *Buffer List* menu. I got a few responses and this one seems to work the best for me. I am not sure who to give the credit to, but thank you (whoever you are)!!!! Thought I would post this since it works, is very convenient, and small (I have great respect for small amounts of code that do very nice things....). Enjoy: (defun auto-buffer-menu () ;; This code is slightly unclean; it relies on Emacs starting up with ;; exactly two buffers present: "*scratch*" and " *Minibuf-0*". (let ((list (buffer-list))) (cond ((> (length list) 4) (buffer-menu t) (delete-other-windows)) ((= (length list) 4) (pop-to-buffer nil))))) (if (cdr command-line-args) (setq command-line-args (nconc command-line-args '("-f" "auto-buffer-menu")))) -- paulr (Paul Reger) Sequent Computer Systems, Beaverton Oregon {uunet,ucbvax!rutgers!ogccse}!sequent!paulr