annotate src/tooltalk.doc @ 5492:e82f5b7010fe

Merge some stuff in man, fix up Makefile -------------------- ChangeLog entries follow: -------------------- man/ChangeLog addition: 2010-02-19 Ben Wing <ben@xemacs.org> * widget.texi: * widget.texi (Top): * widget.texi (Introduction): * widget.texi (User Interface): * widget.texi (Programming Example): * widget.texi (Setting Up the Buffer): * widget.texi (Basic Types): * widget.texi (link): * widget.texi (url-link): * widget.texi (info-link): * widget.texi (push-button): * widget.texi (editable-field): * widget.texi (text): * widget.texi (menu-choice): * widget.texi (radio-button-choice): * widget.texi (item): * widget.texi (choice-item): * widget.texi (toggle): * widget.texi (checkbox): * widget.texi (checklist): * widget.texi (editable-list): * widget.texi (group): * widget.texi (Sexp Types): * widget.texi (constants): * widget.texi (generic): * widget.texi (atoms): * widget.texi (composite): * widget.texi (Widget Properties): * widget.texi (Defining New Widgets): * widget.texi (Widget Browser): * widget.texi (Widget Minor Mode): * widget.texi (Utilities): * widget.texi (Widget Wishlist): * widget.texi (Widget Internals): * widget.texi (GNU Free Documentation License): * widget.texi (Index): Sync with FSF 23.1.92. 2010-02-19 Ben Wing <ben@xemacs.org> * texinfo/fdl.texi: New file. * texinfo/texinfo.texi: * texinfo/texinfo.texi (Top): * texinfo/texinfo.texi (Copying Conditions): * texinfo/texinfo.texi (Overview): * texinfo/texinfo.texi (Reporting Bugs): * texinfo/texinfo.texi (Using Texinfo): * texinfo/texinfo.texi (Output Formats): * texinfo/texinfo.texi (Info Files): * texinfo/texinfo.texi (Printed Books): * texinfo/texinfo.texi (Formatting Commands): * texinfo/texinfo.texi (Conventions): * texinfo/texinfo.texi (Comments): * texinfo/texinfo.texi (Minimum): * texinfo/texinfo.texi (Six Parts): * texinfo/texinfo.texi (Short Sample): * texinfo/texinfo.texi (History): * texinfo/texinfo.texi (Texinfo Mode): * texinfo/texinfo.texi (Texinfo Mode Overview): * texinfo/texinfo.texi (XEmacs Editing): * texinfo/texinfo.texi (Inserting): * texinfo/texinfo.texi (Showing the Structure): * texinfo/texinfo.texi (Updating Nodes and Menus): * texinfo/texinfo.texi (Updating Commands): * texinfo/texinfo.texi (Updating Requirements): * texinfo/texinfo.texi (Other Updating Commands): * texinfo/texinfo.texi (Info Formatting): * texinfo/texinfo.texi (Printing): * texinfo/texinfo.texi (Texinfo Mode Summary): * texinfo/texinfo.texi (Beginning a File): * texinfo/texinfo.texi (Sample Beginning): * texinfo/texinfo.texi (Texinfo File Header): * texinfo/texinfo.texi (First Line): * texinfo/texinfo.texi (Start of Header): * texinfo/texinfo.texi (setfilename): * texinfo/texinfo.texi (settitle): * texinfo/texinfo.texi (End of Header): * texinfo/texinfo.texi (Document Permissions): * texinfo/texinfo.texi (copying): * texinfo/texinfo.texi (insertcopying): * texinfo/texinfo.texi (Titlepage & Copyright Page): * texinfo/texinfo.texi (titlepage): * texinfo/texinfo.texi (titlefont center sp): * texinfo/texinfo.texi (title subtitle author): * texinfo/texinfo.texi (Copyright): * texinfo/texinfo.texi (end titlepage): * texinfo/texinfo.texi (headings on off): * texinfo/texinfo.texi (Contents): * texinfo/texinfo.texi (The Top Node): * texinfo/texinfo.texi (Top Node Example): * texinfo/texinfo.texi (Master Menu Parts): * texinfo/texinfo.texi (Global Document Commands): * texinfo/texinfo.texi (documentdescription): * texinfo/texinfo.texi (setchapternewpage): * texinfo/texinfo.texi (paragraphindent): * texinfo/texinfo.texi (firstparagraphindent): * texinfo/texinfo.texi (exampleindent): * texinfo/texinfo.texi (Software Copying Permissions): * texinfo/texinfo.texi (Ending a File): * texinfo/texinfo.texi (Printing Indices & Menus): * texinfo/texinfo.texi (File End): * texinfo/texinfo.texi (Structuring): * texinfo/texinfo.texi (Tree Structuring): * texinfo/texinfo.texi (Structuring Command Types): * texinfo/texinfo.texi (makeinfo top): * texinfo/texinfo.texi (chapter): * texinfo/texinfo.texi (unnumbered & appendix): * texinfo/texinfo.texi (majorheading & chapheading): * texinfo/texinfo.texi (section): * texinfo/texinfo.texi (unnumberedsec appendixsec heading): * texinfo/texinfo.texi (subsection): * texinfo/texinfo.texi (unnumberedsubsec appendixsubsec subheading): * texinfo/texinfo.texi (subsubsection): * texinfo/texinfo.texi (Raise/lower sections): * texinfo/texinfo.texi (Nodes): * texinfo/texinfo.texi (Two Paths): * texinfo/texinfo.texi (Node Menu Illustration): * texinfo/texinfo.texi (node): * texinfo/texinfo.texi (Node Names): * texinfo/texinfo.texi (Writing a Node): * texinfo/texinfo.texi (Node Line Tips): * texinfo/texinfo.texi (Node Line Requirements): * texinfo/texinfo.texi (First Node): * texinfo/texinfo.texi (makeinfo top command): * texinfo/texinfo.texi (makeinfo Pointer Creation): * texinfo/texinfo.texi (anchor): * texinfo/texinfo.texi (Menus): * texinfo/texinfo.texi (Menu Location): * texinfo/texinfo.texi (Writing a Menu): * texinfo/texinfo.texi (Menu Parts): * texinfo/texinfo.texi (Less Cluttered Menu Entry): * texinfo/texinfo.texi (Menu Example): * texinfo/texinfo.texi (Other Info Files): * texinfo/texinfo.texi (Cross References): * texinfo/texinfo.texi (References): * texinfo/texinfo.texi (Cross Reference Commands): * texinfo/texinfo.texi (Cross Reference Parts): * texinfo/texinfo.texi (xref): * texinfo/texinfo.texi (Reference Syntax): * texinfo/texinfo.texi (One Argument): * texinfo/texinfo.texi (Two Arguments): * texinfo/texinfo.texi (Three Arguments): * texinfo/texinfo.texi (Four and Five Arguments): * texinfo/texinfo.texi (Top Node Naming): * texinfo/texinfo.texi (ref): * texinfo/texinfo.texi (pxref): * texinfo/texinfo.texi (inforef): * texinfo/texinfo.texi (uref): * texinfo/texinfo.texi (cite): * texinfo/texinfo.texi (Marking Text): * texinfo/texinfo.texi (Indicating): * texinfo/texinfo.texi (Useful Highlighting): * texinfo/texinfo.texi (code): * texinfo/texinfo.texi (kbd): * texinfo/texinfo.texi (key): * texinfo/texinfo.texi (samp): * texinfo/texinfo.texi (verb): * texinfo/texinfo.texi (var): * texinfo/texinfo.texi (env): * texinfo/texinfo.texi (file): * texinfo/texinfo.texi (command): * texinfo/texinfo.texi (option): * texinfo/texinfo.texi (dfn): * texinfo/texinfo.texi (abbr): * texinfo/texinfo.texi (acronym): * texinfo/texinfo.texi (indicateurl): * texinfo/texinfo.texi (email): * texinfo/texinfo.texi (Emphasis): * texinfo/texinfo.texi (emph & strong): * texinfo/texinfo.texi (Smallcaps): * texinfo/texinfo.texi (Fonts): * texinfo/texinfo.texi (Quotations and Examples): * texinfo/texinfo.texi (Block Enclosing Commands): * texinfo/texinfo.texi (quotation): * texinfo/texinfo.texi (example): * texinfo/texinfo.texi (verbatim): * texinfo/texinfo.texi (verbatiminclude): * texinfo/texinfo.texi (lisp): * texinfo/texinfo.texi (small): * texinfo/texinfo.texi (display): * texinfo/texinfo.texi (format): * texinfo/texinfo.texi (exdent): * texinfo/texinfo.texi (flushleft & flushright): * texinfo/texinfo.texi (noindent): * texinfo/texinfo.texi (indent): * texinfo/texinfo.texi (cartouche): * texinfo/texinfo.texi (Lists and Tables): * texinfo/texinfo.texi (Introducing Lists): * texinfo/texinfo.texi (itemize): * texinfo/texinfo.texi (enumerate): * texinfo/texinfo.texi (Two-column Tables): * texinfo/texinfo.texi (table): * texinfo/texinfo.texi (ftable vtable): * texinfo/texinfo.texi (itemx): * texinfo/texinfo.texi (Multi-column Tables): * texinfo/texinfo.texi (Multitable Column Widths): * texinfo/texinfo.texi (Multitable Rows): * texinfo/texinfo.texi (Special Displays): * texinfo/texinfo.texi (Floats): * texinfo/texinfo.texi (float): * texinfo/texinfo.texi (caption shortcaption): * texinfo/texinfo.texi (listoffloats): * texinfo/texinfo.texi (Images): * texinfo/texinfo.texi (Image Syntax): * texinfo/texinfo.texi (Image Scaling): * texinfo/texinfo.texi (Footnotes): * texinfo/texinfo.texi (Footnote Commands): * texinfo/texinfo.texi (Footnote Styles): * texinfo/texinfo.texi (Indices): * texinfo/texinfo.texi (Index Entries): * texinfo/texinfo.texi (Predefined Indices): * texinfo/texinfo.texi (Indexing Commands): * texinfo/texinfo.texi (Combining Indices): * texinfo/texinfo.texi (syncodeindex): * texinfo/texinfo.texi (synindex): * texinfo/texinfo.texi (New Indices): * texinfo/texinfo.texi (Insertions): * texinfo/texinfo.texi (Atsign Braces Comma): * texinfo/texinfo.texi (Inserting an Atsign): * texinfo/texinfo.texi (Inserting Braces): * texinfo/texinfo.texi (Inserting a Comma): * texinfo/texinfo.texi (Inserting Quote Characters): * texinfo/texinfo.texi (Inserting Space): * texinfo/texinfo.texi (Not Ending a Sentence): * texinfo/texinfo.texi (Ending a Sentence): * texinfo/texinfo.texi (Multiple Spaces): * texinfo/texinfo.texi (frenchspacing): * texinfo/texinfo.texi (dmn): * texinfo/texinfo.texi (Inserting Accents): * texinfo/texinfo.texi (Inserting Quotation Marks): * texinfo/texinfo.texi (Dots Bullets): * texinfo/texinfo.texi (dots): * texinfo/texinfo.texi (bullet): * texinfo/texinfo.texi (TeX and copyright): * texinfo/texinfo.texi (tex): * texinfo/texinfo.texi (copyright symbol): * texinfo/texinfo.texi (registered symbol): * texinfo/texinfo.texi (euro): * texinfo/texinfo.texi (pounds): * texinfo/texinfo.texi (textdegree): * texinfo/texinfo.texi (minus): * texinfo/texinfo.texi (geq leq): * texinfo/texinfo.texi (math): * texinfo/texinfo.texi (Click Sequences): * texinfo/texinfo.texi (Glyphs): * texinfo/texinfo.texi (Glyphs Summary): * texinfo/texinfo.texi (result): * texinfo/texinfo.texi (expansion): * texinfo/texinfo.texi (Print Glyph): * texinfo/texinfo.texi (Error Glyph): * texinfo/texinfo.texi (Equivalence): * texinfo/texinfo.texi (Point Glyph): * texinfo/texinfo.texi (Breaks): * texinfo/texinfo.texi (Break Commands): * texinfo/texinfo.texi (Line Breaks): * texinfo/texinfo.texi (- and hyphenation): * texinfo/texinfo.texi (allowcodebreaks): * texinfo/texinfo.texi (w): * texinfo/texinfo.texi (tie): * texinfo/texinfo.texi (sp): * texinfo/texinfo.texi (page): * texinfo/texinfo.texi (group): * texinfo/texinfo.texi (need): * texinfo/texinfo.texi (Definition Commands): * texinfo/texinfo.texi (Def Cmd Template): * texinfo/texinfo.texi (Def Cmd Continuation Lines): * texinfo/texinfo.texi (Optional Arguments): * texinfo/texinfo.texi (deffnx): * texinfo/texinfo.texi (Def Cmds in Detail): * texinfo/texinfo.texi (Functions Commands): * texinfo/texinfo.texi (Variables Commands): * texinfo/texinfo.texi (Typed Functions): * texinfo/texinfo.texi (Typed Variables): * texinfo/texinfo.texi (Data Types): * texinfo/texinfo.texi (Abstract Objects): * texinfo/texinfo.texi (Object-Oriented Variables): * texinfo/texinfo.texi (Object-Oriented Methods): * texinfo/texinfo.texi (Defining Macros): * texinfo/texinfo.texi (Invoking Macros): * texinfo/texinfo.texi (Macro Details): * texinfo/texinfo.texi (alias): * texinfo/texinfo.texi (definfoenclose): * texinfo/texinfo.texi (Hardcopy): * texinfo/texinfo.texi (Use TeX): * texinfo/texinfo.texi (Format with tex/texindex): * texinfo/texinfo.texi (Format with texi2dvi): * texinfo/texinfo.texi (Print with lpr): * texinfo/texinfo.texi (Within XEmacs): * texinfo/texinfo.texi (Texinfo Mode Printing): * texinfo/texinfo.texi (Compile-Command): * texinfo/texinfo.texi (Requirements Summary): * texinfo/texinfo.texi (Preparing for TeX): * texinfo/texinfo.texi (Overfull hboxes): * texinfo/texinfo.texi (smallbook): * texinfo/texinfo.texi (A4 Paper): * texinfo/texinfo.texi (pagesizes): * texinfo/texinfo.texi (Cropmarks and Magnification): * texinfo/texinfo.texi (PDF Output): * texinfo/texinfo.texi (Obtaining TeX): * texinfo/texinfo.texi (Creating and Installing Info Files): * texinfo/texinfo.texi (Creating an Info File): * texinfo/texinfo.texi (makeinfo advantages): * texinfo/texinfo.texi (Invoking makeinfo): * texinfo/texinfo.texi (makeinfo options): * texinfo/texinfo.texi (Pointer Validation): * texinfo/texinfo.texi (makeinfo in XEmacs): * texinfo/texinfo.texi (texinfo-format commands): * texinfo/texinfo.texi (Batch Formatting): * texinfo/texinfo.texi (Tag and Split Files): * texinfo/texinfo.texi (Installing an Info File): * texinfo/texinfo.texi (Directory File): * texinfo/texinfo.texi (New Info File): * texinfo/texinfo.texi (Other Info Directories): * texinfo/texinfo.texi (Installing Dir Entries): * texinfo/texinfo.texi (Invoking install-info): * texinfo/texinfo.texi (Generating HTML): * texinfo/texinfo.texi (HTML Translation): * texinfo/texinfo.texi (HTML Splitting): * texinfo/texinfo.texi (HTML CSS): * texinfo/texinfo.texi (HTML Xref): * texinfo/texinfo.texi (HTML Xref Link Basics): * texinfo/texinfo.texi (HTML Xref Node Name Expansion): * texinfo/texinfo.texi (HTML Xref Command Expansion): * texinfo/texinfo.texi (HTML Xref 8-bit Character Expansion): * texinfo/texinfo.texi (HTML Xref Mismatch): * texinfo/texinfo.texi (Command List): * texinfo/texinfo.texi (Command Syntax): * texinfo/texinfo.texi (Tips): * texinfo/texinfo.texi (Sample Texinfo Files): * texinfo/texinfo.texi (Short Sample Texinfo File): * texinfo/texinfo.texi (GNU Sample Texts): * texinfo/texinfo.texi (Invoking sample): * texinfo/texinfo.texi (GNU Free Documentation License): * texinfo/texinfo.texi (Index): * texinfo/texinfo.texi (Verbatim Copying License): * texinfo/texinfo.texi (All-permissive Copying License): * texinfo/texinfo.texi (Include Files): * texinfo/texinfo.texi (Using Include Files): * texinfo/texinfo.texi (texinfo-multiple-files-update): * texinfo/texinfo.texi (Include Files Requirements): * texinfo/texinfo.texi (Sample Include File): * texinfo/texinfo.texi (Include Files Evolution): * texinfo/texinfo.texi (Headings): * texinfo/texinfo.texi (Headings Introduced): * texinfo/texinfo.texi (Heading Format): * texinfo/texinfo.texi (Heading Choice): * texinfo/texinfo.texi (Custom Headings): * texinfo/texinfo.texi (Catching Mistakes): * texinfo/texinfo.texi (makeinfo Preferred): * texinfo/texinfo.texi (Debugging with Info): * texinfo/texinfo.texi (Debugging with TeX): * texinfo/texinfo.texi (Using texinfo-show-structure): * texinfo/texinfo.texi (Using occur): * texinfo/texinfo.texi (Running Info-Validate): * texinfo/texinfo.texi (Using Info-validate): * texinfo/texinfo.texi (Unsplit): * texinfo/texinfo.texi (Tagifying): * texinfo/texinfo.texi (Splitting): * texinfo/texinfo.texi (Refilling Paragraphs): * texinfo/texinfo.texi (Command and Variable Index): * texinfo/texinfo.texi (General Index): * texinfo/version.texi: New file. Sync with FSF 23.1.92. Make new directory to hold the files needed to generate texinfo.info, since there are three such files now. 2010-02-19 Ben Wing <ben@xemacs.org> * Makefile: * Makefile (src_files1): * Makefile (DIR): * Makefile (texinfo-srcs): * Makefile ($(INFODIR)/widget.info): * Makefile ($(INFODIR)/texinfo.info): * Makefile (.PHONY): * Makefile (texinfo.dvi): * Makefile (texinfo.pdf): * Makefile ($(HTMLDIR)/widget.html): * Makefile ($(HTMLDIR)/texinfo.html): Incorporate texinfo.texi moving to a subdirectory texinfo/. Do some tricks to reduce the amount of duplication while still maintaining compatible with non-GNU make (at least, with Solaris make). * doclicense.texi: New file. * info.texi: * info.texi (Top): * info.texi (Getting Started): * info.texi (Help-Small-Screen): * info.texi (Help): * info.texi (Help-P): * info.texi (Help-^L): * info.texi (Help-Inv): * info.texi (Help-]): * info.texi (Help-M): * info.texi (Help-FOO): * info.texi (Help-Xref): * info.texi (Help-Int): * info.texi (Help-Q): * info.texi (Advanced): * info.texi (Search Text): * info.texi (Search Index): * info.texi (Go to node): * info.texi (Choose menu subtopic): * info.texi (Create Info buffer): * info.texi (XEmacs Info Variables): * info.texi (Expert Info): * info.texi (Add): * info.texi (Menus): * info.texi (Cross-refs): * info.texi (Help-Cross): * info.texi (Tags): * info.texi (Checking): * info.texi (Index): * texinfo.tex: * texinfo.tex (paragraphindent{%): * texinfo.tex (sectionheading will have): * texinfo.tex (chapterzzz{#3}%): * texinfo.tex (subsubsection = \numberedsubsubsec): * texinfo.tex (subsubsection = \appendixsubsubsec): * texinfo.tex (subsubsection = \unnumberedsubsubsec): * texinfo.tex (sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%): * texinfo.tex (sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%): * texinfo.tex (sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%): * texinfo.tex (sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%): * texinfo.tex (sectionheading{#1}{subsec}{Yappendix}%): * texinfo.tex (sectionheading{#1}{subsec}{Ynothing}%): * texinfo.tex (sectionheading{#1}{subsubsec}{Ynumbered}%): * texinfo.tex (sectionheading{#1}{subsubsec}{Yappendix}%): * texinfo.tex (sectionheading{#1}{subsubsec}{Ynothing}%): * texinfo.tex (sectionheading{#1}{subsubsec}{Yomitfromtoc}{}): * texinfo.tex (sectionheading to do the printing.): * texinfo.tex (sectionlevel}{#1}{#4}%): * texinfo.tex (sectionheading, q.v.): Sync with FSF 23.1.92.
author Ben Wing <ben@xemacs.org>
date Fri, 19 Feb 2010 22:39:19 -0600
parents 576fb035e263
children 365bc8cb5894
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Emacs Tooltalk API Summary
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 The Emacs Lisp interface to Tooltalk is similar, at least in spirit,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 to the standard C Tootalk API. Only the message and pattern parts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 of the API are supported at present, more of the API could be added
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 if needed. The Lisp interface departs from the C API in a few ways:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 - Tooltalk is initialized automatically at emacs startup-time. Messages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 can only be sent other Tooltalk applications connected to the same
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 X11 server that emacs is running on.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 - There are fewer entry points, polymorphic functions with keyword
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 arguments are used instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 - The callback interface is simpler and marginally less functional.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 A single callback may be associated with a message or a pattern,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 the callback is specified with a Lisp symbol (the symbol should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 have a function binding).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 - The session attribute for messages and patterns is always
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 initialized to the default session.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 - Anywhere a Tooltalk enum constant, e.g. TT_SESSION, is valid one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 can substitute the corresponding symbol, e.g. 'TT_SESSION. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 simplifies building lists that represent messages and patterns.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 * Example: Receiving Messages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 Here's a simple example of a handler for a message that tells
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 emacs to display a string in the mini-buffer area. The message
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 operation is called "emacs-display-string", its first (0th) argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 is the string to display:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 (defun tooltalk-display-string-handler (msg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 (message (get-tooltalk-message-attribute msg 'arg_val 0)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 (defvar display-string-pattern
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 '(category TT_HANDLE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 scope TT_SESSION
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 op "emacs-display-string"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 callback tooltalk-display-string-handler))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 (let ((p (make-tooltalk-pattern display-string-pattern)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 (register-tooltalk-pattern p))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 * Example: Sending Messages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 Here's a simple example that sends a query to another application
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 and then displays its reply. Both the query and the reply are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 stored in the first argument of the message.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 (defun tooltalk-random-query-handler (msg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 (let ((state (get-tooltalk-message-attribute msg 'state)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 (cond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 ((eq state 'TT_HANDLED)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 (message (get-tooltalk-message-attribute msg arg_val 0)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 ((memq state '(TT_FAILED TT_REJECTED))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 (message "Random query turns up nothing")))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 (defvar random-query-message
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 '( class TT_REQUEST
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 scope TT_SESSION
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 address TT_PROCEDURE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 op "random-query"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 args '((TT_INOUT "?" "string"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 callback tooltalk-random-query-handler))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 (let ((m (make-tooltalk-message random-query-message)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 (send-tooltalk-message m))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 * Emacs Lisp Tooltalk API
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 ** Sending Messages:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 (make-tooltalk-message attributes)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 Create a tooltalk message and initialize its attributes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 The value of attributes must be a list of alternating keyword/values,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 where keywords are symbols that name valid message attributes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 For example:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 (make-tooltalk-message
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 '(class TT_NOTICE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 scope TT_SESSION
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 address TT_PROCEDURE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 op "do-something"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 args ("arg1" 12345 (TT_INOUT "arg3" "string"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 Values must always be strings, integers, or symbols that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 represent Tooltalk constants. Attribute names are the same as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 those supported by set-tooltalk-message-attribute, plus 'args.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 The value of args should be a list of message arguments where
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 each message argument has the following form:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 (mode [value [type]]) or just value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 Where mode is one of TT_IN, TT_OUT, TT_INOUT and type is a string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 If type isn't specified then "int" is used if the value is a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 number otherwise "string" is used. If type is "string" then value is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 converted to a string (if it isn't a string already) with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 prin1-to-string. If only a value is specified then mode defaults
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 to TT_IN. If mode is TT_OUT then value and type don't need
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 to be specified. You can find out more about the semantics and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 uses of ToolTalk message arguments in chapter 4 of the Tooltalk
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 Programmers Guide.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 (send-tooltalk-message msg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 Send the message on its way. Once the message has been sent it's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 almost always a good idea to get rid of it with destroy-tooltalk-message.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 (return-tooltalk-message msg &optional mode)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 Send a reply to this message. The second argument can be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 'reply, 'reject or 'fail, the default is 'reply. Before sending
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 a reply all message arguments whose mode is TT_INOUT or TT_OUT should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 have been filled in - see set-tooltalk-message-attribute."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 (get-tooltalk-message-attribute msg attribute &optional argn)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 Returns the indicated Tooltalk message attribute. Attributes are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 identified by symbols with the same name (underscores and all) as the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 suffix of the Tooltalk tt_message_<attribute> function that extracts the value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 String attribute values are copied, enumerated type values (except disposition)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 are converted to symbols - e.g. TT_HANDLER is 'TT_HANDLER, uid and gid are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 represented by fixnums (small integers), opnum is converted to a string,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 and disposition is converted to a fixnum. We convert opnum (a C int) to a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 string, e.g. 123 => \"123\" because there's no guarantee that opnums will fit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 within the range of Emacs Lisp integers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 [TBD] Use the 'plist attribute instead of C API 'user attribute
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 for user defined message data. To retrieve the value of a message property
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 specify the indicator for argn. For example to get the value of a property
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 called 'rflagg, use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 (get-tooltalk-message-attribute msg 'plist 'rflag)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 To get the value of a message argument use one of the 'arg_val (strings),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 'arg_ival (integers), or 'arg_bval (strings with embedded nulls), attributes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 Because integer valued arguments can be larger than Emacs Lisp integers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 'arg_ival yields a string. If the value is will fit within 24 bits then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 convert it to an integer with string-to-int. For example to get the integer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 value of the third argument:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 (string-to-int (get-tooltalk-message-attribute msg 'arg_ival 2))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 As you can see, argument numbers are zero based. The type of each arguments
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 can be retrieved, with the 'arg_type attribute, however Tooltalk doesn't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 define any semantics for the string value of 'arg_type. Conventionally
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 "string" is used for strings and "int" for 32 bit integers. Note that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 Emacs Lisp stores the lengths of strings explicitly (unlike C) so treating the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 value returned by 'arg_bval like a string is fine.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 (set-tooltalk-message-attribute value msg attribute &optional argn)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 Initialize one ToolTalk message attribute.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 Attribue names and values are the same as for get-tooltalk-message-attribute.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 A property list is provided for user data (instead of the 'user message
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 attribute), see get-tooltalk-message-attribute.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 Callbacks are handled slightly differently than in the C Tooltalk API.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 The value of callback should be the name of a function of one argument.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 It will be called each time the state of the message changes. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 is usually used to notice when the messages state has
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 changed to TT_HANDLED (or TT_FAILED), so that reply argument values
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 can be used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 If one of the argument attributes is specified, 'arg_val, 'arg_ival, or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 'arg_bval then argn must be the number of an already created argument.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 Arguments can be added to a message with add-tooltalk-message-arg.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 (add-tooltalk-message-arg msg mode type &optional value)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 Append one new argument to the message. Mode must be one of: TT_IN,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 TT_INOUT, or TT_OUT, type must be a string, and value can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 be a string or an integer. Tooltalk doesn't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 define any semantics for type, so only the participants in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 protocol you're using need to agree what types mean (if anything).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 Conventionally "string" is used for strings and "int" for 32 bit integers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 Arguments can initialized by providing a value or with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 set-tooltalk-message-attribute, the latter is necessary if you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 want to initialize the argument with a string that can contain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 embedded nulls (use 'arg_bval).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 (create-tooltalk-message)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 Create a new tooltalk message. The messages session attribute is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 initialized to the default session. Other attributes can be initialized
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 with set-tooltalk-message-attribute. Make-tooltalk-message is the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 preferred to create and initialize a message.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 (destroy-tooltalk-message msg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 Apply tt_message_destroy to the message. It's not necessary
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 to destroy messages after they've been processed by a message or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 pattern callback, the Lisp/Tooltalk callback machinery does this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 for you.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 ** Receiving Messages:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 (make-tooltalk-pattern attributes)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 Create a tooltalk pattern and initialize its attributes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 The value of attributes must be a list of alternating keyword/values,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 where keywords are symbols that name valid pattern attributes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 or lists of valid attributes. For example:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 (make-tooltalk-pattern
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 '(category TT_OBSERVE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 scope TT_SESSION
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 op ("operation1" "operation2")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 args ("arg1" 12345 (TT_INOUT "arg3" "string"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 Attribute names are the same as those supported by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 add-tooltalk-pattern-attribute, plus 'args.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 Values must always be strings, integers, or symbols that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 represent Tooltalk constants or lists of same. When a list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 of values is provided all of the list elements are added to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 the attribute. In the example above, messages whose op
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 attribute is "operation1" or "operation2" would match the pattern.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 The value of args should be a list of pattern arguments where
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 each pattern argument has the following form:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 (mode [value [type]]) or just value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 Where mode is one of TT_IN, TT_OUT, TT_INOUT and type is a string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 If type isn't specified then "int" is used if the value is a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 number otherwise "string" is used. If type is "string" then value is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 converted to a string (if it isn't a string already) with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 prin1-to-string. If only a value is specified then mode defaults
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 to TT_IN. If mode is TT_OUT then value and type don't need
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 to be specified. You can find out more about the semantics and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 uses of ToolTalk pattern arguments in chapter 3 of the Tooltalk
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 Programmers Guide.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 (register-tooltalk-pattern pat)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 Emacs will begin receiving messages that match this pattern.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 (unregister-tooltalk-pattern pat)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 Emacs will stop receiving messages that match this pattern.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 (add-tooltalk-pattern-attribute value pat indicator)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 Add one value to the indicated pattern attribute. The names of attributes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 are the same as the Tooltalk accessors used to set them less the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 "tooltalk_pattern_" prefix and the "_add" suffix). For example
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 428
diff changeset
278 the name of the attribute for tt_pattern_disposition_add attribute
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 is 'disposition. The 'category attribute is handled specially,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 since a pattern can only be a member of one category (TT_OBSERVE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 or TT_HANDLE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 Callbacks are handled slightly differently than in the C Tooltalk API.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 The value of callback should be the name of a function of one argument.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 It will be called each time the pattern matches an incoming message.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 (add-tooltalk-pattern-arg pat mode type value)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 Add one, fully specified, argument to a tooltalk pattern. Mode must
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 be one of TT_IN, TT_INOUT, or TT_OUT, type must be a string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 Value can be an integer, string or nil. If value is an integer then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 an integer argument (tt_pattern_iarg_add) added otherwise a string argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 is added. At present there's no way to add a binary data argument.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 (create-tooltalk-pattern)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 Create a new Tooltalk pattern and initialize its session attribute to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 be the default session.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 (destroy-tooltalk-pattern pat)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 Apply tt_pattern_destroy to the pattern. This effecticely unregisters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 the pattern.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 (describe-tooltalk-message msg &optional stream)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 Print the messages attributes and arguments to stream. This is often
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 useful for debugging.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 * Things to be Done
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 - At the moment there is almost no support for detecting and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 handling ToolTalk errors. This should be added.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 - Message and patterns should support a plist attribute. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 would be based on one more Tooltalk user data key. This would also make
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 it useful to apply the message and pattern callbacks to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 both the message and the matching pattern.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330