unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21990: htmlfontify fails to generate highly highlighted regions
@ 2015-11-23  4:43 Hong Xu
  2016-01-15 23:48 ` Phillip Lord
  0 siblings, 1 reply; 9+ messages in thread
From: Hong Xu @ 2015-11-23  4:43 UTC (permalink / raw)
  To: 21990


[-- Attachment #1.1: Type: text/plain, Size: 1442 bytes --]

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.


[-- Attachment #1.2: a.patch.html --]
[-- Type: text/html, Size: 10192 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#21990: htmlfontify fails to generate highly highlighted regions
  2015-11-23  4:43 bug#21990: htmlfontify fails to generate highly highlighted regions Hong Xu
@ 2016-01-15 23:48 ` Phillip Lord
  2016-01-16  0:24   ` Hong Xu
  0 siblings, 1 reply; 9+ messages in thread
From: Phillip Lord @ 2016-01-15 23:48 UTC (permalink / raw)
  To: Hong Xu; +Cc: 21990

Hong Xu <hong@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21990: htmlfontify fails to generate highly highlighted regions
  2016-01-15 23:48 ` Phillip Lord
@ 2016-01-16  0:24   ` Hong Xu
  2016-01-17  6:23     ` Hong Xu
  0 siblings, 1 reply; 9+ messages in thread
From: Hong Xu @ 2016-01-16  0:24 UTC (permalink / raw)
  To: Phillip Lord; +Cc: 21990

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 01/15/2016 03:48 PM, Phillip Lord wrote:
> Hong Xu <hong@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-----






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21990: htmlfontify fails to generate highly highlighted regions
  2016-01-16  0:24   ` Hong Xu
@ 2016-01-17  6:23     ` Hong Xu
  2016-01-17 22:21       ` Phillip Lord
  0 siblings, 1 reply; 9+ messages in thread
From: Hong Xu @ 2016-01-17  6:23 UTC (permalink / raw)
  To: 21990

-----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-----






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21990: htmlfontify fails to generate highly highlighted regions
  2016-01-17  6:23     ` Hong Xu
@ 2016-01-17 22:21       ` Phillip Lord
  2016-01-18  8:22         ` Hong Xu
  0 siblings, 1 reply; 9+ messages in thread
From: Phillip Lord @ 2016-01-17 22:21 UTC (permalink / raw)
  To: Hong Xu; +Cc: 21990

Hong Xu <hong@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21990: htmlfontify fails to generate highly highlighted regions
  2016-01-17 22:21       ` Phillip Lord
@ 2016-01-18  8:22         ` Hong Xu
  2016-01-18 17:31           ` Phillip Lord
  0 siblings, 1 reply; 9+ messages in thread
From: Hong Xu @ 2016-01-18  8:22 UTC (permalink / raw)
  To: Phillip Lord; +Cc: 21990


[-- Attachment #1.1: Type: text/plain, Size: 827 bytes --]

On 01/17/2016 02:21 PM, Phillip Lord wrote:
> Hong Xu <hong@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.


[-- Attachment #1.2: a.patch.html --]
[-- Type: text/html, Size: 11584 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21990: htmlfontify fails to generate highly highlighted regions
  2016-01-18  8:22         ` Hong Xu
@ 2016-01-18 17:31           ` Phillip Lord
  2016-01-19  0:04             ` Hong Xu
  0 siblings, 1 reply; 9+ messages in thread
From: Phillip Lord @ 2016-01-18 17:31 UTC (permalink / raw)
  To: Hong Xu; +Cc: 21990

[-- Attachment #1: Type: text/plain, Size: 358 bytes --]

Hong Xu <hong@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?



[-- Attachment #2: temp.patch.html --]
[-- Type: text/html, Size: 11462 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21990: htmlfontify fails to generate highly highlighted regions
  2016-01-18 17:31           ` Phillip Lord
@ 2016-01-19  0:04             ` Hong Xu
  2016-01-19 10:03               ` Phillip Lord
  0 siblings, 1 reply; 9+ messages in thread
From: Hong Xu @ 2016-01-19  0:04 UTC (permalink / raw)
  To: Phillip Lord; +Cc: 21990@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

Now I can confirm this patch works on 24.5, while 24.4 won't work. Thanks for the fix!




Hong Xu <hong@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?

[-- Attachment #2: Type: text/html, Size: 978 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21990: htmlfontify fails to generate highly highlighted regions
  2016-01-19  0:04             ` Hong Xu
@ 2016-01-19 10:03               ` Phillip Lord
  0 siblings, 0 replies; 9+ messages in thread
From: Phillip Lord @ 2016-01-19 10:03 UTC (permalink / raw)
  To: Hong Xu; +Cc: 21990@debbugs.gnu.org



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

Hong Xu <hong@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@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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-19 10:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-23  4:43 bug#21990: htmlfontify fails to generate highly highlighted regions Hong Xu
2016-01-15 23:48 ` Phillip Lord
2016-01-16  0:24   ` Hong Xu
2016-01-17  6:23     ` Hong Xu
2016-01-17 22:21       ` Phillip Lord
2016-01-18  8:22         ` Hong Xu
2016-01-18 17:31           ` Phillip Lord
2016-01-19  0:04             ` Hong Xu
2016-01-19 10:03               ` Phillip Lord

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).