comparison man/lispref/commands.texi @ 280:7df0dd720c89 r21-0b38

Import from CVS: tag r21-0b38
author cvs
date Mon, 13 Aug 2007 10:32:22 +0200
parents 78f53ef88e17
children c42ec1d1cded
comparison
equal deleted inserted replaced
279:c20b2fb5bb0a 280:7df0dd720c89
236 You can use @samp{*}, @samp{@@}, and @samp{_} together; the order does 236 You can use @samp{*}, @samp{@@}, and @samp{_} together; the order does
237 not matter. Actual reading of arguments is controlled by the rest of 237 not matter. Actual reading of arguments is controlled by the rest of
238 the prompt string (starting with the first character that is not 238 the prompt string (starting with the first character that is not
239 @samp{*}, @samp{@@}, or @samp{_}). 239 @samp{*}, @samp{@@}, or @samp{_}).
240 @end itemize 240 @end itemize
241
242 @defun function-interactive function
243 This function retrieves the interactive specification of @var{function},
244 which may be any funcallable object. The specification will be returned
245 as the list of the symbol @code{interactive} and the specs. If
246 @var{function} is not interactive, @code{nil} will be returned.
247 @end defun
241 248
242 @node Interactive Codes 249 @node Interactive Codes
243 @subsection Code Characters for @code{interactive} 250 @subsection Code Characters for @code{interactive}
244 @cindex interactive code description 251 @cindex interactive code description
245 @cindex description for interactive codes 252 @cindex description for interactive codes
1311 1318
1312 @defun make-event &optional type plist 1319 @defun make-event &optional type plist
1313 This function creates a new event structure. If no arguments are 1320 This function creates a new event structure. If no arguments are
1314 specified, the created event will be empty. To specify the event type, 1321 specified, the created event will be empty. To specify the event type,
1315 use the @var{type} argument. The allowed types are @code{empty}, 1322 use the @var{type} argument. The allowed types are @code{empty},
1316 @code{key-press}, @code{button-press}, @code{button-release}, or 1323 @code{key-press}, @code{button-press}, @code{button-release},
1317 @code{motion}. 1324 @code{motion}, or @code{misc-user}.
1318 1325
1319 @var{plist} is a property list, the properties being compatible to those 1326 @var{plist} is a property list, the properties being compatible to those
1320 returned by @code{event-properties}. For events other than 1327 returned by @code{event-properties}. For events other than
1321 @code{empty}, it is mandatory to specify certain properties. For 1328 @code{empty}, it is mandatory to specify certain properties. For
1322 @code{empty} events, @var{plist} must be @code{nil}. The list is 1329 @code{empty} events, @var{plist} must be @code{nil}. The list is
1383 (make-event 'key-press) 1390 (make-event 'key-press)
1384 @error{} Undefined key for keypress event 1391 @error{} Undefined key for keypress event
1385 @end group 1392 @end group
1386 1393
1387 @group 1394 @group
1388 ;; @r{Creating a key-press event, try No. 2.} 1395 ;; @r{Creating a key-press event, try 2}
1389 (make-event 'key-press '(key home)) 1396 (make-event 'key-press '(key home))
1390 @result{} #<keypress-event home> 1397 @result{} #<keypress-event home>
1391 @end group 1398 @end group
1392 1399
1393 @group 1400 @group
1395 (make-event 'key-press '(key escape modifiers (meta alt control shift))) 1402 (make-event 'key-press '(key escape modifiers (meta alt control shift)))
1396 @result{} #<keypress-event control-meta-alt-shift-escape> 1403 @result{} #<keypress-event control-meta-alt-shift-escape>
1397 @end group 1404 @end group
1398 1405
1399 @group 1406 @group
1400 ;; @r{Create a M-button1 event at coordinates defined by variables 1407 ;; @r{Create a M-button1 event at coordinates defined by variables}
1401 ;; @var{x} and @var{y}.} 1408 ;; @r{@var{x} and @var{y}.}
1402 (make-event 'button-press `(button 1 modifiers (meta) x ,x y ,y)) 1409 (make-event 'button-press `(button 1 modifiers (meta) x ,x y ,y))
1403 @result{} #<buttondown-event meta-button1> 1410 @result{} #<buttondown-event meta-button1>
1404 @end group 1411 @end group
1405 1412
1406 @group 1413 @group
1410 @end group 1417 @end group
1411 1418
1412 @group 1419 @group
1413 ;; @r{Create a mouse-motion event.} 1420 ;; @r{Create a mouse-motion event.}
1414 (make-event 'motion '(x 20 y 30)) 1421 (make-event 'motion '(x 20 y 30))
1415 @result{} #<motion-event 20, 67> 1422 @result{} #<motion-event 20, 30>
1416 1423
1417 ;; @r{(the Y coordinate is printed incompatibly; however:)}
1418 (event-properties (make-event 'motion '(x 20 y 30))) 1424 (event-properties (make-event 'motion '(x 20 y 30)))
1419 @result{} (channel #<x-frame "emacs" 0x8e2> x 20 y 30 modifiers nil timestamp 0) 1425 @result{} (channel #<x-frame "emacs" 0x8e2> x 20 y 30
1426 modifiers nil timestamp 0)
1420 @end group 1427 @end group
1421 @end lisp 1428 @end lisp
1422 1429
1423 In conjunction with @code{event-properties}, you can use 1430 In conjunction with @code{event-properties}, you can use
1424 @code{make-event} to create modified copies of existing events. For 1431 @code{make-event} to create modified copies of existing events. For
1432 1439
1433 Note, however, that you cannot use @code{make-event} as the generic 1440 Note, however, that you cannot use @code{make-event} as the generic
1434 replacement for @code{copy-event}, because it does not allow creating 1441 replacement for @code{copy-event}, because it does not allow creating
1435 all of the event types. 1442 all of the event types.
1436 1443
1437 To create a changed copy of an event, you can use the canonicalization 1444 To create a modified copy of an event, you can use the canonicalization
1438 feature of @var{plist}. The following example creates a copy of 1445 feature of @var{plist}. The following example creates a copy of
1439 @var{event}, but with @code{modifiers} reset to @code{nil}. 1446 @var{event}, but with @code{modifiers} reset to @code{nil}.
1440 1447
1441 @lisp 1448 @lisp
1442 (make-event (event-type @var{event}) 1449 (make-event (event-type @var{event})