[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 1a99bd6 10/12: Default web pages to right-to-left
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] emacs-25 1a99bd6 10/12: Default web pages to right-to-left |
Date: |
Fri, 25 Dec 2015 16:06:03 +0000 |
branch: emacs-25
commit 1a99bd69ea6eb6772930275d52c414c48db7f977
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Default web pages to right-to-left
* eww.el (eww-mode): Most web pages are left-to-right, so make
that the default (bug#19801).
* shr.el (shr-tag-html): Respect "dir" attributes
(left-to-right, right-to-left).
Backport:
(cherry picked from commit 9e089ec8a380ec3758fcf1564c5f86dc92c68c2a)
---
lisp/net/eww.el | 3 ++-
lisp/net/shr.el | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 5bcb622..7c73d93 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -713,7 +713,8 @@ the like."
(setq-local desktop-save-buffer #'eww-desktop-misc-data)
;; multi-page isearch support
(setq-local multi-isearch-next-buffer-function #'eww-isearch-next-buffer)
- (setq truncate-lines t)
+ (setq truncate-lines t
+ bidi-paragraph-direction 'left-to-right)
(buffer-disable-undo)
(setq buffer-read-only t))
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 9e86ca9..c28e0b8 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1102,6 +1102,15 @@ ones, in case fg and bg are nil."
;;; Tag-specific rendering rules.
+(defun shr-tag-html (dom)
+ (let ((dir (dom-attr dom 'dir)))
+ (cond
+ ((equal dir "ltr")
+ (setq bidi-paragraph-direction 'left-to-right))
+ ((equal dir "rtl")
+ (setq bidi-paragraph-direction 'right-to-left))))
+ (shr-generic dom))
+
(defun shr-tag-body (dom)
(let* ((start (point))
(fgcolor (or (dom-attr dom 'fgcolor) (dom-attr dom 'text)))
- [Emacs-diffs] emacs-25 5bd3a0c 02/12: Add FreeBSD cert bundle, (continued)
- [Emacs-diffs] emacs-25 5bd3a0c 02/12: Add FreeBSD cert bundle, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 6ef896c 01/12: Ignore invalid SVG images, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 90f82ff 03/12: Decode hex-encoded URLs before using them as file names, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 ec2a509 06/12: Use cl-reduce, not reduce., Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 96ac314 05/12: Allow several <tbody> tags in shr, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 eeff251 08/12: Don't store cookies with empty names, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 5b2401d 07/12: Stop rendering HTML before specdlr exhaustion, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 6c12691 11/12: Always save eww history, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 a7143fa 04/12: Make prettier unique file names in eww, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 2d33a9c 09/12: Make toggling checkboxes work again, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 1a99bd6 10/12: Default web pages to right-to-left,
Lars Ingebrigtsen <=
- [Emacs-diffs] emacs-25 e59b2ee 12/12: More eww file name coding fixes, Lars Ingebrigtsen, 2015/12/25