unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* `buffer-list' and the frame-parameter `buffer-predicate'
@ 2002-08-16 18:27 Oliver Scholz
  2002-08-16 20:15 ` Robert J. Chassell
  2002-08-17  4:50 ` Richard Stallman
  0 siblings, 2 replies; 10+ messages in thread
From: Oliver Scholz @ 2002-08-16 18:27 UTC (permalink / raw)


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

I tried to write a frame-local minor mode that was intended to provide
a feature to deal with the metric tons of buffers and that could be
useful -- in my humble opinion -- especially for beginners.

In the middle of writing this package I discovered that the whole
approach has a bug which makes it unusable. I can think of no way to
get around this, except for a change in Emacs itself. (But I may, of
course, be missing something.)

So this is the feature that I want to implement: it should be possible
to "dedicate" a frame to a certain pre-configured type of
buffers. That means that this special frame hides all buffers that it
doesn't cover.

I think, it is best explained with an example of the possible
usage. Say, I want to have two frames, one for Gnus and the other one
for all the rest of my editing. The effect of my mode should be that
all functions for buffer-listing or buffer-switching in the Gnus-frame
show only resp. apply only to the *Group*, *Summary*, *Article* and
the message-buffers, while exactly those buffer are not visible in the
other frame. In other words: it would seem as if Gnus were running in
a separate instance of Emacs, while, of course, it still _is_ the same
instance with all the benefits implied by this.

The same could be useful for Emacs/W3 (separate browser-frame), dired
(separate file-manager frame), shell-mode (separate Emacs-terms) or
whatever. I could even think of, say, frames dedicated to a certain
programming-project.

Now, my approach is to add a predicate-function to the frame-parameter
`buffer-predicate' and to advise the function `buffer-list' to return
only buffers for which this predicate function returns non-nil. This
way the mode bypasses the myriads of available buffer-switch- and
-list-functions.

The big, big problem is that this bypasses functions like
`save-buffers-kill-emacs', too. And exactly this makes it unusable.

So here is my petition: change `buffer-list' to return _always_ only
buffers for which the function in the frame-paramter 'buffer-predicate
returns non-nil. And add a second, underlying function for the
internal use in functions like `save-buffers-kill-emacs'.  Provided,
of course, that you find this feature useful enough, that you want to
add it to Emacs.

I have attached the unfinished code that I have written so far; so you
can see what I am aiming at. Or at least, that I am serious about
this.

[BTW: one thing that puzzles me: this works for functions like
`iswitchb-mode' or the according function in `ido' or for
`bs-show' and -- unfortunately -- for `save-buffers-kill-emacs'. But
not for `switch-to-buffer'.]

    -- Oliver


[-- Attachment #2: sframes.el --]
[-- Type: application/emacs-lisp, Size: 13443 bytes --]

[-- Attachment #3: Type: text/plain, Size: 72 bytes --]


-- 
29 Thermidor an 210 de la Révolution
Liberté, Egalité, Fraternité!

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

end of thread, other threads:[~2002-08-18 21:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-16 18:27 `buffer-list' and the frame-parameter `buffer-predicate' Oliver Scholz
2002-08-16 20:15 ` Robert J. Chassell
2002-08-17  4:50 ` Richard Stallman
2002-08-17 11:19   ` Oliver Scholz
2002-08-17 12:54     ` Alex Schroeder
2002-08-17 15:33       ` Oliver Scholz
2002-08-18  6:31     ` Richard Stallman
2002-08-18 17:24       ` Kai Großjohann
2002-08-18 21:12         ` Oliver Scholz
2002-08-18 18:26       ` Oliver Scholz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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