LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Re: Emacs and SQL

[ILUG] Re: Emacs and SQL

Hary Walsh hwalsh at shannon.tellabs.com
Tue Nov 23 13:39:39 GMT 1999


Here's some elist to solve that problem....  I stoped using them ages
ago.  It's much faster to use C-x b <buffer name>

(defun pause-message (msg)  ;; temporarily show a message in the minibuffer
  (message "%s" msg)
  (sleep-for 1)
  (message "%s" "  "))

(defun get-bury-buffer (direction)
  (if (< direction 0)
      (switch-to-buffer (car (reverse (buffer-list))))
    (bury-buffer))
  (if (string= (buffer-name) " *Minibuf-0*")  
      ;; skip over Minibuffer but bury other
      (if (< direction 0)
	  (switch-to-buffer (car (reverse (buffer-list))))
	(bury-buffer))))

(defun skip-over-buffer (name)
  (let* ((skip 
	  '("*Warnings*" "*pixmap-conversion*" "*Echo Area*" "*Message-Log*")) 
	 (skipIt nil))
    (while (and skip (not skipIt))
      (setq skipIt (string= name (car skip)))
      (setq skip (cdr skip)))
    skipIt))

(defun goto-next-buffer ()
  (interactive)
  (let ((from-minibuffer (minibuffer-window-active-p (minibuffer-window)))
	(cb (current-buffer)))
    (if (and from-minibuffer)
	(progn
	  (other-window 1)
	  (get-bury-buffer 0)
	  (select-window (minibuffer-window)))
      (get-bury-buffer 0))
    (if (skip-over-buffer (buffer-name))
	(if (and from-minibuffer)
	    (progn
	      (other-window 1)
	      (get-bury-buffer 0)
	      (select-window (minibuffer-window)))
	  (progn
	    (get-bury-buffer 0)
	    (if (eq cb (current-buffer))
		(pause-message "No more buffers to cycle FORWARD through.")))))
    ))

(defun goto-prev-buffer ()
  (interactive)
  (let ((from-minibuffer (minibuffer-window-active-p (minibuffer-window)))
	(cb (current-buffer)))
    (if (and from-minibuffer)
	(progn
	  (other-window 1)
	  (get-bury-buffer -1)
	  (select-window (minibuffer-window)))
      (get-bury-buffer -1))
    (if (skip-over-buffer (buffer-name))
	(if (and from-minibuffer)
	    (progn
	      (other-window 1)
	      (get-bury-buffer -1)
	      (select-window (minibuffer-window)))
	  (progn
	    (get-bury-buffer -1)
	    (if (eq cb (current-buffer))
		(pause-message "No more buffers to cycle BACK through.")))))
    ))

(define-key global-map "\M-[" 'goto-prev-buffer)
(define-key global-map "\M-]" 'goto-next-buffer)
;(define-key global-map '(alt right) 'goto-prev-buffer)
;(define-key global-map '(alt left) 'goto-next-buffer)

--
hjw




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell