comparison lispref/positions.texi @ 7086:075343a6b32b

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Sun, 24 Apr 1994 21:47:17 +0000
parents 3b84ed22f747
children a1c07008521d
comparison
equal deleted inserted replaced
7085:5e56975be72a 7086:075343a6b32b
103 (point-max) 103 (point-max)
104 @result{} 36 104 @result{} 36
105 @end group 105 @end group
106 @end example 106 @end example
107 @end defun 107 @end defun
108
109 @defvar buffer-saved-size
110 The value of this buffer-local variable is the former length of the
111 current buffer, as of the last time it was read in, saved or auto-saved.
112 @end defvar
113 108
114 @node Motion 109 @node Motion
115 @section Motion 110 @section Motion
116 111
117 Motion functions change the value of point, either relative to the 112 Motion functions change the value of point, either relative to the
445 differently, for a given piece of text, depending on the buffer it is 440 differently, for a given piece of text, depending on the buffer it is
446 in, and even on the selected window (because the width, the truncation 441 in, and even on the selected window (because the width, the truncation
447 flag, and display table may vary between windows). @xref{Usual 442 flag, and display table may vary between windows). @xref{Usual
448 Display}. 443 Display}.
449 444
450 @defun vertical-motion count 445 @defun vertical-motion count &optional window
451 This function moves point to the start of the screen line @var{count} 446 This function moves point to the start of the screen line @var{count}
452 screen lines down from the screen line containing point. If @var{count} 447 screen lines down from the screen line containing point. If @var{count}
453 is negative, it moves up instead. 448 is negative, it moves up instead.
454 449
455 This function returns the number of lines moved. The value may be less 450 @code{vertical-motion} returns the number of lines moved. The value may
456 in absolute value than @var{count} if the beginning or end of the buffer 451 be less in absolute value than @var{count} if the beginning or end of
457 was reached. 452 the buffer was reached.
453
454 The window @var{window} is used for obtaining parameters such as the
455 width, the horizontal scrolling, and the display table. But
456 @code{vertical-motion} always operates on the current buffer, even if
457 @var{window} currently displays some other buffer.
458 @end defun 458 @end defun
459 459
460 @deffn Command move-to-window-line count 460 @deffn Command move-to-window-line count
461 This function moves point with respect to the text currently displayed 461 This function moves point with respect to the text currently displayed
462 in the selected window. It moves point to the beginning of the screen 462 in the selected window. It moves point to the beginning of the screen
476 476
477 The value returned is the window line number, with the top line in the 477 The value returned is the window line number, with the top line in the
478 window numbered 0. 478 window numbered 0.
479 @end deffn 479 @end deffn
480 480
481 @defun compute-motion from frompos to topos width offsets 481 @defun compute-motion from frompos to topos width offsets window
482 This function scan through the current buffer, calculating screen 482 This function scan through the current buffer, calculating screen
483 position. It scans the current buffer forward from position @var{from}, 483 position. It scans the current buffer forward from position @var{from},
484 assuming that is at screen coordinates @var{frompos}, to position 484 assuming that is at screen coordinates @var{frompos}, to position
485 @var{to} or coordinates @var{topos}, whichever comes first. It returns 485 @var{to} or coordinates @var{topos}, whichever comes first. It returns
486 the ending buffer position and screen coordinates. 486 the ending buffer position and screen coordinates.
492 text; this affects handling of continuation lines. Use the value 492 text; this affects handling of continuation lines. Use the value
493 returned by @code{window-width} for the window of your choice. 493 returned by @code{window-width} for the window of your choice.
494 494
495 The argument @var{offsets} is either @code{nil} or a cons cell of the 495 The argument @var{offsets} is either @code{nil} or a cons cell of the
496 form @code{(@var{hscroll} . @var{tab-offset})}. Here @var{hscroll} is 496 form @code{(@var{hscroll} . @var{tab-offset})}. Here @var{hscroll} is
497 the number of columns not being displayed at the left margin; in most 497 the number of columns not being displayed at the left margin; most
498 calls, this comes from @code{window-hscroll}. Meanwhile, 498 callers get this from @code{window-hscroll}. Meanwhile,
499 @var{tab-offset} is the number of columns of an initial tab character 499 @var{tab-offset} is the offset between column numbers on the screen and
500 (at @var{from}) that aren't included in the display, perhaps because the 500 column numbers in the buffer. This can be nonzero in a continuation
501 line was continued within that character. 501 line, when the previous screen lines' widths do not add up to a multiple
502 of @code{tab-width}. It is always zero in a non-continuation line.
503
504 The window @var{window} serves to specify which display table to use;
505 that is its only effect. @code{compute-motion} always operates on the
506 current buffer, regardless of what buffer is displayed in @var{window}.
502 507
503 The return value is a list of five elements: 508 The return value is a list of five elements:
504 509
505 @example 510 @example
506 (@var{pos} @var{vpos} @var{hpos} @var{prevhpos} @var{contin}) 511 (@var{pos} @var{vpos} @var{hpos} @var{prevhpos} @var{contin})
528 (point) 533 (point)
529 (cons col line) 534 (cons col line)
530 (window-width) 535 (window-width)
531 (cons (window-hscroll) 0)))) 536 (cons (window-hscroll) 0))))
532 @end example 537 @end example
538
539 When you use @code{compute-motion} for the minibuffer, you need to use
540 @code{minibuffer-prompt-width} to get the horizontal position of the
541 beginning of the first screen line. @xref{Minibuffer Misc}.
533 @end defun 542 @end defun
534 543
535 @node Vertical Motion 544 @node Vertical Motion
536 @comment node-name, next, previous, up 545 @comment node-name, next, previous, up
537 @subsection The User-Level Vertical Motion Commands 546 @subsection The User-Level Vertical Motion Commands
588 Expressions}, for lower-level primitives for scanning sexps or parts of 597 Expressions}, for lower-level primitives for scanning sexps or parts of
589 sexps. For user-level commands, see @ref{Lists and Sexps,,, emacs, GNU 598 sexps. For user-level commands, see @ref{Lists and Sexps,,, emacs, GNU
590 Emacs Manual}. 599 Emacs Manual}.
591 600
592 @deffn Command forward-list arg 601 @deffn Command forward-list arg
593 Move forward across @var{arg} balanced groups of parentheses. 602 This function moves forward across @var{arg} balanced groups of
594 (Other syntactic entities such as words or paired string quotes 603 parentheses. (Other syntactic entities such as words or paired string
595 are ignored.) 604 quotes are ignored.)
596 @end deffn 605 @end deffn
597 606
598 @deffn Command backward-list arg 607 @deffn Command backward-list arg
599 Move backward across @var{arg} balanced groups of parentheses. 608 This function moves backward across @var{arg} balanced groups of
600 (Other syntactic entities such as words or paired string quotes 609 parentheses. (Other syntactic entities such as words or paired string
601 are ignored.) 610 quotes are ignored.)
602 @end deffn 611 @end deffn
603 612
604 @deffn Command up-list arg 613 @deffn Command up-list arg
605 Move forward out of @var{arg} levels of parentheses. 614 This function moves forward out of @var{arg} levels of parentheses.
606 A negative argument means move backward but still to a less deep spot. 615 A negative argument means move backward but still to a less deep spot.
607 @end deffn 616 @end deffn
608 617
609 @deffn Command down-list arg 618 @deffn Command down-list arg
610 Move forward down @var{arg} levels of parentheses. A negative argument 619 This function moves forward down @var{arg} levels of parentheses. A
611 means move backward but still go down @var{arg} levels. 620 negative argument means move backward but still go down @var{arg}
621 levels.
612 @end deffn 622 @end deffn
613 623
614 @deffn Command forward-sexp arg 624 @deffn Command forward-sexp arg
615 Move forward across @var{arg} balanced expressions. 625 This function moves forward across @var{arg} balanced expressions.
616 Balanced expressions include both those delimited by parentheses 626 Balanced expressions include both those delimited by parentheses and
617 and other kinds, such as words and string constants. For example, 627 other kinds, such as words and string constants. For example,
618 628
619 @example 629 @example
620 @group 630 @group
621 ---------- Buffer: foo ---------- 631 ---------- Buffer: foo ----------
622 (concat@point{} "foo " (car x) y z) 632 (concat@point{} "foo " (car x) y z)
633 @end group 643 @end group
634 @end example 644 @end example
635 @end deffn 645 @end deffn
636 646
637 @deffn Command backward-sexp arg 647 @deffn Command backward-sexp arg
638 Move backward across @var{arg} balanced expressions. 648 This function moves backward across @var{arg} balanced expressions.
639 @end deffn 649 @end deffn
650
651 @deffn Command beginning-of-defun arg
652 This function moves back to the @var{arg}th beginning of a defun. If
653 @var{arg} is negative, this actually moves forward, but it still moves
654 to the beginning of a defun, not to the end of one.
655 @end deffn
656
657 @deffn Command end-of-defun arg
658 Move forward to the @var{arg}th end of a defun. If @var{arg} is
659 negative, this actually moves backward, but it still moves to the end of
660 a defun, not to the beginning of one.
661 @end deffn
662
663 @defopt defun-prompt-regexp
664 If non-@code{nil}, this variable holds a regular expression that
665 specifies what text can appear before the open-parenthesis that starts a
666 defun. That is to say, the a defun begins on a line which starts
667 with a match for this regular expression, followed by a character
668 with open-parenthesis syntax.
669 @end defopt
640 670
641 @node Skipping Characters 671 @node Skipping Characters
642 @comment node-name, next, previous, up 672 @comment node-name, next, previous, up
643 @subsection Skipping Characters 673 @subsection Skipping Characters
644 @cindex skipping characters 674 @cindex skipping characters