GNU bug report logs - #21990
htmlfontify fails to generate highly highlighted regions

Previous Next

Package: emacs;

Reported by: Hong Xu <hong <at> topbug.net>

Date: Mon, 23 Nov 2015 07:57:03 UTC

Severity: normal

Tags: fixed

Fixed in version 25.1

Done: Glenn Morris <rgm <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 21990 in the body.
You can then email your comments to 21990 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:
bug#21990; Package emacs. (Mon, 23 Nov 2015 07:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hong Xu <hong <at> topbug.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 23 Nov 2015 07:57:04 GMT) Full text and rfc822 format available.

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

From: Hong Xu <hong <at> topbug.net>
To: bug-gnu-emacs <at> gnu.org
Subject: htmlfontify fails to generate highly highlighted regions
Date: Sun, 22 Nov 2015 20:43:14 -0800
[Message part 1 (text/plain, inline)]
I'm able to reproduce this issue on both the latest snapshot and 24.4.
My OS is GNU/Linux.

To reproduce this issue, follow the following steps:

1. Start emacs with "-q" option in GUI mode and copy the following texts
to emacs and view them in diff mode:

BEGIN================================

diff --git a/gajim.py.orig b/gajim.py
index 57e61e62e8d1..82e36fee351d 100644
--- a/gajim.py.orig
+++ b/gajim.py
@@ -36,12 +36,12 @@
 ##

 import os
-import sys
+xxxxxxxxxxxximport sys
 import warnings

 if os.name == 'nt':
     log_path = os.path.join(os.environ['APPDATA'], 'Gajim')
-    if not os.path.exists(log_path):
+    f not os.path.exists(log_path):
         os.mkdir(log_path, 0o700)
     log_file = os.path.join(log_path, 'gajim.log')
     fout = open(log_file, 'a')
@@ -523,7 +523,7 @@ if __name__ == '__main__':
     check_paths.check_and_possibly_create_paths()

     interface = Interface()
-    interface.run()
+   interface.run()

     try:
         Gtk.main()

END ===================================

2. Press Meta-n multiple times to make sure all changed texts are
highlighted. It should look like the following:

    https://i.imgur.com/xVdQgxk.png

3. M-x htmlfontify-buffer, and save the output html file.

4. Look at it in a browser. The deeply highlighted region (such as the
"xxxxxxxxxx") is not highlighted at all.

My HTML output is attached so you can view it.

[a.patch.html (text/html, attachment)]
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21990; Package emacs. (Fri, 15 Jan 2016 23:52:02 GMT) Full text and rfc822 format available.

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

From: phillip.lord <at> russet.org.uk (Phillip Lord)
To: Hong Xu <hong <at> topbug.net>
Cc: 21990 <at> debbugs.gnu.org
Subject: Re: bug#21990: htmlfontify fails to generate highly highlighted
 regions
Date: Fri, 15 Jan 2016 23:48:30 +0000
Hong Xu <hong <at> topbug.net> writes:

> I'm able to reproduce this issue on both the latest snapshot and 24.4.
> My OS is GNU/Linux.

> 2. Press Meta-n multiple times to make sure all changed texts are
> highlighted. It should look like the following:
>
>     https://i.imgur.com/xVdQgxk.png
>
> 3. M-x htmlfontify-buffer, and save the output html file.
>
> 4. Look at it in a browser. The deeply highlighted region (such as the
> "xxxxxxxxxx") is not highlighted at all.
>

To clarify, you are concerned that, as in your image, "xxxximport" is
highlighted a different colour from "sys", but this is not reflected in
htmlfontify-buffer?

In my hands that line is coming in a single colour. Looking at
buffer-substring, I get....

#("+xxxxxxxxxxxximport sys" 0 1 (fontified t face diff-indicator-added) 1 23 (fontified t face diff-added))


i.e. there is only a single font, after the "+". The equivalent HTML
looks like this....

</span><span class="diff-indicator-added">+</span><span class="diff-added">xxxxxxxxxxxximport sys
</span>

which seems correct to me. I've tried 24.4 and current emacs-25 branch.

