From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rami A Newsgroups: gmane.emacs.help Subject: Re: switch to previous buffer Date: Sat, 30 Mar 2013 01:07:15 -0700 (PDT) Message-ID: <6b6e3269-8a0a-4777-abe8-f2ec4596b4a8@googlegroups.com> References: <382a2375-aed1-4deb-ad29-21952926c809@googlegroups.com> <0746b716-e454-402f-a46d-dafa483bdb03@googlegroups.com> <20130330065118.GA21113@hysteria.proulx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1364653599 17451 80.91.229.3 (30 Mar 2013 14:26:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 Mar 2013 14:26:39 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: gnu.emacs.help@googlegroups.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 30 15:27:06 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ULwkJ-0002bt-D1 for geh-help-gnu-emacs@m.gmane.org; Sat, 30 Mar 2013 15:27:03 +0100 Original-Received: from localhost ([::1]:53791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULwjv-0001tl-1m for geh-help-gnu-emacs@m.gmane.org; Sat, 30 Mar 2013 10:26:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULqop-0006nK-2W for help-gnu-emacs@gnu.org; Sat, 30 Mar 2013 04:07:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULqom-00083s-50 for help-gnu-emacs@gnu.org; Sat, 30 Mar 2013 04:07:19 -0400 Original-Received: from mail-gh0-f185.google.com ([209.85.160.185]:38080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULqom-00083o-0p for help-gnu-emacs@gnu.org; Sat, 30 Mar 2013 04:07:16 -0400 Original-Received: by mail-gh0-f185.google.com with SMTP id z17so378622ghb.22 for ; Sat, 30 Mar 2013 01:07:15 -0700 (PDT) X-Received: by 10.50.43.225 with SMTP id z1mr102307igl.15.1364630835564; Sat, 30 Mar 2013 01:07:15 -0700 (PDT) Original-Path: glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.181.253.136; posting-account=HZ4YzgoAAABkTSCruZ7Bs4hufjlOUmBF Original-NNTP-Posting-Host: 69.181.253.136 User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 69.181.253.136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.185 X-Mailman-Approved-At: Sat, 30 Mar 2013 10:26:21 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89815 Archived-At: Le Wang... Thank you so much buddy. That is exactly what I wanted and even more. I used this part of the page you recommended, I added *Buffer List" to the ignored list "crs-hated-buffers" and Boom...it worked. ; necessary support function for buffer burial (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 I never want to see (defvar crs-hated-buffers '("KILL" "*Compile-Log*")) ; might as well use this for both (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))))) ; I'm sick of switching buffers only to find KILL right in front of me (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 tab)] 'crs-bury-buffer) (global-set-key [(control meta tab)] (lambda () (interactive) (crs-bury-buffer -1)))