[climacs-devel] a patch for climacs (mainly regarding COMPLETABLY-PATHNAME) + a gimmick

Robert Strandh strandh at labri.fr
Wed Aug 31 06:43:04 UTC 2005


Hello, 

Max-Gerd Retzlaff writes:
 > 
 >  The COMPLETABLE-PATHNAME class
 > 
 > This patch mainly removes the class COMPLETABLE-PATHNAME. There is
 > nothing special about those pathnames that make them completable. They
 > are just ordinary pathnames (no offence meant). The only difference to
 > the normal PATHNAME presentation-type is that there are different
 > ACCEPT and PRESENT methods for it. (This ACCEPT offers completion over
 > pathnames, and the PRESENT just calls NAMESTRING on the pathname
 > before presenting it.)
 > 
 > This is better done by specialization on the VIEW keyword and not
 > by subclassing PATHNAME. This patch changes Climacs to the former
 > behaviour.

Sounds good to me.

 > The VIEW subclass on which the methods specialize with this patch is
 > CLIMACS-TEXTUAL-VIEW. It has already bean created in pane.lisp but was
 > not yet used anywhere, therefore I just took it. 

Well done.  I think it must have been meant for this kind of
situation. 

 > Is it intended for
 > something else that prohibits the use in this context? 

I don't thinks so. 

 > To be able to
 > use it as a specializer in lambda-lists the variable
 > climacs-pane:+climacs-textual-view+ has been added, it hold an
 > instance of the class climacs-pane:climacs-textual-view, just as there
 > are such variables for the standard view classes (see clim spec 23.6).
 > Both symbols, #:climacs-textual-view and #:+climacs-textual-view+, of
 > the package CLIMACS-PANE are exported.

Again, that sounds good. 

 > +climacs-textual-view+ is also the :default-view for the class
 > CLIMACS-GUI::CLIMACS-MINIBUFFER-PANE now, so that the aforementioned
 > ACCEPT and PRESENT methods for pathnames are used in the minibuffer.
 > (See at the beginning of gui.lisp.) 

OK

 > Is there a special reason why the
 > :DEFAULT-VIEW for the class CLIMACS-PANE:CLIMACS-PANE is not specified
 > in the same way, but in the :AFTER method of (initialize-instance (pane
 > climacs-pane)) via the line:
 > 
 >   (setf (stream-default-view pane) (make-instance 'climacs-textual-view))

I would guess ignorance concerning the existence of :default-view

 > I propose to change this as well, but this patch doesn't do this yet.

Please go ahead. 

 > As the :DEFAULT-VIEW of the minibuffer is now changed, all the calls to
 >    (accept 'completable-pathname :prompt "..")
 > are now substituted by just
 >    (accept 'pathname :prompt "..")
 > without the need for explicit specification by use of the :VIEW
 > keyword. All these calls are changed, even the one in
 > slidemacs-gui.lisp.

OK

 > We should think about to moving this ACCEPT method for pathnames (or
 > something like it) into the McCLIM code, and making it the default
 > ACCEPT method for the TEXTUAL-VIEW class. Completion for pathnames is
 > always nice, isn't it?

I agree, yes. 

 > While we are at PRESENTing pathames: It would nice if in the
 > climacs-info-pane (aka modeline) the name of the buffer would be
 > presented via something like:
 > 
 > (let ((name (name buffer))
 >       (filepath (filepath buffer)))
 >   (if filepath
 >       (with-output-as-presentation (pane filepath 'pathname)
 >         (princ name pane))
 >       (princ name pane)))
 > 
 > and not printed in this huge FORMAT of CLIMACS-GUI::DISPLAY-INFO.

yes, that would be an improvement.  If you have time for that, please
go ahead.  It looks like you are going to need commit privileges to
Climacs as well.  I'll contact the cl.net admins. Keep up the good
work!

 >  The function CLIMACS-GUI:CLIMACS
 > 
 > I added the keywords NEW-PROCESS and PROCESS-NAME to the lambda-list
 > and the correspondent construct. You can now do
 >    (climacs-gui:climacs :new-process t)
 > Just as it is possible with Clouseau and the Climacs-Listener.

Good.  Even better would be to define a package CLIMACS so that one
could omit the "-gui" in the package name. 

 > I think this construct should be provided by McCLIM as an exported
 > macro. I've seen it in the Listener, Clouseau, the Beagle-Backend (in
 > Glimpse), and I use it in my own CLIM applications... Well, this
 > belogs to mcclim-devel.

If you do that, you might want to put it in the clim-extensions
package. 

 > CLIMACS-GUI:CLIMACS is also exported now. Why wasn't it before?

laziness. 

 > Okay, that's all. Only one question left: Why is the variable in the
 > DEFINE-APPLICATION-FRAME form that holds the minibuffer-pane called
 > "int"? What is the meaning of "int"?  I don't get it.

*blush* it used to be for "interactor".  Feel free to rename it. 

 > Bye,
 > Max
 > 
 > 
 > PS: A gimmick for your entertainment, as you've come to the end
 >     of this rather long mail:
 > 
 > Substitute +climacs-textual-view+ in the slot :default-view for the
 > class definition of CLIMACS-MINIBUFFER-PANE by +gadget-view+, apply
 >    http://bl0rg.net/~mgr/flux/CLIM-Listener.patch
 > to the Clim-Listener in your McCLIM source tree (cd mcclim/Apps/Listener/;
 > patch -p 1 < CLIM-Listener.patch) (will soon be commited), download and load
 >    http://bl0rg.net/~mgr/flux/file-selector.lisp
 > (version 1.1!), and fire up FIND FILE in Climacs. You'll get:
 > 
 >    http://bl0rg.net/~mgr/flux/File-Selector-as-Find-File-of-Climacs.png

Neat trick!


-- 
Robert Strandh

---------------------------------------------------------------------
Greenspun's Tenth Rule of Programming: any sufficiently complicated C
or Fortran program contains an ad hoc informally-specified bug-ridden
slow implementation of half of Common Lisp.
---------------------------------------------------------------------



More information about the climacs-devel mailing list