diff options
| author | Richard M. Stallman | 1994-07-24 01:10:14 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-07-24 01:10:14 +0000 |
| commit | 3534a80918dc297550fa7d0eddf5427942152b04 (patch) | |
| tree | 569e8e6e2349c6be53b98654fcc5d94f891daa1c | |
| parent | e8cf82e8a5952174100ab47c15b7df41325b274e (diff) | |
| download | emacs-3534a80918dc297550fa7d0eddf5427942152b04.tar.gz emacs-3534a80918dc297550fa7d0eddf5427942152b04.zip | |
(line-move, next-line): Check last line moved over
has a newline, in a way that intangible text does not confuse.
| -rw-r--r-- | lisp/simple.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 015074bc6fa..237be507cf1 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1491,8 +1491,8 @@ and more reliable (no dependence on goal column, etc.)." | |||
| 1491 | (interactive "p") | 1491 | (interactive "p") |
| 1492 | (if (and next-line-add-newlines (= arg 1)) | 1492 | (if (and next-line-add-newlines (= arg 1)) |
| 1493 | (let ((opoint (point))) | 1493 | (let ((opoint (point))) |
| 1494 | (forward-line 1) | 1494 | (end-of-line) |
| 1495 | (if (or (= opoint (point)) (not (eq (preceding-char) ?\n))) | 1495 | (if (eobp) |
| 1496 | (insert ?\n) | 1496 | (insert ?\n) |
| 1497 | (goto-char opoint) | 1497 | (goto-char opoint) |
| 1498 | (line-move arg))) | 1498 | (line-move arg))) |
| @@ -1542,8 +1542,15 @@ When the `track-eol' feature is doing its job, the value is 9999.") | |||
| 1542 | 9999 | 1542 | 9999 |
| 1543 | (current-column)))) | 1543 | (current-column)))) |
| 1544 | (if (not (integerp selective-display)) | 1544 | (if (not (integerp selective-display)) |
| 1545 | (or (and (zerop (forward-line arg)) | 1545 | (or (if (> arg 0) |
| 1546 | (bolp)) | 1546 | (progn (if (> arg 1) (forward-line (1- arg))) |
| 1547 | ;; This way of moving forward ARG lines | ||
| 1548 | ;; verifies that we have a newline after the last one. | ||
| 1549 | ;; It doesn't get confused by intangible text. | ||
| 1550 | (end-of-line) | ||
| 1551 | (zerop (forward-line 1))) | ||
| 1552 | (and (zerop (forward-line arg)) | ||
| 1553 | (bolp))) | ||
| 1547 | (signal (if (bobp) | 1554 | (signal (if (bobp) |
| 1548 | 'beginning-of-buffer | 1555 | 'beginning-of-buffer |
| 1549 | 'end-of-buffer) | 1556 | 'end-of-buffer) |