Am I looking at the right thing?

Phil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21990; Package emacs. (Sat, 16 Jan 2016 00:25:01 GMT) Full text and rfc822 format available.

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

From: Hong Xu <hong <at> topbug.net>
To: Phillip Lord <phillip.lord <at> russet.org.uk>
Cc: 21990 <at> debbugs.gnu.org
Subject: Re: bug#21990: htmlfontify fails to generate highly highlighted
 regions
Date: Fri, 15 Jan 2016 16:24:24 -0800
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 01/15/2016 03:48 PM, Phillip Lord wrote:
> Hong Xu <hong <at> topbug.net> writes:
> 
>> I'm able to reproduce this issue on both the latest snapshot and
>> 24.4. My OS is GNU/Linux.
> 
>> 2. Press Meta-n multiple times to make sure all changed texts
>> are highlighted. It should look like the following:
>> 
>> https://i.imgur.com/xVdQgxk.png
>> 
>> 3. M-x htmlfontify-buffer, and save the output html file.
>> 
>> 4. Look at it in a browser. The deeply highlighted region (such
>> as the "xxxxxxxxxx") is not highlighted at all.
>> 
> 
> To clarify, you are concerned that, as in your image, "xxxximport"
> is highlighted a different colour from "sys", but this is not
> reflected in htmlfontify-buffer?
> 

Correct.

> In my hands that line is coming in a single colour. Looking at 
> buffer-substring, I get....
> 
> #("+xxxxxxxxxxxximport sys" 0 1 (fontified t face
> diff-indicator-added) 1 23 (fontified t face diff-added))
> 
> 
> i.e. there is only a single font, after the "+". The equivalent
> HTML looks like this....
> 
> </span><span class="diff-indicator-added">+</span><span
> class="diff-added">xxxxxxxxxxxximport sys </span>
> 
> which seems correct to me. I've tried 24.4 and current emacs-25
> branch.
> 
> Am I looking at the right thing?
> 

Thanks for your comments. After opening the patch file, you have move
the cursor to the top of the buffer and run diff-hunk-next (bound to
M-n by default) to show the highlights in Emacs. If you still cannot
see the highlight, you may want to change the theme to the default one
and remove custom color tweaks (I had once used a theme which does not
highlight anything).

Best,
Hong
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWmY24AAoJECZsfTOCL4R4zpMQAKvk7P1SXlnOFnX/R18hPPGJ
qjfopBPVvgqVKUQtCMBkvd4WP/EaEXBItDbTWJX8i2CcVRtFqPW5RrbnJ/6kLvnU
h0jTDO6GMMIa6HY07mjBgMx7ee0e1O9MVmyajumjVWiWbm1gRleT4FvZsKYRACbg
gI5RHqDtL16RBoX1tscwEhOP3LNsAIa0TT8GrJgeRUA/vGLLCmSDHYrzUW10uCjE
fSkn/D9cP+w5RVH8NcCDIqimWKtAIorUM2aSNBztWeK2/z0EWx6N2O51dGaQWohY
GVcn4xEq57LF9l/j/fSzGGfYe+D3ERYapCgG9ZzTHMMIz5+dJwXXlg1+g1DBewNx
AsNPyc+w2GJrDmZjw1i/eE6tdLia5Lt35zndHplyOIvNB02ZqLxTFE+AMwQZVFZD
pojq/cMSVDVmyDtKEdn6FYI5P9Kum1qwyXnpgtQWwwAAHxrW/tk9k8uSObPph7IF
fMxoj1JcMjVjnUTVNPuQTXQTFDkhY4yPfzWG2fd7G3nP3r+Kj62vp4ga5eh+XCE7
nv/CKVdztvSO+yU4dNdSn7iFhbWGD+ywCT+Bxku7AVT+HcJ633PpfzvmMhLPutOb
79Y/n+Zf+kHQzgQWw8nFADAjifU+f0DW7tVmOkTFIgXbmsKb7VcWKGmPNRF4vQn6
BKv1Nau6/lje5VucnhZe
=+MiP
-----END PGP SIGNATURE-----





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21990; Package emacs. (Sun, 17 Jan 2016 06:24:02 GMT) Full text and rfc822 format available.

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

