Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need a switch-buffer-hook

4 views
Skip to first unread message

Joe Reiss

unread,
Sep 2, 1994, 9:06:09 PM9/2/94
to
In GNU Emacs 19.25.1 of Wed Aug 31 1994 on opus (mab-next-ns3)

This isn't really a bug, but a feature that would aid in a great many
things. There needs to be a hook that gets called anytime the
currently selected buffer changes. Why? Well, I have two reasons.

1) I'm running the NeXTSTEP port of Emacs 19, and it has the ability
to change the icon that a frame displays when miniaturized. The
frame's icon is one of the frame-parameters. The problem is
that, though the icons match a variety of file extensions,
there's no way to change the icon when the currently active
buffer changes. A switch-buffer-hook would provide this.

2) When selecting a region, it can be awfully confusing. The cursor
(at least on this setup) looks identical to the region, thus
making it appear that the region is one character larger or
smaller than it actually is. Now I can change the cursor in the
activate-mark-hook and deactivate-mark-hook so that it either
disappears or changes appearance, but then when I switch buffers
without deactivating the mark, the cursor is still in its altered
state. With a switch-buffer-hook, I could determine when I
needed to return the cursor to its original appearance.

These are just the two examples I've come up with. I'm sure there are
many more (allowing users to change the title of a frame to match the
buffer name even when there's only one frame is another possibility).
This doesn't seem like it would be too difficult to implement, either.

What say you guys? Here's hopin'...
Joe

Richard Stallman

unread,
Sep 3, 1994, 12:44:34 AM9/3/94
to
For both of the features you want, using a switch-buffer-hook would be
a kludgy way to implement them. I believe such a hook would only be
usable for kludges, so I am not going to implement one.

These features should be implemented in different ways that are not
kludges. For example, by displaying the cursor and the region with
different colors--which is already possible.

0 new messages