GNU bug report logs - #28454
RTL HTML causes *Article* buffer to be stuck in RTL mode

Previous Next

Packages: emacs, gnus;

Reported by: Tim Landscheidt <tim <at> tim-landscheidt.de>

Date: Thu, 14 Sep 2017 01:42:01 UTC

Severity: normal

Tags: patch

Found in version 5.13

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28454 in the body.
You can then email your comments to 28454 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#28454; Package emacs,gnus. (Thu, 14 Sep 2017 01:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tim Landscheidt <tim <at> tim-landscheidt.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org. (Thu, 14 Sep 2017 01:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tim Landscheidt <tim <at> tim-landscheidt.de>
To: submit <at> debbugs.gnu.org (The Gnus Bugfixing Girls + Boys)
Subject: RTL HTML causes *Article* buffer to be stuck in RTL mode
Date: Thu, 14 Sep 2017 01:40:41 +0000
[Message part 1 (text/plain, inline)]
In Gnus v5.13 (GNU Emacs 25.2.1), if I display HTML mails
that start with (cf. attachment for examplary spam):

| <html dir="rtl" […]

the *Article* buffer switches to RTL mode, i. e. all lines,
including headers, are right-aligned.  If I subsequently
display a plain text mail (or a HTML mail without "dir" at-
tribute), this state remains, i. e. all lines, including
headers, are still right-aligned.

After killing the *Article* buffer, displaying plain text
mails works as usual again.
[277937 (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#28454; Package emacs,gnus. (Thu, 14 Sep 2017 16:46:02 GMT) Full text and rfc822 format available.

Message #8 received at 28454 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tim Landscheidt <tim <at> tim-landscheidt.de>
Cc: 28454 <at> debbugs.gnu.org
Subject: Re: bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL
 mode
Date: Thu, 14 Sep 2017 19:45:34 +0300
> From: Tim Landscheidt <tim <at> tim-landscheidt.de>
> Date: Thu, 14 Sep 2017 01:40:41 +0000
> 
> In Gnus v5.13 (GNU Emacs 25.2.1), if I display HTML mails
> that start with (cf. attachment for examplary spam):
> 
> | <html dir="rtl" […]
> 
> the *Article* buffer switches to RTL mode, i. e. all lines,
> including headers, are right-aligned.  If I subsequently
> display a plain text mail (or a HTML mail without "dir" at-
> tribute), this state remains, i. e. all lines, including
> headers, are still right-aligned.
> 
> After killing the *Article* buffer, displaying plain text
> mails works as usual again.

It sounds like Gnus is reusing the *Article* buffer, in which case it
should reset bidi-paragraph-direction to nil before displaying a new
article.  As a workaround, you can do that manually when the problem
happens.




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#28454; Package emacs,gnus. (Sat, 16 Sep 2017 03:28:01 GMT) Full text and rfc822 format available.

Message #11 received at 28454 <at> debbugs.gnu.org (full text, mbox):

From: Tim Landscheidt <tim <at> tim-landscheidt.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 28454 <at> debbugs.gnu.org
Subject: Re: bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL
 mode
Date: Sat, 16 Sep 2017 03:27:44 +0000
Thanks, Eli.  I've inserted:

| (lambda nil
|   (gnus-with-article-buffer
|     (setq bidi-paragraph-direction nil)))

at the top of gnus-article-decode-hook as a temporary work-
around, and it seems to work.




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#28454; Package emacs,gnus. (Tue, 19 Sep 2017 08:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 28454 <at> debbugs.gnu.org (full text, mbox):

From: Tim Landscheidt <tim <at> tim-landscheidt.de>
To: control <at> debbugs.gnu.org
Cc: 28454 <at> debbugs.gnu.org
Subject: Re: bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL
 mode
Date: Tue, 19 Sep 2017 08:22:50 +0000
[Message part 1 (text/plain, inline)]
tags 28454 + patch
thanks

The attached patch against emacs-25 seems to work for me.
Due to Gnus's undocumentedness, it's a big stab in the dark,
but it resets bidi-paragraph-direction for all test cases in
my inbox :-).
[emacs-gnus-bidi-paragraph-direction.patch (text/x-patch, inline)]
From b4f2640d28769abdd6d6ea7380818ddf986bfb5d Mon Sep 17 00:00:00 2001
From: Tim Landscheidt <tim <at> tim-landscheidt.de>
Date: Sun, 17 Sep 2017 05:20:21 +0000
Subject: [PATCH] Reset bidi-paragraph-direction on article rendering

* lisp/gnus/gnus-art.el: Reset bidi-paragraph-direction on article rendering
(Bug#28454).
---
 lisp/gnus/gnus-art.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 60b6a371..d7c7391 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -7052,6 +7052,7 @@ gnus-request-article-this-buffer
 	(save-excursion
 	  (erase-buffer)
 	  (gnus-kill-all-overlays)
+	  (setq bidi-paragraph-direction nil)
 	  (setq group (or group gnus-newsgroup-name))
 
 	  ;; Using `gnus-request-article' directly will insert the article into
@@ -7159,6 +7160,7 @@ gnus-request-article-this-buffer
 	      (while (not result)
 		(erase-buffer)
 		(gnus-kill-all-overlays)
+		(setq bidi-paragraph-direction nil)
 		(let ((gnus-newsgroup-name group))
 		  (gnus-check-group-server))
 		(cond
-- 
2.9.5


Added tag(s) patch. Request was from Tim Landscheidt <tim <at> tim-landscheidt.de> to control <at> debbugs.gnu.org. (Tue, 19 Sep 2017 08:23:02 GMT) Full text and rfc822 format available.

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 30 Sep 2017 13:43:02 GMT) Full text and rfc822 format available.

Notification sent to Tim Landscheidt <tim <at> tim-landscheidt.de>:
bug acknowledged by developer. (Sat, 30 Sep 2017 13:43:02 GMT) Full text and rfc822 format available.

Message #21 received at 28454-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tim Landscheidt <tim <at> tim-landscheidt.de>
Cc: 28454-done <at> debbugs.gnu.org
Subject: Re: bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL
 mode
Date: Sat, 30 Sep 2017 16:42:34 +0300
> From: Tim Landscheidt <tim <at> tim-landscheidt.de>
> Date: Tue, 19 Sep 2017 08:22:50 +0000
> Cc: 28454 <at> debbugs.gnu.org
> 
> The attached patch against emacs-25 seems to work for me.
> Due to Gnus's undocumentedness, it's a big stab in the dark,
> but it resets bidi-paragraph-direction for all test cases in
> my inbox :-).

Thanks.  As there were no comments, I've now pushed this to the
release branch, and I'm marking this bug done.

> * lisp/gnus/gnus-art.el: Reset bidi-paragraph-direction on article rendering
> (Bug#28454).

Please in the future include the name of the modified function(s) (in
parentheses) in the log message.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 Oct 2017 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.