From: Hong Xu <hong <at> topbug.net>
To: 21990 <at> debbugs.gnu.org
Subject: Re: bug#21990: htmlfontify fails to generate highly highlighted
 regions
Date: Sat, 16 Jan 2016 22:23:44 -0800
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

This issue is also possibly caused by bug #18128, which
diff-auto-refine-mode does not put the highlight into the font-lock.

Hong
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWmzNwAAoJECZsfTOCL4R47OIQAIRUCXBQAXyyuJj58q3zOhl+
ttbW/H0jn5dqxMrTeEzu28pQT0XRcUfw1kG6RPxjYdDZzOybfaCyxCl5FMMmmxjZ
PWBYPUKEkqfYX8ZSzXVP/7Vk5W7zWB4qTN3MOPMRiV1W3MUvRzqodjD6iQQcKKpX
qItZUcadjmEzPEzBoZShJM8ZKBEbA23DgRnk6pYn9r4A5fBku43mHoqzLnpV5Xqh
ZodfhRLHOiWvBOy4ccJJqABroNhse0nJ/eV3tlutVw7Gnks0giuzkiwShkKJTgKI
LgvG+cj1a6tknpCxJ+24VUNntShNpTjXD99s2jiFBQ/RsZCYXLJB8aSa8JNTYKaR
kl5o3c7+pamPS466C1F8NDXpPHWgJDH0TOxlGpy1vaUQsQCIi0KgPZHEi2RAfgEM
gNhi/P+eowEiy8XUUJfmO0wFKvXdlbI9KyM/bZ7Vwze2j2CaYqeQneWOEsrJ9YeN
LZ+BTHqFu5TBhJyB+8x4iRHKg/kpoHSmc93gjrIbCial85w898XXMhdnHhBtXs0L
ElIVmSOQ7enVQ7f471hPi+PRpFxj1osGXxaB0DCX84chYc1HdJVykFgosCgHTXSU
n7OCVKWKoGtUQj1d99iN5+RoCCNRr71g9DoE5mUpDobB1LLdQQ94i+rZHJwnAetD
LXicV9SzLNdur8EWcArk
=3RQy
-----END PGP SIGNATURE-----





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21990; Package emacs. (Sun, 17 Jan 2016 22:22:02 GMT) Full text and rfc822 format available.

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

From: phillip.lord <at> russet.org.uk (Phillip Lord)
To: Hong Xu <hong <at> topbug.net>
Cc: 21990 <at> debbugs.gnu.org
Subject: Re: bug#21990: htmlfontify fails to generate highly highlighted
 regions
Date: Sun, 17 Jan 2016 22:21:02 +0000
Hong Xu <hong <at> topbug.net> writes:

> This issue is also possibly caused by bug #18128, which
> diff-auto-refine-mode does not put the highlight into the font-lock.


I don't think it's related to font-lock, as htmlfontify checks both
'face and 'font-lock-face. I think htmlfontify was not dealing correctly
with faces when they overlap. I've pushed a fix to
fix/htmlfontify-21990.

http://lists.gnu.org/archive/html/emacs-diffs/2016-01/msg00277.html

Can you test and confirm? If so, I'll finish the patch and merge.

Phil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21990; Package emacs. (Mon, 18 Jan 2016 08:24:02 GMT) Full text and rfc822 format available.

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

From: Hong Xu <hong <at> topbug.net>
To: Phillip Lord <phillip.lord <at> russet.org.uk>
Cc: 21990 <at> debbugs.gnu.org
Subject: Re: bug#21990: htmlfontify fails to generate highly highlighted
 regions
