Subject: bug#64969: 30.0.50: Stipple broken with PGTK

From: [email-masked]
Date: Tue, 01 Aug 2023 11:27:09 +0200

Po Lu <[email-masked]> writes:

> Po Lu <[email-masked]> writes:
>
>> [email-masked] writes:
>>
>>> The code
>>>
>>> (let* ((w (window-font-width))
>>>       (stipple `(,w 1 ,(apply #'unibyte-string
>>> 			       (append (make-list (1- (/ (+ w 7)
>>> 			       8)) ?\0)
>>> 				       '(1))))))
>>>  (insert "\n" (propertize (concat  (make-string 15 ?\s)
>>> 				    "THIS IS A TEST"
>>> 				    (make-string 15 ?\s))
>>>                           'face `(:background "red" 
>>>                           :foreground
>>>                           "blue" :stipple ,stipple))))
>>>
>>> doesn't have the expected result, i.e. the text is not blue on 
>>> red
>>> background.
>>>
>>> More information leading to this report can be found at
>>> https://github.com/jdtsmith/indent-bars/issues/3
>>
>> I think this owes to an inconsistency between the PGTK and X 
>> bitmap
>> initialization code.  I will look into this tomorrow, unless 
>> someone
>> wants to do it first.
>>
>> The relevant functions are `image_create_bitmap_from_data' and
>> `image_create_pattern_from_pixbuf' in image.c.
>
> I think this should now have been fixed on the master branch; 
> the change
> was too involved for Emacs 29.  Please test and ack, thanks.

Yes! That change fixed it.

I verified the above elisp expression (in fundamental mode) both 
in a "bare emacs" (emacs -q) and in my own config. The behaviour 
is now exactly as expected.

It also works well with the indent-bars[1] package.

Thanks so much for the very fast fix.

/M

[1]: https://github.com/jdtsmith/indent-bars

-- 
Magnus Therning                   OpenPGP: 0x927912051716CE39
email: [email-masked]
@[email-masked]       http://magnus.therning.org/

`Ford, you're turning into a penguin. Stop it.'

— Arthur experiences the improbability drive at work.