[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: as-is writing for ctedits
=> I want to write a function that is similar to {ctedit}:write-as-is,
=> but with an additional file argument:
=>
=> ;; from ct-env.ll:
=> (setq #:sys-package:colon '{ctedit})
=>
=> ...
=>
=> (de :write-as-is (ctedit)
=> ;---------------
=> ; Queries user for a file to save.
=> ; NB: file must contain a suffix.
=> (let ((fullpathname (#:interface:query-dialog
=> (#:interface:prompt 'write))))
=> (when fullpathname
=> (#:inter:withoutput
=> 257 fullpathname ({buffer}:write-as-is (:buffer ctedit))))))
=>
=> -->
=>
=> (de :write-as-is (ctedit file)
=> (#:inter:withoutput
=> 257 file ({buffer}:write-as-is ({ctedit}:buffer ctedit)))))
=> ^^^^^^^^^^^^^^^
=>
=> BUT: {ctedit}:buffer is not exported from its definition module!!
=>
=> How can I write a function that does the same as the above one would
=> do if {ctedit}:buffer would still exist for users???
To my knowledge, {ctedit}:buffer has never been documented anywhere. And it is
true that this function is now internal to the centaur/sources/sysobj/ctedit
module.
But the formatter is still available to users, by the call
{ctedit}:get-formatter. I quote the documentation, volume core, ctedit manual,
page 2 :
({ctedit}:get-formatter ctedit) -> formatter
Returns the ctedit formatter. You may then call formatter specific functions
or set formatter properties on the result.
When the formatter is of type {image}:buffer (this is always the case except
for prototype code not yet mature), the {buffer}:write-as-is function may be
called.
This function prints on the current output channel the contents of the display
structure. This function is not in the documentation, but it should be. You
can safely use it.
Vincent