Mercurial > emacs
comparison lispref/positions.texi @ 21007:66d807bdc5b4
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 28 Feb 1998 01:53:53 +0000 |
parents | 680aa532d697 |
children | 90da2489c498 |
comparison
equal
deleted
inserted
replaced
21006:00022857f529 | 21007:66d807bdc5b4 |
---|---|
1 @c -*-texinfo-*- | 1 @c -*-texinfo-*- |
2 @c This is part of the GNU Emacs Lisp Reference Manual. | 2 @c This is part of the GNU Emacs Lisp Reference Manual. |
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. | 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998 Free Software Foundation, Inc. |
4 @c See the file elisp.texi for copying conditions. | 4 @c See the file elisp.texi for copying conditions. |
5 @setfilename ../info/positions | 5 @setfilename ../info/positions |
6 @node Positions, Markers, Frames, Top | 6 @node Positions, Markers, Frames, Top |
7 @chapter Positions | 7 @chapter Positions |
8 @cindex position (in buffer) | 8 @cindex position (in buffer) |
285 | 285 |
286 The return value of @code{goto-line} is the difference between | 286 The return value of @code{goto-line} is the difference between |
287 @var{line} and the line number of the line to which point actually was | 287 @var{line} and the line number of the line to which point actually was |
288 able to move (in the full buffer, before taking account of narrowing). | 288 able to move (in the full buffer, before taking account of narrowing). |
289 Thus, the value is positive if the scan encounters the real end of the | 289 Thus, the value is positive if the scan encounters the real end of the |
290 buffer. The value is zero if scan encounters the end of the accessible | 290 buffer before finding the specified line. The value is zero if scan |
291 portion but not the real end of the buffer. | 291 encounters the end of the accessible portion but not the real end of the |
292 buffer. | |
292 | 293 |
293 In an interactive call, @var{line} is the numeric prefix argument if | 294 In an interactive call, @var{line} is the numeric prefix argument if |
294 one has been provided. Otherwise @var{line} is read in the minibuffer. | 295 one has been provided. Otherwise @var{line} is read in the minibuffer. |
295 @end deffn | 296 @end deffn |
296 | 297 |
455 @defun vertical-motion count &optional window | 456 @defun vertical-motion count &optional window |
456 This function moves point to the start of the screen line @var{count} | 457 This function moves point to the start of the screen line @var{count} |
457 screen lines down from the screen line containing point. If @var{count} | 458 screen lines down from the screen line containing point. If @var{count} |
458 is negative, it moves up instead. | 459 is negative, it moves up instead. |
459 | 460 |
460 @code{vertical-motion} returns the number of lines moved. The value may | 461 @code{vertical-motion} returns the number of screen lines over which it |
461 be less in absolute value than @var{count} if the beginning or end of | 462 moved point. The value may be less in absolute value than @var{count} |
462 the buffer was reached. | 463 if the beginning or end of the buffer was reached. |
463 | 464 |
464 The window @var{window} is used for obtaining parameters such as the | 465 The window @var{window} is used for obtaining parameters such as the |
465 width, the horizontal scrolling, and the display table. But | 466 width, the horizontal scrolling, and the display table. But |
466 @code{vertical-motion} always operates on the current buffer, even if | 467 @code{vertical-motion} always operates on the current buffer, even if |
467 @var{window} currently displays some other buffer. | 468 @var{window} currently displays some other buffer. |
529 | 530 |
530 The result @var{prevhpos} is the horizontal position one character back | 531 The result @var{prevhpos} is the horizontal position one character back |
531 from @var{pos}. The result @var{contin} is @code{t} if the last line | 532 from @var{pos}. The result @var{contin} is @code{t} if the last line |
532 was continued after (or within) the previous character. | 533 was continued after (or within) the previous character. |
533 | 534 |
534 For example, to find the buffer position of column @var{col} of line | 535 For example, to find the buffer position of column @var{col} of screen line |
535 @var{line} of a certain window, pass the window's display start location | 536 @var{line} of a certain window, pass the window's display start location |
536 as @var{from} and the window's upper-left coordinates as @var{frompos}. | 537 as @var{from} and the window's upper-left coordinates as @var{frompos}. |
537 Pass the buffer's @code{(point-max)} as @var{to}, to limit the scan to | 538 Pass the buffer's @code{(point-max)} as @var{to}, to limit the scan to |
538 the end of the accessible portion of the buffer, and pass @var{line} and | 539 the end of the accessible portion of the buffer, and pass @var{line} and |
539 @var{col} as @var{topos}. Here's a function that does this: | 540 @var{col} as @var{topos}. Here's a function that does this: |
691 @end example | 692 @end example |
692 @end defun | 693 @end defun |
693 | 694 |
694 @defun skip-chars-backward character-set &optional limit | 695 @defun skip-chars-backward character-set &optional limit |
695 This function moves point backward, skipping characters that match | 696 This function moves point backward, skipping characters that match |
696 @var{character-set}, until @var{limit}. It just like | 697 @var{character-set}, until @var{limit}. It is just like |
697 @code{skip-chars-forward} except for the direction of motion. | 698 @code{skip-chars-forward} except for the direction of motion. |
698 @end defun | 699 @end defun |
699 | 700 |
700 @node Excursions | 701 @node Excursions |
701 @section Excursions | 702 @section Excursions |
794 | 795 |
795 @deffn Command narrow-to-page move-count | 796 @deffn Command narrow-to-page move-count |
796 This function sets the accessible portion of the current buffer to | 797 This function sets the accessible portion of the current buffer to |
797 include just the current page. An optional first argument | 798 include just the current page. An optional first argument |
798 @var{move-count} non-@code{nil} means to move forward or backward by | 799 @var{move-count} non-@code{nil} means to move forward or backward by |
799 @var{move-count} pages and then narrow. The variable | 800 @var{move-count} pages and then narrow to one page. The variable |
800 @code{page-delimiter} specifies where pages start and end | 801 @code{page-delimiter} specifies where pages start and end |
801 (@pxref{Standard Regexps}). | 802 (@pxref{Standard Regexps}). |
802 | 803 |
803 In an interactive call, @var{move-count} is set to the numeric prefix | 804 In an interactive call, @var{move-count} is set to the numeric prefix |
804 argument. | 805 argument. |
831 @code{save-restriction} construct. Read the entire description here | 832 @code{save-restriction} construct. Read the entire description here |
832 before you try it. | 833 before you try it. |
833 | 834 |
834 If @var{body} changes the current buffer, @code{save-restriction} still | 835 If @var{body} changes the current buffer, @code{save-restriction} still |
835 restores the restrictions on the original buffer (the buffer whose | 836 restores the restrictions on the original buffer (the buffer whose |
836 restructions it saved from), but it does not restore the identity of the | 837 restrictions it saved from), but it does not restore the identity of the |
837 current buffer. | 838 current buffer. |
838 | 839 |
839 @code{save-restriction} does @emph{not} restore point and the mark; use | 840 @code{save-restriction} does @emph{not} restore point and the mark; use |
840 @code{save-excursion} for that. If you use both @code{save-restriction} | 841 @code{save-excursion} for that. If you use both @code{save-restriction} |
841 and @code{save-excursion} together, @code{save-excursion} should come | 842 and @code{save-excursion} together, @code{save-excursion} should come |