Mercurial > emacs
comparison lisp/simple.el @ 10226:1817c5332316
(next-line, previous-line): If interactive and not in
kbd macro, catch the error and beep instead.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 23 Dec 1994 17:25:50 +0000 |
parents | 10a032873be6 |
children | 85ae09b49021 |
comparison
equal
deleted
inserted
replaced
10225:2e5dcd5f3090 | 10226:1817c5332316 |
---|---|
1533 "Move cursor vertically down ARG lines. | 1533 "Move cursor vertically down ARG lines. |
1534 If there is no character in the target line exactly under the current column, | 1534 If there is no character in the target line exactly under the current column, |
1535 the cursor is positioned after the character in that line which spans this | 1535 the cursor is positioned after the character in that line which spans this |
1536 column, or at the end of the line if it is not long enough. | 1536 column, or at the end of the line if it is not long enough. |
1537 If there is no line in the buffer after this one, behavior depends on the | 1537 If there is no line in the buffer after this one, behavior depends on the |
1538 value of next-line-add-newlines. If non-nil, a newline character is inserted | 1538 value of `next-line-add-newlines'. If non-nil, it inserts a newline character |
1539 to create a line and the cursor moves to that line, otherwise the cursor is | 1539 to create a line, and moves the cursor to that line. Otherwise it moves the |
1540 moved to the end of the buffer (if already at the end of the buffer, an error | 1540 cursor to the end of the buffer (if already at the end of the buffer, an error |
1541 is signaled). | 1541 is signaled). |
1542 | 1542 |
1543 The command \\[set-goal-column] can be used to create | 1543 The command \\[set-goal-column] can be used to create |
1544 a semipermanent goal column to which this command always moves. | 1544 a semipermanent goal column to which this command always moves. |
1545 Then it does not try to move vertically. This goal column is stored | 1545 Then it does not try to move vertically. This goal column is stored |
1554 (end-of-line) | 1554 (end-of-line) |
1555 (if (eobp) | 1555 (if (eobp) |
1556 (insert ?\n) | 1556 (insert ?\n) |
1557 (goto-char opoint) | 1557 (goto-char opoint) |
1558 (line-move arg))) | 1558 (line-move arg))) |
1559 (line-move arg)) | 1559 (if (interactive-p) |
1560 (condition-case nil | |
1561 (line-move arg) | |
1562 ((beginning-of-buffer end-of-buffer) (ding))) | |
1563 (line-move arg))) | |
1560 nil) | 1564 nil) |
1561 | 1565 |
1562 (defun previous-line (arg) | 1566 (defun previous-line (arg) |
1563 "Move cursor vertically up ARG lines. | 1567 "Move cursor vertically up ARG lines. |
1564 If there is no character in the target line exactly over the current column, | 1568 If there is no character in the target line exactly over the current column, |
1571 | 1575 |
1572 If you are thinking of using this in a Lisp program, consider using | 1576 If you are thinking of using this in a Lisp program, consider using |
1573 `forward-line' with a negative argument instead. It is usually easier | 1577 `forward-line' with a negative argument instead. It is usually easier |
1574 to use and more reliable (no dependence on goal column, etc.)." | 1578 to use and more reliable (no dependence on goal column, etc.)." |
1575 (interactive "p") | 1579 (interactive "p") |
1576 (line-move (- arg)) | 1580 (if (interactive-p) |
1581 (condition-case nil | |
1582 (line-move (- arg)) | |
1583 ((beginning-of-buffer end-of-buffer) (ding))) | |
1584 (line-move (- arg))) | |
1577 nil) | 1585 nil) |
1578 | 1586 |
1579 (defconst track-eol nil | 1587 (defconst track-eol nil |
1580 "*Non-nil means vertical motion starting at end of line keeps to ends of lines. | 1588 "*Non-nil means vertical motion starting at end of line keeps to ends of lines. |
1581 This means moving to the end of each line moved onto. | 1589 This means moving to the end of each line moved onto. |