diff options
| author | Eli Zaretskii | 2013-05-08 21:05:40 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-05-08 21:05:40 +0300 |
| commit | 060ca4088d928e0808d13a551ea11b2fc00769d4 (patch) | |
| tree | 602bdbe9e9cc5cc9ad10db714c867f7d79f639c3 | |
| parent | 07525f7737602af36afe40f85f229fee9887f232 (diff) | |
| download | emacs-060ca4088d928e0808d13a551ea11b2fc00769d4.tar.gz emacs-060ca4088d928e0808d13a551ea11b2fc00769d4.zip | |
Avoid beginning/end of buffer errors when moving across display strings.
lisp/simple.el (line-move-visual): Signal beginning/end of buffer
only if vertical-motion moved less than it was requested. Avoids
silly incorrect error messages when there are display strings with
multiple newlines at EOL.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/simple.el | 26 |
2 files changed, 26 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aded31287b6..1abcc933847 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-05-08 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * simple.el (line-move-visual): Signal beginning/end of buffer | ||
| 4 | only if vertical-motion moved less than it was requested. Avoids | ||
| 5 | silly incorrect error messages when there are display strings with | ||
| 6 | multiple newlines at EOL. | ||
| 7 | |||
| 1 | 2013-05-08 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2013-05-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 9 | ||
| 3 | * progmodes/vera-mode.el (vera-underscore-is-part-of-word): | 10 | * progmodes/vera-mode.el (vera-underscore-is-part-of-word): |
diff --git a/lisp/simple.el b/lisp/simple.el index 103c2a4636c..e4bde7c358c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -4857,13 +4857,25 @@ lines." | |||
| 4857 | (frame-char-width)) hscroll)))))) | 4857 | (frame-char-width)) hscroll)))))) |
| 4858 | (if target-hscroll | 4858 | (if target-hscroll |
| 4859 | (set-window-hscroll (selected-window) target-hscroll)) | 4859 | (set-window-hscroll (selected-window) target-hscroll)) |
| 4860 | (or (and (= (vertical-motion | 4860 | ;; vertical-motion can move more than it was asked to if it moves |
| 4861 | (cons (or goal-column | 4861 | ;; across display strings with newlines. We don't want to ring |
| 4862 | (if (consp temporary-goal-column) | 4862 | ;; the bell and announce beginning/end of buffer in that case. |
| 4863 | (car temporary-goal-column) | 4863 | (or (and (or (and (>= arg 0) |
| 4864 | temporary-goal-column)) | 4864 | (>= (vertical-motion |
| 4865 | arg)) | 4865 | (cons (or goal-column |
| 4866 | arg) | 4866 | (if (consp temporary-goal-column) |
| 4867 | (car temporary-goal-column) | ||
| 4868 | temporary-goal-column)) | ||
| 4869 | arg)) | ||
| 4870 | arg)) | ||
| 4871 | (and (< arg 0) | ||
| 4872 | (<= (vertical-motion | ||
| 4873 | (cons (or goal-column | ||
| 4874 | (if (consp temporary-goal-column) | ||
| 4875 | (car temporary-goal-column) | ||
| 4876 | temporary-goal-column)) | ||
| 4877 | arg)) | ||
| 4878 | arg))) | ||
| 4867 | (or (>= arg 0) | 4879 | (or (>= arg 0) |
| 4868 | (/= (point) opoint) | 4880 | (/= (point) opoint) |
| 4869 | ;; If the goal column lies on a display string, | 4881 | ;; If the goal column lies on a display string, |