unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Grouping related buffers
@ 2008-11-10 15:21 Corey Foote
  2008-11-10 16:43 ` Tassilo Horn
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Corey Foote @ 2008-11-10 15:21 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]


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

Thanks!
_________________________________________________________________
Windows Live Hotmail now works up to 70% faster.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_faster_112008

[-- Attachment #2: Type: text/html, Size: 1309 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Grouping related buffers
  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>
  2 siblings, 1 reply; 9+ messages in thread
From: Tassilo Horn @ 2008-11-10 16:43 UTC (permalink / raw)
  To: help-gnu-emacs

Corey Foote <coreyfoote@hotmail.com> writes:

Hi Corey!

> I was wondering if there was a way to group related buffers in Emacs
> through the use of, say, multiple buffer workspaces.

There's desktop-save-mode which can be used therefore.  See

  (info "(emacs)Saving Emacs Sessions")

for details.  It's not exactly like the grouping you'd like to have,
because there's only one open workspace at a time and switching
workspaces involves closing all files/buffers of the current one and
loading the new ones.  So quickly jumping between buffers of different
workspaces is not possible.

So many people open one emacs instance per workspace, which has other
drawbacks of course.

Hope that helps,
Tassilo





^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Grouping related buffers
  2008-11-10 16:43 ` Tassilo Horn
@ 2008-11-10 17:24   ` Corey Foote
  0 siblings, 0 replies; 9+ messages in thread
From: Corey Foote @ 2008-11-10 17:24 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]


I actually don't think it would be too difficult to write something like this. It would involved modifying a few functions, and giving each buffer a variable which would identify it with one of the groups. I'm in the process of learning emacs lisp right now, but an no where near experienced enough to make a customization like this!

By the way, does anybody have any recommendations on the best way to learn emacs lisp? I've got two books... the emacs lisp manual and an old O'Reilly book called Writing GNU Emacs Extensions by Bob Glickstein. It would be cool if there were a course I could take in programming this stuff... :-)

> To: help-gnu-emacs@gnu.org
> From: tassilo@member.fsf.org
> Date: Mon, 10 Nov 2008 17:43:07 +0100
> Subject: Re: Grouping related buffers
> 
> Corey Foote <coreyfoote@hotmail.com> writes:
> 
> Hi Corey!
> 
> > I was wondering if there was a way to group related buffers in Emacs
> > through the use of, say, multiple buffer workspaces.
> 
> There's desktop-save-mode which can be used therefore.  See
> 
>   (info "(emacs)Saving Emacs Sessions")
> 
> for details.  It's not exactly like the grouping you'd like to have,
> because there's only one open workspace at a time and switching
> workspaces involves closing all files/buffers of the current one and
> loading the new ones.  So quickly jumping between buffers of different
> workspaces is not possible.
> 
> So many people open one emacs instance per workspace, which has other
> drawbacks of course.
> 
> Hope that helps,
> Tassilo
> 
> 
> 

_________________________________________________________________
Get 5 GB of storage with Windows Live Hotmail.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_5gb_112008

[-- Attachment #2: Type: text/html, Size: 2112 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Grouping related buffers
  2008-11-10 15:21 Corey Foote
  2008-11-10 16:43 ` Tassilo Horn
@ 2008-11-10 18:26 ` Drew Adams
       [not found] ` <mailman.0.1226335408.26697.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 9+ messages in thread
From: Drew Adams @ 2008-11-10 18:26 UTC (permalink / raw)
  To: 'Corey Foote', help-gnu-emacs

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

[Please use plain text, not HTML, for this mailing list.]

There are probably several ways to do what you want. Look on Emacs Wiki, and
perhaps take a look also at Ibuffer (dunno about that).

Here is another. In Icicles, you can define any number of named buffer
configurations. Each buffer config represents a named set of buffers, together
with a sort function and other parameters that control buffer-name completion.

* config name
* regexp that buffer names must match
* regexp that buffer names must not match
* predicate that buffer names must satisfy
* explicit list of additional buffers
* buffer-name sort function

For example, here is a buffer config named `Files and Scratch' that includes
only buffer `*scratch*' and buffers visiting files. By default, the buffer names
are sorted alphabetically. 

