From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kester Clegg Newsgroups: gmane.emacs.help Subject: Re: buffers Date: 27 Jan 2003 11:59:36 +0000 Organization: Rolls Royce UTC, Dept. of Computer Science, University of York, UK Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <_emY9.2066$6U3.12590@newsfep4-gui.server.ntli.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1043673955 2241 80.91.224.249 (27 Jan 2003 13:25:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 27 Jan 2003 13:25:55 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18d9Gr-0000Zz-00 for ; Mon, 27 Jan 2003 14:25:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18d8uH-00077N-02 for gnu-help-gnu-emacs@m.gmane.org; Mon, 27 Jan 2003 08:02:33 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!server1.netnews.ja.net!news.york.ac.uk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 64 Original-NNTP-Posting-Host: pc310.cs.york.ac.uk Original-X-Trace: pump1.york.ac.uk 1043668775 11961 144.32.40.101 (27 Jan 2003 11:59:35 GMT) Original-X-Complaints-To: abuse@york.ac.uk Original-NNTP-Posting-Date: 27 Jan 2003 11:59:35 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Original-Xref: shelby.stanford.edu gnu.emacs.help:109447 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5968 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5968 "chris.danx" writes: > Is there any way to prevent certain buffers from being selected when > you cycle through buffers? Are their "hidden buffers" in emacs? I have the following in mine, stolen from somewhere I can't remember: ;;-- trick for switching buffers nice and fast (use Ctrl-right or left arrow) ;;-- see also key binding for control tab above ---------------------------- (defun crs-delete-these (delete-these from-this-list) "Delete DELETE-THESE FROM-THIS-LIST." (cond ((car delete-these) (if (member (car delete-these) from-this-list) (crs-delete-these (cdr delete-these) (delete (car delete-these) from-this-list)) (crs-delete-these (cdr delete-these) from-this-list))) (t from-this-list))) ; this is the list of buffers we never want to see (defvar crs-hated-buffers '("KILL" "*Compile-Log*" "*scratch*")) (setq iswitchb-buffer-ignore (append '("^ " "*Buffer") crs-hated-buffers)) (defun crs-hated-buffers () "List of buffers I never want to see, converted from names to buffers." (delete nil (append (mapcar 'get-buffer crs-hated-buffers) (mapcar (lambda (this-buffer) (if (string-match "^ " (buffer-name this-buffer)) this-buffer)) (buffer-list))))) (defun crs-bury-buffer (&optional n) (interactive) (unless n (setq n 1)) (let ((my-buffer-list (crs-delete-these (crs-hated-buffers) (buffer-list (selected-frame))))) (switch-to-buffer (if (< n 0) (nth (+ (length my-buffer-list) n) my-buffer-list) (bury-buffer) (nth n my-buffer-list))))) (global-set-key [(control right)] 'crs-bury-buffer) (global-set-key [(control left)] (lambda () (interactive) (crs-bury-buffer -1))) ;;---------------------------------------------------------- It's not perfect, but it's OK for what I need. -- ************************************************************************ Kester Clegg Dept. of Computer Science, Research Assistant (UTC) University of York, Tel (01904) 43 27 49 email: kester at cs.york.ac.uk ************************************************************************