[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Character Styles

There are lots of ways to do this. However, a very simple way is to
use the Rooms system from the slug library tapes. This allows you to specify
one or more windows as a room. Then when you want to enter that "room", that
set of windows will take on all of the attributes you had set when you initially
created the room (size, position, fonts, typeout action - all user settable
attributes). It is very simple to use - just set the window(s) to the way you
want them and then say "Create Room"; a menu with all the existing windows pops
up and you select which of them you want to include in this room. To retrieve
the room you just say "Show Room <roomname>". The rooms are stored in a directory
so they are preserved between sessions. There's a programmer's interface so you
can have your init file load and "show" an initial room when you login.

This doesn't solve all of your problems, but it might help with some. The other
things you mention are to make the attributes for all occurences of a window type.
Simply make an :after daemon for the :init method of the window class you want
to change. If this is put on one of the initialization lists (either cold or warm,
I'm not sure which is best) every window of that type - including the initial one
- will have the desired properties.

Finally, you want to look at mode-hooks for zmacs to make different file types
look differently in zmacs. The mode hook means that when a buffer is created of
a particular type, a function pointed to by the appropriate mode hook is run. For

(defun lisp-mode-behaviour ()
  (zwei:update-attribute-list-internal zwei:*interval*)
(setf zwei:lisp-mode-hook 'lisp-mode-behaviour)

means everytime I create a lisp buffer, the attribute list is updated and character
style lock is set so that comments appear in a different font from code.