diff options
| author | Lars Ingebrigtsen | 2016-02-28 14:52:56 +1030 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-28 14:52:56 +1030 |
| commit | b13cab683c6060e002906fc944680aaa5f4ac123 (patch) | |
| tree | 36a27d1f9781df91eea9fcf9ed0e9d5f64762241 | |
| parent | 4e461281317f4d542af18a701cf2e4c5a3205dd3 (diff) | |
| download | emacs-b13cab683c6060e002906fc944680aaa5f4ac123.tar.gz emacs-b13cab683c6060e002906fc944680aaa5f4ac123.zip | |
Add a eww command to toggle paragraph direction
* lisp/net/eww.el (eww-toggle-paragraph-direction): New
command and keystroke.
* doc/misc/eww.texi (Advanced): Mention the `D' command.
| -rw-r--r-- | doc/misc/eww.texi | 8 | ||||
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/net/eww.el | 13 |
3 files changed, 24 insertions, 1 deletions
diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index 9bc80fbd10d..795556b922b 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi | |||
| @@ -206,6 +206,14 @@ For details about the Cookie handling @xref{Cookies,,,url}. | |||
| 206 | @code{eww-header-line-format}. The format replaces @code{%t} with the | 206 | @code{eww-header-line-format}. The format replaces @code{%t} with the |
| 207 | title of the website and @code{%u} with the URL. | 207 | title of the website and @code{%u} with the URL. |
| 208 | 208 | ||
| 209 | @findex eww-toggle-paragraph-direction | ||
| 210 | @cindex paragraph direction | ||
| 211 | The @kbd{D} command (@code{eww-toggle-paragraph-direction}) toggles | ||
| 212 | the paragraphs direction between left-to-right and right-to-left | ||
| 213 | text. This can be useful on web pages that display right-to-left test | ||
| 214 | (like Arabic and Hebrew), but where the web pages don't explicitly | ||
| 215 | state the directionality. | ||
| 216 | |||
| 209 | @c @vindex shr-bullet | 217 | @c @vindex shr-bullet |
| 210 | @c @vindex shr-hr-line | 218 | @c @vindex shr-hr-line |
| 211 | @c @vindex eww-form-checkbox-selected-symbol | 219 | @c @vindex eww-form-checkbox-selected-symbol |
| @@ -709,6 +709,10 @@ customize the `shr-use-fonts' variable. | |||
| 709 | textual parts of a web page and display only that, leaving menus and | 709 | textual parts of a web page and display only that, leaving menus and |
| 710 | the like off the page. | 710 | the like off the page. |
| 711 | 711 | ||
| 712 | +++ | ||
| 713 | *** A new command `D' (`eww-toggle-paragraph-direction') allows you to | ||
| 714 | toggle the paragraph direction between left-to-right and right-to-left. | ||
| 715 | |||
| 712 | --- | 716 | --- |
| 713 | *** You can now use several eww buffers in parallel by renaming eww | 717 | *** You can now use several eww buffers in parallel by renaming eww |
| 714 | buffers you want to keep separate. | 718 | buffers you want to keep separate. |
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 796eacf274e..886b4b9a503 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -607,6 +607,15 @@ Currently this means either text/html or application/xhtml+xml." | |||
| 607 | (html-mode)))) | 607 | (html-mode)))) |
| 608 | (view-buffer buf))) | 608 | (view-buffer buf))) |
| 609 | 609 | ||
| 610 | (defun eww-toggle-paragraph-direction () | ||
| 611 | "Toggle the paragraphs direction between left-to-right and right-to-left." | ||
| 612 | (interactive) | ||
| 613 | (setq bidi-paragraph-direction | ||
| 614 | (if (eq bidi-paragraph-direction 'left-to-right) | ||
| 615 | 'right-to-left | ||
| 616 | 'left-to-right)) | ||
| 617 | (message "The paragraph direction is now %s" bidi-paragraph-direction)) | ||
| 618 | |||
| 610 | (defun eww-readable () | 619 | (defun eww-readable () |
| 611 | "View the main \"readable\" parts of the current web page. | 620 | "View the main \"readable\" parts of the current web page. |
| 612 | This command uses heuristics to find the parts of the web page that | 621 | This command uses heuristics to find the parts of the web page that |
| @@ -690,6 +699,7 @@ the like." | |||
| 690 | (define-key map "E" 'eww-set-character-encoding) | 699 | (define-key map "E" 'eww-set-character-encoding) |
| 691 | (define-key map "S" 'eww-list-buffers) | 700 | (define-key map "S" 'eww-list-buffers) |
| 692 | (define-key map "F" 'eww-toggle-fonts) | 701 | (define-key map "F" 'eww-toggle-fonts) |
| 702 | (define-key map "D" 'eww-toggle-paragraph-direction) | ||
| 693 | 703 | ||
| 694 | (define-key map "b" 'eww-add-bookmark) | 704 | (define-key map "b" 'eww-add-bookmark) |
| 695 | (define-key map "B" 'eww-list-bookmarks) | 705 | (define-key map "B" 'eww-list-bookmarks) |
| @@ -714,7 +724,8 @@ the like." | |||
| 714 | ["Add bookmark" eww-add-bookmark t] | 724 | ["Add bookmark" eww-add-bookmark t] |
| 715 | ["List bookmarks" eww-list-bookmarks t] | 725 | ["List bookmarks" eww-list-bookmarks t] |
| 716 | ["List cookies" url-cookie-list t] | 726 | ["List cookies" url-cookie-list t] |
| 717 | ["Character Encoding" eww-set-character-encoding])) | 727 | ["Character Encoding" eww-set-character-encoding] |
| 728 | ["Toggle Paragraph Direction" eww-toggle-paragraph-direction])) | ||
| 718 | map)) | 729 | map)) |
| 719 | 730 | ||
| 720 | (defvar eww-tool-bar-map | 731 | (defvar eww-tool-bar-map |