]> code.delx.au - gnu-emacs/commitdiff
Also allow setting the paragraph direction to nil
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 1 Mar 2016 00:31:37 +0000 (11:31 +1100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 1 Mar 2016 00:31:52 +0000 (11:31 +1100)
* lisp/net/eww.el (eww-toggle-paragraph-direction): Also allow
setting the paragraph direction to nil ("auto").

lisp/net/eww.el

index 886b4b9a503fb848be99fc7ba095229e71ed81fa..620a8a5f9acfb3a6041af7e47b83356e4ea275cd 100644 (file)
@@ -608,13 +608,19 @@ Currently this means either text/html or application/xhtml+xml."
     (view-buffer buf)))
 
 (defun eww-toggle-paragraph-direction ()
-  "Toggle the paragraphs direction between left-to-right and right-to-left."
+  "Cycle the paragraph direction between left-to-right, right-to-left and auto."
   (interactive)
   (setq bidi-paragraph-direction
-        (if (eq bidi-paragraph-direction 'left-to-right)
-            'right-to-left
-          'left-to-right))
-  (message "The paragraph direction is now %s" bidi-paragraph-direction))
+        (cond ((eq bidi-paragraph-direction 'left-to-right)
+               nil)
+              ((eq bidi-paragraph-direction 'right-to-left)
+               'left-to-right)
+              (t
+               'right-to-left)))
+  (message "The paragraph direction is now %s"
+           (if (null bidi-paragraph-direction)
+               "automatic"
+             bidi-paragraph-direction)))
 
 (defun eww-readable ()
   "View the main \"readable\" parts of the current web page.