[climacs-devel] Re: Per-pane command-tables?
John Q Splittist
splittist at yahoo.com
Fri Dec 16 14:04:14 UTC 2005
Nikodemus Siivola <nikodemus <at> random-state.net> writes:
> Is there a way to associate command-tables with pane-classes?
If it's not already there, it should be fairly easy to add. I think it just
needs another indirection on find-applicable-command-table through the class
of the pane: buffer panes will ask the syntax, typeouts won't.
> Also, climacs user manual chap. 9. refers to a proposal to change
> buffer/pane relations. Is this done already?
No. I got most of the way there, and hit problems/got distracted/had to work.
The idea was this:
A climacs application-frame has:
o A minibuffer
o One or more windows
o One or more panes
A window is a combination of a pane and an associated info-pane (info-pane
= 'mode-line')
A pane might have an associated buffer. More than one pane might be associated
with the same buffer, but each pane will have its own point, mark etc. A pane
might be associated with NO buffer, if it is a help pane or some other kind of
user feedback.
With this scheme, a nubmer of the buffer commands from emacs become,
naturally, pane commands (Switch To Pane, Next Pane, Kill Pane etc.).
My approach on a Switch Pane was to leave the window constellations where they
were but disown the exisiting pane and adopt a new pane into the
constellation, changing the info-pane's master-pane slot to point to the new
pane.
Here is a description of what I did, based on a diff printout of a couple of
months (!) ago that I exceptionally have lying around here. I hope it is of
some use to someone somewhere.
* make-extended-pane and make-typeout-pane functions that had the appropriate
defaults (including command-table defaults) and essentially just did a make-
pane of the appropriate type then pushed the resulting pane on the front of
the (panes *application-frame*) list.
* (defmethod full-redisplay ((pane typeout-pane))) was a nop.
* a display-name gf that returned the title of a typeout-pane (set on
creation) and, for an extended-pane, either a user-set title or an
autogenerated one. This was to account for creating multiple panes on a single
underlying buffer. The autogenerated name for the first pane on a buffer would
be the buffer name, for subsequent panes something like 'foo.lisp<1>' and so
on. A user-set title would be useful for something like 'foo.lisp pane
defs', 'foo.lisp commands' and so on. The display-name obviously got used in
the info-pane display, pane name completion etc.
* a typeout-table command table (intially inheriting from global-esa-table,
help-table, base-table and window-table, but I think that needed refinement)
* a new panes slot in the climacs application-frame
* a new function buffers, called on the frame, returned a list of the extended-
panes (now, I guess, panes responding t to buffer-pane-p). This replaced the
loop in redisplay-frame-panes :around, so that update-sytax et al. wouldn't
get called on typeout-panes etc.
* display-info just called the new display-info-for-master gf on the master-
pane of the relevant info-pane. Different pane classes would then effectively
have their own info-pane displays.
* a new function replace-pane called on current-pane, new-pane. This caused
current-pane's parent to disown current-pane and adopt new-pane, and fixed the
info-pane's master-pane slot to point to new-pane. It also caused the windows
and panes list of the application-frame to get updated, but I never really
ironed out the good way to do this.
* find-file function was re-engineered to talk about panes rather than buffers
(and to include the almost identical find-file-read-only).
* presentation methods for panes paralleling those of buffers.
* other-pane and switch-to-pane functions/methods using replace-pane.
Switching to a non-existent pane needed to do a make-buffer, a make-extended-
pane, and set the buffer of the new pane to the new buffer before switching to
it.
* a Set Label command (see above); a Kill Pane command etc.
* make-typeout-constellation used make-typeout-pane.
* new function typeout-window-named returned an existing typeout-pane of that
name (appropriately cleared) or created a new one.
* new List Panes command that used the above.
* make-pane-constellation used make-extended-pane.
* climacs-buffer objects no longer needed a point slot (with changes in make-
pane-constellation, initialize-instance :after ((buffer climacs-buffer)) and
((pane climacs-pane)), and (setf buffer) :after (buffer (pane climacs-pane)).
Fun fact: if C-x B Switch To Buffer appears to work with its default argument,
this is only by accident: the accept method does not return the default if you
just hit return.
HTH
JQS
More information about the climacs-devel
mailing list