diff options
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/simple.el | 12 | ||||
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/dispnew.c | 8 |
4 files changed, 25 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 56a1c39317a..4077e351ba8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2015-01-08 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * simple.el (line-move-visual): When converting X pixel coordinate | ||
| 4 | to temporary-goal-column, adjust the value for right-to-left | ||
| 5 | screen lines. This fixes vertical-motion, next/prev-line, etc. | ||
| 6 | |||
| 1 | 2015-01-08 Glenn Morris <rgm@gnu.org> | 7 | 2015-01-08 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * files.el (file-tree-walk): Remove; of unknown authorship. (Bug#19325) | 9 | * files.el (file-tree-walk): Remove; of unknown authorship. (Bug#19325) |
diff --git a/lisp/simple.el b/lisp/simple.el index e15291a345b..25293edf88f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -5604,14 +5604,22 @@ If NOERROR, don't signal an error if we can't move that many lines." | |||
| 5604 | (> (cdr temporary-goal-column) 0)) | 5604 | (> (cdr temporary-goal-column) 0)) |
| 5605 | (setq target-hscroll (cdr temporary-goal-column))) | 5605 | (setq target-hscroll (cdr temporary-goal-column))) |
| 5606 | ;; Otherwise, we should reset `temporary-goal-column'. | 5606 | ;; Otherwise, we should reset `temporary-goal-column'. |
| 5607 | (let ((posn (posn-at-point))) | 5607 | (let ((posn (posn-at-point)) |
| 5608 | x-pos) | ||
| 5608 | (cond | 5609 | (cond |
| 5609 | ;; Handle the `overflow-newline-into-fringe' case: | 5610 | ;; Handle the `overflow-newline-into-fringe' case: |
| 5610 | ((eq (nth 1 posn) 'right-fringe) | 5611 | ((eq (nth 1 posn) 'right-fringe) |
| 5611 | (setq temporary-goal-column (cons (- (window-width) 1) hscroll))) | 5612 | (setq temporary-goal-column (cons (- (window-width) 1) hscroll))) |
| 5612 | ((car (posn-x-y posn)) | 5613 | ((car (posn-x-y posn)) |
| 5614 | (setq x-pos (car (posn-x-y posn))) | ||
| 5615 | ;; In R2L lines, the X pixel coordinate is measured from the | ||
| 5616 | ;; left edge of the window, but columns are still counted | ||
| 5617 | ;; from the logical-order beginning of the line, i.e. from | ||
| 5618 | ;; the right edge in this case. We need to adjust for that. | ||
| 5619 | (if (eq (current-bidi-paragraph-direction) 'right-to-left) | ||
| 5620 | (setq x-pos (- (window-body-width nil t) 1 x-pos))) | ||
| 5613 | (setq temporary-goal-column | 5621 | (setq temporary-goal-column |
| 5614 | (cons (/ (float (car (posn-x-y posn))) | 5622 | (cons (/ (float x-pos) |
| 5615 | (frame-char-width)) | 5623 | (frame-char-width)) |
| 5616 | hscroll)))))) | 5624 | hscroll)))))) |
| 5617 | (if target-hscroll | 5625 | (if target-hscroll |
diff --git a/src/ChangeLog b/src/ChangeLog index 4365222ff7b..c302f95d3fa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2015-01-08 Eli Zaretskii <eliz@gnu.org> | 1 | 2015-01-08 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * dispnew.c (buffer_posn_from_coords): Fix the value of the column | ||
| 4 | returned for right-to-left screen lines. (Before the change on | ||
| 5 | 2014-12-30, the incorrectly-computed X pixel coordinate concealed | ||
| 6 | this bug.) | ||
| 7 | |||
| 3 | * .gdbinit (xsymname): New subroutine. | 8 | * .gdbinit (xsymname): New subroutine. |
| 4 | (xprintsym, initial-tbreak): Use it to access the name of a symbol | 9 | (xprintsym, initial-tbreak): Use it to access the name of a symbol |
| 5 | in a way that doesn't cause GDB to barf when it tries to | 10 | in a way that doesn't cause GDB to barf when it tries to |
diff --git a/src/dispnew.c b/src/dispnew.c index b998e654881..cefcd0809a0 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5162,7 +5162,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5162 | 5162 | ||
| 5163 | Fset_buffer (old_current_buffer); | 5163 | Fset_buffer (old_current_buffer); |
| 5164 | 5164 | ||
| 5165 | *dx = x0 + it.first_visible_x - it.current_x; | 5165 | *dx = to_x - it.current_x; |
| 5166 | *dy = *y - it.current_y; | 5166 | *dy = *y - it.current_y; |
| 5167 | 5167 | ||
| 5168 | string = w->contents; | 5168 | string = w->contents; |
| @@ -5237,9 +5237,9 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5237 | } | 5237 | } |
| 5238 | 5238 | ||
| 5239 | /* Add extra (default width) columns if clicked after EOL. */ | 5239 | /* Add extra (default width) columns if clicked after EOL. */ |
| 5240 | x1 = max (0, it.current_x + it.pixel_width - it.first_visible_x); | 5240 | x1 = max (0, it.current_x + it.pixel_width); |
| 5241 | if (x0 > x1) | 5241 | if (to_x > x1) |
| 5242 | it.hpos += (x0 - x1) / WINDOW_FRAME_COLUMN_WIDTH (w); | 5242 | it.hpos += (to_x - x1) / WINDOW_FRAME_COLUMN_WIDTH (w); |
| 5243 | 5243 | ||
| 5244 | *x = it.hpos; | 5244 | *x = it.hpos; |
| 5245 | *y = it.vpos; | 5245 | *y = it.vpos; |