unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Buffer Navigation
@ 2005-10-19  2:18 Shug Boabby
  2005-10-19  2:28 ` Drew Adams
       [not found] ` <mailman.11819.1129688923.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Shug Boabby @ 2005-10-19  2:18 UTC (permalink / raw)


Hi everyone,

The CVS GNU Emacs has introduced a neat way to navigate buffers with
(C-x left/right), reproducible with the code at the end of this message
for older Emacs versions.

However, this navigation goes through *all* buffers, not just the ones
I am editing/reading. Does anyone know of a way I could set up a
similar navigation system that only navigates through *scratch* and
files I have opened myself, i.e. not some temporary buffer a function
or mode has created or opened.

One possible solution I have thought of (*very* roundabout, I'm not
proud of it) would be to create a wrapper function for opening/closing
files which adds/removes the name of the file to/from a list (which is
ordered in some way, such as alphabetically or chronological). then i
bind C-x C-f and C-x k to these wrappers. then navigate only the
buffers in that list.

Please let me know if anyone has a better solution!

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (< emacs-major-version 22)
    (progn
      (defalias 'switch-to-next-buffer 'bury-buffer)
      (defun switch-to-previous-buffer ()
        "Switches to previous buffer"
        (interactive)
        (switch-to-buffer (nth (- (length (buffer-list)) 1)
(buffer-list))))))

(if (< emacs-major-version 22)          ; Use C-x <left> and C-x
<right>
    (progn                              ; for buffer navigation
      (global-set-key [(control x) (left)] 'switch-to-previous-buffer)
      (global-set-key [(control x) (right)] 'switch-to-next-buffer)))

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-10-23 19:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-19  2:18 Buffer Navigation Shug Boabby
2005-10-19  2:28 ` Drew Adams
     [not found] ` <mailman.11819.1129688923.20277.help-gnu-emacs@gnu.org>
2005-10-19  2:38   ` Shug Boabby
2005-10-19  3:35     ` Drew Adams
2005-10-19  3:01   ` Shug Boabby
2005-10-19  3:35     ` Drew Adams
2005-10-19 22:54     ` Thien-Thi Nguyen
2005-10-20 22:43       ` Shug Boabby
2005-10-21 17:01         ` Kevin Rodgers
     [not found]         ` <mailman.12151.1129914597.20277.help-gnu-emacs@gnu.org>
2005-10-23 19:54           ` Shug Boabby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).