Commit 0f6bbc3d authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Support horizontal scrolling of bidirectional text.

 lisp/scroll-bar.el (scroll-bar-toolkit-horizontal-scroll): Add
 rudimentary support for bidirectional text.
parent 96fa02ba
2014-07-27 Eli Zaretskii <eliz@gnu.org>
* scroll-bar.el (scroll-bar-toolkit-horizontal-scroll): Add
rudimentary support for bidirectional text.
2014-07-27 Martin Rudalics <rudalics@gmx.at>
* frame.el (frame-notice-user-settings): Rewrite using
......
......@@ -451,6 +451,9 @@ EVENT should be a scroll bar click."
(let* ((end-position (event-end event))
(window (nth 0 end-position))
(part (nth 4 end-position))
(bidi-factor (if (eq (current-bidi-paragraph-direction) 'left-to-right)
1
-1))
before-scroll)
(cond
((eq part 'end-scroll))
......@@ -462,27 +465,32 @@ EVENT should be a scroll bar click."
(setq before-scroll (or before-scroll (point)))
(cond
((eq part 'before-handle)
(scroll-right 4))
(scroll-right (* bidi-factor 4)))
((eq part 'after-handle)
(scroll-left 4))
(scroll-left (* bidi-factor 4)))
((eq part 'ratio)
(let* ((portion-whole (nth 2 end-position))
(columns (scroll-bar-scale portion-whole
(1- (window-width)))))
(scroll-right
(cond
((not (zerop columns))
columns)
((< (car portion-whole) 0) -1)
(t 1)))))
(* (cond
((not (zerop columns))
columns)
((< (car portion-whole) 0) -1)
(t 1))
bidi-factor))))
((eq part 'left)
(scroll-right 1))
(scroll-right (* bidi-factor 1)))
((eq part 'right)
(scroll-left 1))
(scroll-left (* bidi-factor 1)))
((eq part 'leftmost)
(goto-char (line-beginning-position)))
(goto-char (if (eq bidi-factor 1)
(line-beginning-position)
(line-end-position))))
((eq part 'rightmost)
(goto-char (line-end-position)))
(goto-char (if (eq bidi-factor 1)
(line-end-position)
(line-beginning-position))))
((eq part 'horizontal-handle)
(scroll-bar-horizontal-drag-1 event))))
(sit-for 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment