diff options
| author | Chong Yidong | 2009-12-06 18:48:48 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-12-06 18:48:48 +0000 |
| commit | ef187c24a3a37e579c4c0c61a7ddefc59b17d5c5 (patch) | |
| tree | 3e78e22e516ab36926bccfb2b65f280326bf7ed1 | |
| parent | 571855b6310390faa67d00bef0b0bc7aa118348f (diff) | |
| download | emacs-ef187c24a3a37e579c4c0c61a7ddefc59b17d5c5.tar.gz emacs-ef187c24a3a37e579c4c0c61a7ddefc59b17d5c5.zip | |
* simple.el (beginning-of-visual-line): Constrain to field
boundaries (Bug#5106).
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/simple.el | 13 |
2 files changed, 14 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 57d5b213bb9..c8b11dd1deb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-12-06 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * simple.el (beginning-of-visual-line): Constrain to field | ||
| 4 | boundaries (Bug#5106). | ||
| 5 | |||
| 1 | 2009-12-06 Ulf Jasper <ulf.jasper@web.de> | 6 | 2009-12-06 Ulf Jasper <ulf.jasper@web.de> |
| 2 | 7 | ||
| 3 | * xml.el (xml-substitute-numeric-entities): Moved | 8 | * xml.el (xml-substitute-numeric-entities): Moved |
diff --git a/lisp/simple.el b/lisp/simple.el index 65086dbfdfc..d1656b64919 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -4576,6 +4576,8 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." | |||
| 4576 | (if (/= n 1) | 4576 | (if (/= n 1) |
| 4577 | (let ((line-move-visual t)) | 4577 | (let ((line-move-visual t)) |
| 4578 | (line-move (1- n) t))) | 4578 | (line-move (1- n) t))) |
| 4579 | ;; Unlike `move-beginning-of-line', `move-end-of-line' doesn't | ||
| 4580 | ;; constrain to field boundaries, so we don't either. | ||
| 4579 | (vertical-motion (cons (window-width) 0))) | 4581 | (vertical-motion (cons (window-width) 0))) |
| 4580 | 4582 | ||
| 4581 | (defun beginning-of-visual-line (&optional n) | 4583 | (defun beginning-of-visual-line (&optional n) |
| @@ -4585,10 +4587,13 @@ If point reaches the beginning or end of buffer, it stops there. | |||
| 4585 | To ignore intangibility, bind `inhibit-point-motion-hooks' to t." | 4587 | To ignore intangibility, bind `inhibit-point-motion-hooks' to t." |
| 4586 | (interactive "^p") | 4588 | (interactive "^p") |
| 4587 | (or n (setq n 1)) | 4589 | (or n (setq n 1)) |
| 4588 | (if (/= n 1) | 4590 | (let ((opoint (point))) |
| 4589 | (let ((line-move-visual t)) | 4591 | (if (/= n 1) |
| 4590 | (line-move (1- n) t))) | 4592 | (let ((line-move-visual t)) |
| 4591 | (vertical-motion 0)) | 4593 | (line-move (1- n) t))) |
| 4594 | (vertical-motion 0) | ||
| 4595 | ;; Constrain to field boundaries, like `move-beginning-of-line'. | ||
| 4596 | (goto-char (constrain-to-field (point) opoint (/= n 1))))) | ||
| 4592 | 4597 | ||
| 4593 | (defun kill-visual-line (&optional arg) | 4598 | (defun kill-visual-line (&optional arg) |
| 4594 | "Kill the rest of the visual line. | 4599 | "Kill the rest of the visual line. |