+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
(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))
(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)