diff options
| author | Lars Ingebrigtsen | 2015-12-25 07:45:27 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2015-12-25 07:45:27 +0100 |
| commit | 9e089ec8a380ec3758fcf1564c5f86dc92c68c2a (patch) | |
| tree | 2aa06d54563110afdce094f86674f2ce100e1907 | |
| parent | 5e56f606952e5e81b4d3a93ea70e791b74b33041 (diff) | |
| download | emacs-9e089ec8a380ec3758fcf1564c5f86dc92c68c2a.tar.gz emacs-9e089ec8a380ec3758fcf1564c5f86dc92c68c2a.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).
| -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 65ff733726d..620913fecde 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -717,7 +717,8 @@ the like." | |||
| 717 | (setq-local desktop-save-buffer #'eww-desktop-misc-data) | 717 | (setq-local desktop-save-buffer #'eww-desktop-misc-data) |
| 718 | ;; multi-page isearch support | 718 | ;; multi-page isearch support |
| 719 | (setq-local multi-isearch-next-buffer-function #'eww-isearch-next-buffer) | 719 | (setq-local multi-isearch-next-buffer-function #'eww-isearch-next-buffer) |
| 720 | (setq truncate-lines t) | 720 | (setq truncate-lines t |
| 721 | bidi-paragraph-direction 'left-to-right) | ||
| 721 | (buffer-disable-undo) | 722 | (buffer-disable-undo) |
| 722 | (setq buffer-read-only t)) | 723 | (setq buffer-read-only t)) |
| 723 | 724 | ||
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 905c9c5c76d..a7fdf9e1181 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -1109,6 +1109,15 @@ ones, in case fg and bg are nil." | |||
| 1109 | 1109 | ||
| 1110 | ;;; Tag-specific rendering rules. | 1110 | ;;; Tag-specific rendering rules. |
| 1111 | 1111 | ||
| 1112 | (defun shr-tag-html (dom) | ||
| 1113 | (let ((dir (dom-attr dom 'dir))) | ||
| 1114 | (cond | ||
| 1115 | ((equal dir "ltr") | ||
| 1116 | (setq bidi-paragraph-direction 'left-to-right)) | ||
| 1117 | ((equal dir "rtl") | ||
| 1118 | (setq bidi-paragraph-direction 'right-to-left)))) | ||
| 1119 | (shr-generic dom)) | ||
| 1120 | |||
| 1112 | (defun shr-tag-body (dom) | 1121 | (defun shr-tag-body (dom) |
| 1113 | (let* ((start (point)) | 1122 | (let* ((start (point)) |
| 1114 | (fgcolor (or (dom-attr dom 'fgcolor) (dom-attr dom 'text))) | 1123 | (fgcolor (or (dom-attr dom 'fgcolor) (dom-attr dom 'text))) |