From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Scott Frazer Newsgroups: gmane.emacs.help Subject: Re: Grouping related buffers Date: Mon, 10 Nov 2008 14:00:58 -0500 Organization: Ye 'Ol Disorganized NNTPCache groupie Message-ID: <1226343659.219266@sj-nntpcache-2.cisco.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226346117 10419 80.91.229.12 (10 Nov 2008 19:41:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Nov 2008 19:41:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 10 20:42:58 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kzcek-0002T0-Ag for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Nov 2008 20:42:38 +0100 Original-Received: from localhost ([127.0.0.1]:34848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kzcdc-0005Od-KA for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Nov 2008 14:41:28 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe01.iad.POSTED!7564ea0f!not-for-mail User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) Original-Newsgroups: gnu.emacs.help In-Reply-To: Cache-Post-Path: sj-nntpcache-2.cisco.com!unknown@scfrazer-wxp.cisco.com X-Cache: nntpcache 3.0.2 (see http://www.nntpcache.com/) Original-Lines: 59 Original-X-Complaints-To: newsadmin@cisco.com Original-NNTP-Posting-Date: Mon, 10 Nov 2008 19:00:59 UTC Original-Xref: news.stanford.edu gnu.emacs.help:164285 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59622 Archived-At: Corey Foote wrote: > Hi everybody, > > As you probably already know, modern window managers support virtual > desktops, which extend the workspace to multiple desktop areas. This > allows users to spread the windows they have open across multiple > workspaces, as an alternative to crowding them all on to one screen. I > find this helpful because I work on multiple projects at a time, and > having multiple desktops allows me to group the windows for each project > together in separate desktops. > > I was wondering if there was a way to group related buffers in Emacs > through the use of, say, multiple buffer workspaces. For example, it > would be nice if when I display a list of existing buffers by typing C-x > C-b it would be possible to group the buffers in the list, and when I > called C-x b only the buffers in the current grouping would be > available. (To get at the others it would be necessary to change the > current buffer workspace.) I'd suggest using the buffer-show package. Here's some skeleton code that works but is pretty lame (no completion, showing of current or all tags, etc. is left as an exercise for the student :) ): (require 'bs) (defvar bs-group-buffer-tags nil "*List of group tags for a buffer") (make-variable-buffer-local 'bs-group-buffer-tags) (defvar bs-group-active-tag nil "*Active tag for showing buffer list") (defun bs-group-add-buffer-tag (tag) (interactive "sAdd buffer tag: ") (setq bs-group-buffer-tags (add-to-list 'bs-group-buffer-tags tag))) (defun bs-group-delete-buffer-tag (tag) (interactive "sRemove buffer tag: ") (setq bs-group-buffer-tags (delete tag bs-group-buffer-tags))) (defun bs-group-set-active-tag (tag) (interactive "sSet active tag: ") (setq bs-group-active-tag tag)) (defun bs-group-must-show-function (buf) (save-excursion (set-buffer buf) (member bs-group-active-tag bs-group-buffer-tags))) (defun bs-group-dont-show-function (buf) (not (bs-group-must-show-function buf))) (setq bs-configurations (add-to-list 'bs-configurations '("tagged" nil bs-group-must-show-function nil bs-group-dont-show-function nil)))