rumcii / emacs-nav

Automatically exported from code.google.com/p/emacs-nav
GNU General Public License v3.0
0 stars 0 forks source link

Follow mode doesn't work with swbuff.el #55

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Anyone using swbuff.el to switch buffers will notice it's timer function
puts nav into the wrong window and leaves emacs in a strange state. Since
nav have its own buffer browser I recommend disabling swbuff.el and using
buffer-next instead of swbuff-switch-to-next-buffer.

Original issue reported on code.google.com by matthew....@gmail.com on 20 Aug 2009 at 2:16

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This is has been modified by me but I recommend using this to switch buffers 
instead
of swbuff.el

;;     for switching buffers
;;     Original yic-buffer.el
;;     From: choo@cs.yale.edu (young-il choo)

(defun yic-ignore (str)
  (or
   ;;buffers I don't want to switch to 
   (string-match "^\\*" str)
   (string-match "^ " str)
   ;;Test to see if the window is visible on an existing visible frame.
   ;;Because I can always ALT-TAB to that visible frame, I never want to 
   ;;Ctrl-TAB to that buffer in the current frame.  That would cause 
   ;;a duplicate top-level buffer inside two frames.
   (memq str               
         (mapcar 
          (lambda (x) 
            (buffer-name 
             (window-buffer 
              (frame-selected-window x))))
          (visible-frame-list)))
   ))

(defun yic-next (ls)
  "Switch to next buffer in ls skipping unwanted ones."
  (let* ((ptr ls)
         bf bn go
         )
    (while (and ptr (null go))
      (setq bf (car ptr)  bn (buffer-name bf))
      (if (null (yic-ignore bn))        ;skip over
          (setq go bf)
        (setq ptr (cdr ptr))
        )
      )
    (if go
        (switch-to-buffer go))))

(defun yic-prev-buffer ()
  "Switch to previous buffer in current window."
  (interactive)
  (yic-next (reverse (buffer-list))))

(defun yic-next-buffer ()
  "Switch to the other buffer (2nd in list-buffer) in current window."
  (interactive)
  (bury-buffer (current-buffer))
  (yic-next (buffer-list)))

Original comment by matthew....@gmail.com on 20 Aug 2009 at 2:45

GoogleCodeExporter commented 8 years ago
Follow mode and buffer mode are gone now. I'm trying to keep nav as minimal as 
I can, because the extra features brought too many bugs. There can of course be 
a forked version of nav with lots of features and window manipulation, but it's 
too much for me to deal with right now.

Thanks again for contributing cool ideas and code to this project.

Original comment by issac.tr...@gmail.com on 26 Dec 2010 at 9:04