Mercurial > hg > xemacs-beta
annotate tests/tooltalk/simple.el @ 4506:bd28481bb0e1
Port #'window-buffer-height, #'fit-window-to-buffer, & window, buf, functions.
lisp/ChangeLog addition:
2008-08-31 Aidan Kehoe <kehoea@parhasard.net>
* window.el (only-window-p): New.
Check if WINDOW is the only window in some context, normally its
frame.
(one-window-p):
Implemented this in terms of #'only-window-p, calling it on the
selected window.
(window-buffer-height): Uncomment this, make it work.
(count-screen-lines): Support a BUFFER argument.
(fit-window-to-buffer): Uncomment this, correct its implementation
to work with XEmacs.
* help.el (temp-buffer-resize-mode): New. Name taken from GNU,
implementation our own.
* (resize-temp-buffer-window): New. GNU-compatible alias for
#'shrink-window-if-larger-than-buffer.
* dumped-lisp.el (preloaded-file-list): Move easy-mmode before
help, now that the latter uses #'define-minor-mode.
* frame.el: Point to #'temp-buffer-resize-mode in a comment.
Some of this code is from GNU; help.el CVS version 1.327 of
2007-03-21, window.el CVS version 1.122, of 2007-06-24. Both these
are GPLV2 or later.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 31 Aug 2008 12:26:46 +0200 |
parents | 131b0175ea99 |
children | 9fc91aa3a927 |
rev | line source |
---|---|
70 | 1 ;;; Example of Sending Messages |
2 | |
3 (defun tooltalk-random-query-handler (msg pat) | |
4 (let ((state (get-tooltalk-message-attribute msg 'state))) | |
5 (cond | |
6 ((eq state 'TT_HANDLED) | |
7 (message (get-tooltalk-message-attribute msg arg_val 0))) | |
8 ((memq state '(TT_FAILED TT_REJECTED)) | |
9 (message "Random query turns up nothing"))))) | |
10 | |
11 (setq random-query-message | |
12 '( class TT_REQUEST | |
13 scope TT_SESSION | |
14 address TT_PROCEDURE | |
15 op "random-query" | |
16 args ((TT_INOUT "?" "string")) | |
17 callback tooltalk-random-query-handler)) | |
18 | |
19 (let ((m (make-tooltalk-message random-query-message))) | |
20 (send-tooltalk-message m)) | |
21 | |
22 ;;; Example of Receiving Messaegs | |
23 | |
24 (defun tooltalk-display-string-handler (msg pat) | |
25 (return-tooltalk-message msg 'reply) | |
26 (describe-tooltalk-message msg) | |
27 (message (get-tooltalk-message-attribute msg 'arg_val 0))) | |
28 | |
29 (setq display-string-pattern | |
30 '(category TT_HANDLE | |
31 scope TT_SESSION | |
32 op "emacs-eval" | |
33 args ((TT_IN "filename" "string")) | |
34 callback tooltalk-display-string-handler)) | |
35 | |
36 (let ((p (make-tooltalk-pattern display-string-pattern))) | |
37 (register-tooltalk-pattern p)) | |
38 |