annotate tests/tooltalk/simple.el @ 5182:2e528066e2fc

Move #'sort*, #'fill, #'merge to C from cl-seq.el. lisp/ChangeLog addition: 2010-04-01 Aidan Kehoe <kehoea@parhasard.net> * cl-seq.el (fill, sort*, merge): Move these functions to fns.c. (stable-sort): Make this docstring reflect the argument names used in the #'sort* docstring. * cl-macs.el (stable-sort): Make #'stable-sort exactly equivalent to #'sort* in compiled code. * bytecomp.el (byte-compile-maybe-add-*): New macro, for functions like #'sort and #'mapcar that, to be strictly compatible, should only take two args, but in our implementation can take more, because they're aliases of #'sort* and #'mapcar*. (byte-compile-mapcar, byte-compile-sort, byte-compile-fillarray): Use this new macro. (map-into): Add a byte-compile method for #'map-into in passing. * apropos.el (apropos-print): Use #'sort* with a :key argument, now it's in C. * compat.el (extent-at): Ditto. * register.el (list-registers): Ditto. * package-ui.el (pui-list-packages): Ditto. * help.el (sorted-key-descriptions): Ditto. src/ChangeLog addition: 2010-03-31 Aidan Kehoe <kehoea@parhasard.net> * fns.c (STRING_DATA_TO_OBJECT_ARRAY) (BIT_VECTOR_TO_OBJECT_ARRAY, c_merge_predicate_key) (c_merge_predicate_nokey, list_merge, array_merge) (list_array_merge_into_list, list_list_merge_into_array) (list_array_merge_into_array, CHECK_KEY_ARGUMENT, Fmerge) (list_sort, array_sort, FsortX): Move #'sort*, #'fill, #'merge from cl-seq.el to C, extending the implementations of Fsort, Ffillarray, and merge() to do so. * keymap.c (keymap_submaps, map_keymap_sort_predicate) (describe_map_sort_predicate): Change the calling semantics of the C sort predicates to return a non-nil Lisp object if the first argument is less than the second, rather than C integers. * fontcolor-msw.c (sort_font_list_function): * fileio.c (build_annotations): * dired.c (Fdirectory_files): * abbrev.c (Finsert_abbrev_table_description): Call list_sort instead of Fsort, list_merge instead of merge() in these functions. man/ChangeLog addition: 2010-04-01 Aidan Kehoe <kehoea@parhasard.net> * lispref/lists.texi (Rearrangement): Update the documentation of #'sort here, now that it accepts any type of sequence and the KEY keyword argument. (Though this is probably now the wrong place for this function, given that.)
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 01 Apr 2010 20:22:50 +0100
parents 131b0175ea99
children 9fc91aa3a927
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1 ;;; Example of Sending Messages
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3 (defun tooltalk-random-query-handler (msg pat)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4 (let ((state (get-tooltalk-message-attribute msg 'state)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6 ((eq state 'TT_HANDLED)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7 (message (get-tooltalk-message-attribute msg arg_val 0)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8 ((memq state '(TT_FAILED TT_REJECTED))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9 (message "Random query turns up nothing")))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11 (setq random-query-message
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12 '( class TT_REQUEST
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13 scope TT_SESSION
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14 address TT_PROCEDURE
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15 op "random-query"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16 args ((TT_INOUT "?" "string"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17 callback tooltalk-random-query-handler))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 (let ((m (make-tooltalk-message random-query-message)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20 (send-tooltalk-message m))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22 ;;; Example of Receiving Messaegs
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24 (defun tooltalk-display-string-handler (msg pat)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25 (return-tooltalk-message msg 'reply)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26 (describe-tooltalk-message msg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27 (message (get-tooltalk-message-attribute msg 'arg_val 0)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29 (setq display-string-pattern
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
30 '(category TT_HANDLE
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
31 scope TT_SESSION
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32 op "emacs-eval"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33 args ((TT_IN "filename" "string"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34 callback tooltalk-display-string-handler))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
35
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
36 (let ((p (make-tooltalk-pattern display-string-pattern)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37 (register-tooltalk-pattern p))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
38