On Fri, 5 Jan 2001, [EMAIL PROTECTED] wrote:

> I have just started using emacs so apologies if I'm asking an
> obvious question.

No, this is something all of us struggle with at different
points, either because we are new, or we have a whole bunch of
buffers open, and we got ourselves confused somehow :-)

> Sometimes when I open Java files in emacs, the files are listed
> under the buffer menu item.  At other times I can only access
> the different files which are open by using the list all
> buffers command c-x c-b and then selecting the appropriate
> file.  I'm finding this awkward as it's tricky to get the
> buffers I want in the window I want.
> 
> Any suggestions welcome :>

I use switch-to-buffer, (I believe it is bound to \C-x b out of
the box, and I'm sure that is what it is bound to one my system).
What this allows you to do is interactively start typing the name
of the buffer and then use completion to get to it.  Of course,
you need to remember the name of the buffer, or at least what it
starts with.  But, then as you switch back and forth, the last
buffer you are in will be the default for you and you can hit
enter.

I also have this in my .emacs which helps in finding the buffer names.

    ; Show completions in the minibuffer as you type

    (icomplete-mode)

    

    ;; Always have minibuffer the appropriate size. Useful for long file

    ;; names, etc. Courtesy of "Dr Francis J. Wright" <[EMAIL PROTECTED]>

    (resize-minibuffer-mode)

    

    (setq resize-minibuffer-window-max-height 3)



There is a ibuffer.el which allows you to group your buffers by
mode, ie, jde-mode, and other pretty cool buffer movement stuff.

I also bound \C-x \C-b to buffer-menu, so that I don't have to
jump to the other window if I want a buffer listing.

I don't use the following much, but I believe others find it or
something like it useful

     ;; Make C-TAB and C-S-TAB cycle through buffers in the current window

     (defun ken-next-buffer ()

       (interactive)

       (let ((choices (cdr (buffer-list))))

         ;; Skip hidden buffers like " *Minibuf-0*"

         (while (equal t (compare-strings (buffer-name (car choices)) 0 2 " *" 0 2))

           (setq choices (cdr choices)))

         (bury-buffer (car (buffer-list)))

         (switch-to-buffer (car choices))))

    

     (defun ken-prev-buffer ()

       (interactive)

       (switch-to-buffer (car (nreverse (buffer-list))))

       (while (equal t (compare-strings (buffer-name) 0 2 " *" 0 2))

         (switch-to-buffer (car (nreverse (buffer-list))))))


HTH
-- 
Galen Boyer
New Orleans is sink'n man and I don't want to swim.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to