diff options
| author | Lars Ingebrigtsen | 2015-12-25 07:45:27 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2015-12-25 17:05:00 +0100 |
| commit | 1a99bd69ea6eb6772930275d52c414c48db7f977 (patch) | |
| tree | c6cd69d6154823bc8c8d61875dc29648fef0a89d | |
| parent | 2d33a9ca0b408806c4b929c001d9b917244f6d22 (diff) | |
| download | emacs-1a99bd69ea6eb6772930275d52c414c48db7f977.tar.gz emacs-1a99bd69ea6eb6772930275d52c414c48db7f977.zip | |
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)
| -rw-r--r-- | lisp/net/eww.el | 3 | ||||
| -rw-r--r-- | 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 5bcb6221cbb..7c73d936568 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -713,7 +713,8 @@ the like." | |||
| 713 | (setq-local desktop-save-buffer #'eww-desktop-misc-data) | 713 | (setq-local desktop-save-buffer #'eww-desktop-misc-data) |
| 714 | ;; multi-page isearch support | 714 | ;; multi-page isearch support |
| 715 | (setq-local multi-isearch-next-buffer-function #'eww-isearch-next-buffer) | 715 | (setq-local multi-isearch-next-buffer-function #'eww-isearch-next-buffer) |
| 716 | (setq truncate-lines t) | 716 | (setq truncate-lines t |
| 717 | bidi-paragraph-direction 'left-to-right) | ||
| 717 | (buffer-disable-undo) | 718 | (buffer-disable-undo) |
| 718 | (setq buffer-read-only t)) | 719 | (setq buffer-read-only t)) |
| 719 | 720 | ||
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 9e86ca9e0f9..c28e0b8899c 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -1102,6 +1102,15 @@ ones, in case fg and bg are nil." | |||
| 1102 | 1102 | ||
| 1103 | ;;; Tag-specific rendering rules. | 1103 | ;;; Tag-specific rendering rules. |
| 1104 | 1104 | ||
| 1105 | (defun shr-tag-html (dom) | ||
| 1106 | (let ((dir (dom-attr dom 'dir))) | ||
| 1107 | (cond | ||
| 1108 | ((equal dir "ltr") | ||
| 1109 | (setq bidi-paragraph-direction 'left-to-right)) | ||
| 1110 | ((equal dir "rtl") | ||
| 1111 | (setq bidi-paragraph-direction 'right-to-left)))) | ||
| 1112 | (shr-generic dom)) | ||
| 1113 | |||
| 1105 | (defun shr-tag-body (dom) | 1114 | (defun shr-tag-body (dom) |
| 1106 | (let* ((start (point)) | 1115 | (let* ((start (point)) |
| 1107 | (fgcolor (or (dom-attr dom 'fgcolor) (dom-attr dom 'text))) | 1116 | (fgcolor (or (dom-attr dom 'fgcolor) (dom-attr dom 'text))) |