Date: Mon, 18 Jan 2016 00:22:49 -0800
[Message part 1 (text/plain, inline)]
On 01/17/2016 02:21 PM, Phillip Lord wrote:
> Hong Xu <hong <at> topbug.net> writes:
> 
>> This issue is also possibly caused by bug #18128, which
>> diff-auto-refine-mode does not put the highlight into the font-lock.
> 
> 
> I don't think it's related to font-lock, as htmlfontify checks both
> 'face and 'font-lock-face. I think htmlfontify was not dealing correctly
> with faces when they overlap. I've pushed a fix to
> fix/htmlfontify-21990.
> 
> http://lists.gnu.org/archive/html/emacs-diffs/2016-01/msg00277.html
> 
> Can you test and confirm? If so, I'll finish the patch and merge.
> 

Hi Phillip,

I've tested it---yes now the highlighted regions display differently,
but the highlighting actually is just the same as the background...

I've attached the generated html file, so you can view it.

[a.patch.html (text/html, attachment)]
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21990; Package emacs. (Mon, 18 Jan 2016 17:35:01 GMT) Full text and rfc822 format available.

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

From: phillip.lord <at> russet.org.uk (Phillip Lord)
To: Hong Xu <hong <at> topbug.net>
Cc: 21990 <at> debbugs.gnu.org
Subject: Re: bug#21990: htmlfontify fails to generate highly highlighted
 regions
Date: Mon, 18 Jan 2016 17:31:04 +0000
[Message part 1 (text/plain, inline)]
Hong Xu <hong <at> topbug.net> writes:
> I've tested it---yes now the highlighted regions display differently,
> but the highlighting actually is just the same as the background...
>
> I've attached the generated html file, so you can view it.


Hmmm. Just test the same file at my end, and it seems to work fine (see
attached).

Did you do this with emacs -q?


[temp.patch.html (text/html, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21990; Package emacs. (Tue, 19 Jan 2016 00:05:01 GMT) Full text and rfc822 format available.

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

From: Hong Xu <hong <at> topbug.net>
To: "Phillip Lord" <phillip.lord <at> russet.org.uk>
Cc: "21990 <at> debbugs.gnu.org" <21990 <at> debbugs.gnu.org>
Subject: Re: bug#21990: htmlfontify fails to generate highly highlighted
 regions
Date: Mon, 18 Jan 2016 16:04:03 -0800
[Message part 1 (text/plain, inline)]
Now I can confirm this patch works on 24.5, while 24.4 won't work. Thanks for the fix!




Hong Xu <hong <at> topbug.net> writes:

> I've tested it---yes now the highlighted regions display differently,

> but the highlighting actually is just the same as the background...

>

> I've attached the generated html file, so you can view it.





Hmmm. Just test the same file at my end, and it seems to work fine (see

attached).



Did you do this with emacs -q?
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21990; Package emacs. (Tue, 19 Jan 2016 10:04:02 GMT) Full text and rfc822 format available.

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

From: phillip.lord <at> russet.org.uk (Phillip Lord)
To: Hong Xu <hong <at> topbug.net>
Cc: "21990 <at> debbugs.gnu.org" <21990 <at> debbugs.gnu.org>
Subject: Re: bug#21990: htmlfontify fails to generate highly highlighted
 regions
Date: Tue, 19 Jan 2016 10:03:56 +0000

Okay, I will complete this and commit. Thanks for testing.

Hong Xu <hong <at> topbug.net> writes:

> Now I can confirm this patch works on 24.5, while 24.4 won't work. Thanks for the fix!
>
>
>
>
> Hong Xu <hong <at> topbug.net> writes:
>
>> I've tested it---yes now the highlighted regions display differently,
>
>> but the highlighting actually is just the same as the background...
>
>>
>
>> I've attached the generated html file, so you can view it.
>
>
>
>
>
> Hmmm. Just test the same file at my end, and it seems to work fine (see
>
> attached).
>
>
>
> Did you do this with emacs -q?




Added tag(s) fixed. Request was from phillip.lord <at> russet.org.uk (Phillip Lord) to control <at> debbugs.gnu.org. (Tue, 19 Jan 2016 12:52:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.1, send any further explanations to 21990 <at> debbugs.gnu.org and Hong Xu <hong <at> topbug.net> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 19 Jan 2016 18:32:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 17 Feb 2016 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 121 days ago.

Previous Next


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