("Files and Scratch" ; config name
 nil                 ; must-match regexp
 nil                 ; must-not-match regexp
 (lambda (bufname)   ; predicate
   (buffer-file-name
    (get-buffer bufname)))
 ("*scratch*")       ; extra buffers
 string-lessp)       ; sort function

See:
http://www.emacswiki.org/emacs/Icicles_-_Support_for_Projects

http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-b
uffer-configs

Independently of any buffer configs, you can also save (persistently or not) any
set of buffer-name completion candidates to reuse for completion later. (You can
also save and then reuse file names or any other set of completion candidates.)

See:
http://www.emacswiki.org/emacs/Icicles_-_Candidate_Sets







^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Grouping related buffers
       [not found] <mailman.57.1226330484.2211.help-gnu-emacs@gnu.org>
@ 2008-11-10 19:00 ` Scott Frazer
  2008-11-10 19:44   ` Drew Adams
  2008-11-13 15:03 ` rustom
  1 sibling, 1 reply; 9+ messages in thread
From: Scott Frazer @ 2008-11-10 19:00 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Grouping related buffers
  2008-11-10 19:00 ` Grouping related buffers Scott Frazer
@ 2008-11-10 19:44   ` Drew Adams
  0 siblings, 0 replies; 9+ messages in thread
From: Drew Adams @ 2008-11-10 19:44 UTC (permalink / raw)
  To: 'Scott Frazer', help-gnu-emacs

> I'd suggest using the buffer-show package....
> (require 'bs)

I should perhaps have mentioned that Icicles buffer configs were inspired by
those of bs. (The Icicles doc I pointed to makes that clear.)





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Grouping related buffers
@ 2008-11-10 22:18 grischka
  0 siblings, 0 replies; 9+ messages in thread
From: grischka @ 2008-11-10 22:18 UTC (permalink / raw)
  To: coreyfoote; +Cc: help-gnu-emacs

You might want to try "eproject".

http://tromey.com/elpa
http://tromey.com/elpa/eproject-0.1.tar

It doesn't exactly group buffers, but it stores workspaces and allows
to switch from one to another quickly.

With eproject, a workspace includes a set of files and their positioning
in the editor, a separate menu that shows only these files (i.e. not mixed
with nonfile-buffers), and another menu with custom commands (typically make
commands) which can be optionally bound to shortcut keys.

Another feature is that when you close emacs it remembers the current
project and reopens it automatically when you start emacs the other day.

Basically it implements some of the behavior that is known from common IDEs.

As to working on two projects at the same time, I'd just open two instances
of emacs.

--- grischka





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Grouping related buffers
       [not found] ` <mailman.0.1226335408.26697.help-gnu-emacs@gnu.org>
@ 2008-11-13 13:09   ` Stefan Kamphausen
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Kamphausen @ 2008-11-13 13:09 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Tassilo Horn <tassilo@member.fsf.org> writes:

> Corey Foote <coreyfoote@hotmail.com> writes:
>
> Hi Corey!
>
>> I was wondering if there was a way to group related buffers in Emacs
>> through the use of, say, multiple buffer workspaces.

please excuse the self-plug but here it is nevertheless...

I've written something like that for my own use:
http://www.skamphausen.de/cgi-bin/ska/mtorus

You can create a "ring of rings" where the inner rings are markers and
the outer ring organizes the inner rings.  Ah, complicated to explain, I
already tried that in the comments of mtorus.el and failed.  Maybe you
just give it a try.

Cheers,
Stefan
-- 
Stefan Kamphausen --- http://www.skamphausen.de
a blessed +42 regexp of confusion (weapon in hand)
You hit. The format string crumbles and turns to dust.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Grouping related buffers
       [not found] <mailman.57.1226330484.2211.help-gnu-emacs@gnu.org>
  2008-11-10 19:00 ` Grouping related buffers Scott Frazer
@ 2008-11-13 15:03 ` rustom
  1 sibling, 0 replies; 9+ messages in thread
From: rustom @ 2008-11-13 15:03 UTC (permalink / raw)
  To: help-gnu-emacs

On Nov 10, 8:21 pm, Corey Foote <coreyfo...@hotmail.com> 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.)

Have you seen tabbar mode?
[Sorry if others have mentioned it already]


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-11-13 15:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.57.1226330484.2211.help-gnu-emacs@gnu.org>
2008-11-10 19:00 ` Grouping related buffers Scott Frazer
2008-11-10 19:44   ` 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

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