home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / emacs / help / 3980 < prev    next >
Encoding:
Text File  |  1992-09-03  |  1.1 KB  |  34 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsc!cbfsb!att-out!pacbell.com!decwrl!parc!news!delacour
  3. From: delacour@waxwing.parc.xerox.com (Vincent Delacour)
  4. Subject: switch to existing buffer
  5. Message-ID: <DELACOUR.92Aug28102156@waxwing.parc.xerox.com>
  6. Sender: news@parc.xerox.com
  7. Organization: Xerox PARC, Palo Alto, CA
  8. Date: 28 Aug 92 10:21:56
  9. Lines: 23
  10.  
  11.  
  12.  
  13. For various reasons I need a function equivalent to 'switch-to-buffer',
  14. but that accepts only _existing_ buffers.
  15.  
  16. It seems the obvious solution doesn't work as expected: 
  17.  
  18.        (defun my-switch-to-buffer (bu)
  19.       ;;  require an existing buffer
  20.       (interactive "bSwitch to buffer: ") 
  21.       (switch-to-buffer bu ()))
  22.  
  23. (this one apparently puts the buffer we switch to in front of the list
  24. of recently selected ones, so the buffer we are in is proposed as the
  25. default when later switching buffers)
  26.  
  27. Does somebody know a satisfactory way to switch to an existing buffer
  28. only while preserving all other cheracteristics of switch-to-buffer ??
  29.  
  30. Thanks, 
  31.  
  32.     Vincent
  33.  
  34.