unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Scott Frazer <frazer.scott@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Grouping related buffers
Date: Mon, 10 Nov 2008 14:00:58 -0500	[thread overview]
Message-ID: <1226343659.219266@sj-nntpcache-2.cisco.com> (raw)
In-Reply-To: <mailman.57.1226330484.2211.help-gnu-emacs@gnu.org>

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)))



       reply	other threads:[~2008-11-10 19:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.57.1226330484.2211.help-gnu-emacs@gnu.org>
2008-11-10 19:00 ` Scott Frazer [this message]
2008-11-10 19:44   ` Grouping related buffers Drew Adams
2008-11-13 15:03 ` rustom
2008-11-10 22:18 grischka
  -- strict thread matches above, loose matches on Subject: below --
2008-11-10 15:21 Corey Foote
2008-11-10 16:43 ` Tassilo Horn
2008-11-10 17:24   ` Corey Foote
2008-11-10 18:26 ` Drew Adams
     [not found] ` <mailman.0.1226335408.26697.help-gnu-emacs@gnu.org>
2008-11-13 13:09   ` Stefan Kamphausen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226343659.219266@sj-nntpcache-2.cisco.com \
    --to=frazer.scott@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).