annotate man/lispref/mouse.texi @ 5307:c096d8051f89

Have NATNUMP give t for positive bignums; check limits appropriately. src/ChangeLog addition: 2010-11-20 Aidan Kehoe <kehoea@parhasard.net> * abbrev.c (Fexpand_abbrev): * alloc.c: * alloc.c (Fmake_list): * alloc.c (Fmake_vector): * alloc.c (Fmake_bit_vector): * alloc.c (Fmake_byte_code): * alloc.c (Fmake_string): * alloc.c (vars_of_alloc): * bytecode.c (UNUSED): * bytecode.c (Fbyte_code): * chartab.c (decode_char_table_range): * cmds.c (Fself_insert_command): * data.c (check_integer_range): * data.c (Fnatnump): * data.c (Fnonnegativep): * data.c (Fstring_to_number): * elhash.c (hash_table_size_validate): * elhash.c (decode_hash_table_size): * eval.c (Fbacktrace_frame): * event-stream.c (lisp_number_to_milliseconds): * event-stream.c (Faccept_process_output): * event-stream.c (Frecent_keys): * event-stream.c (Fdispatch_event): * events.c (Fmake_event): * events.c (Fevent_timestamp): * events.c (Fevent_timestamp_lessp): * events.h: * events.h (struct command_builder): * file-coding.c (gzip_putprop): * fns.c: * fns.c (check_sequence_range): * fns.c (Frandom): * fns.c (Fnthcdr): * fns.c (Flast): * fns.c (Fnbutlast): * fns.c (Fbutlast): * fns.c (Fmember): * fns.c (Ffill): * fns.c (Freduce): * fns.c (replace_string_range_1): * fns.c (Freplace): * font-mgr.c (Ffc_pattern_get): * frame-msw.c (msprinter_set_frame_properties): * glyphs.c (check_valid_xbm_inline): * indent.c (Fmove_to_column): * intl-win32.c (mswindows_multibyte_to_unicode_putprop): * lisp.h: * lisp.h (ARRAY_DIMENSION_LIMIT): * lread.c (decode_mode_1): * mule-ccl.c (ccl_get_compiled_code): * number.h: * process-unix.c (unix_open_multicast_group): * process.c (Fset_process_window_size): * profile.c (Fstart_profiling): * unicode.c (Funicode_to_char): Change NATNUMP to return 1 for positive bignums; changes uses of it and of CHECK_NATNUM appropriately, usually by checking for an integer in an appropriate range. Add array-dimension-limit and use it in #'make-vector, #'make-string. Add array-total-size-limit, array-rank-limit while we're at it, for the sake of any Common Lisp-oriented code that uses these limits. Rename check_int_range to check_integer_range, have it take Lisp_Objects (and thus bignums) instead. Remove bignum_butlast(), just set int_n to an appropriately large integer if N is a bignum. Accept bignums in check_sequence_range(), change the functions that use check_sequence_range() appropriately. Move the definition of NATNUMP() to number.h; document why it's a reasonable name, contradicting an old comment. tests/ChangeLog addition: 2010-11-20 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: * automated/lisp-tests.el (featurep): * automated/lisp-tests.el (wrong-type-argument): * automated/mule-tests.el (featurep): Check for args-out-of-range errors instead of wrong-type-argument errors in various places when code is handed a large bignum instead of a fixnum. Also check for the wrong-type-argument errors when giving the same code a non-integer value.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 20 Nov 2010 16:49:11 +0000
parents 576fb035e263
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 @c -*-texinfo-*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @c This is part of the XEmacs Lisp Reference Manual.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 0
diff changeset
3 @c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @c See the file lispref.texi for copying conditions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @setfilename ../../info/mouse.info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @node Mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 @chapter The Mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 @cindex mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 * Mouse Position:: Asking where the mouse is, or moving it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 @ignore @c Not in XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 @node Mouse Tracking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 @section Mouse Tracking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 @cindex mouse tracking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 @cindex tracking the mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 (deleted)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 @ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 @c These are not implemented yet.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 These functions change the screen appearance instantaneously. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 effect is transient, only until the next ordinary XEmacs redisplay. That
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 is ok for mouse tracking, since it doesn't make sense for mouse tracking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 to change the text, and the body of @code{track-mouse} normally reads
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 the events itself and does not do redisplay.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 0
diff changeset
30 @defun x-contour-region window start end
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 0
diff changeset
31 This function draws lines to make a box around the text from @var{start}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 to @var{end}, in window @var{window}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 0
diff changeset
35 @defun x-uncontour-region window start end
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 This function erases the lines that would make a box around the text
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 0
diff changeset
37 from @var{start} to @var{end}, in window @var{window}. Use it to remove
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 a contour that you previously made by calling @code{x-contour-region}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 @defun x-draw-rectangle frame left top right bottom
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 This function draws a hollow rectangle on frame @var{frame} with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 specified edge coordinates, all measured in pixels from the inside top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 left corner. It uses the cursor color, the one used for indicating the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 location of point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 @defun x-erase-rectangle frame left top right bottom
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 This function erases a hollow rectangle on frame @var{frame} with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 specified edge coordinates, all measured in pixels from the inside top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 left corner. Erasure means redrawing the text and background that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 normally belong in the specified rectangle.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 @node Mouse Position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 @section Mouse Position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 @cindex mouse position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 @cindex position of mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 The functions @code{mouse-position}, @code{mouse-pixel-position},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 @code{set-mouse-position} and @code{set-mouse-pixel-position} give
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 access to the current position of the mouse.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 @defun mouse-position &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 This function returns a list (@var{window} @var{x} . @var{y}) giving the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 current mouse window and position. The position is given in character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 cells, where @samp{(0, 0)} is the upper-left corner.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 @var{device} specifies the device on which to read the mouse position,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 and defaults to the selected device. If the device is a mouseless
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 terminal or XEmacs hasn't been programmed to read its mouse position, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 returns the device's selected window for @var{window} and @code{nil} for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 @var{x} and @var{y}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 @defun mouse-pixel-position &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 This function returns a list (@var{window} @var{x} . @var{y}) giving the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 current mouse window and position. The position is given in pixel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 units, where @samp{(0, 0)} is the upper-left corner.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 @var{device} specifies the device on which to read the mouse position,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 and defaults to the selected device. If the device is a mouseless
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 terminal or XEmacs hasn't been programmed to read its mouse position, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 returns the device's selected window for @var{window} and @code{nil} for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 @var{x} and @var{y}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 @defun set-mouse-position window x y
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 This function @dfn{warps the mouse} to the center of character position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 @var{x}, @var{y} in frame @var{window}. The arguments @var{x} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 @var{y} are integers, giving the position in characters relative to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 the top left corner of @var{window}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 @cindex warping the mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 @cindex mouse warping
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 Warping the mouse means changing the screen position of the mouse as if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 the user had moved the physical mouse---thus simulating the effect of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 actual mouse motion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 @defun set-mouse-pixel-position window x y
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 This function @dfn{warps the mouse} to pixel position @var{x}, @var{y}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 in frame @var{window}. The arguments @var{x} and @var{y} are integers,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 giving the position in pixels relative to the top left corner of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 @var{window}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 @end defun