unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Cecilio Pardo <cpardo@imayhem.com>
Cc: 16992@debbugs.gnu.org
Subject: bug#16992: feature request: background images
Date: Fri, 08 Nov 2024 17:46:10 +0200	[thread overview]
Message-ID: <86r07lohj1.fsf@gnu.org> (raw)
In-Reply-To: <17673493-4117-47a8-a18b-e49a236f1d00@imayhem.com> (message from Cecilio Pardo on Fri, 8 Nov 2024 14:59:20 +0100)

> Date: Fri, 8 Nov 2024 14:59:20 +0100
> Cc: 16992@debbugs.gnu.org
> From: Cecilio Pardo <cpardo@imayhem.com>
> 
> Here is the incomplete patch that implements background images.

Thanks.  I'm not yet sure I understand the overall picture and its
implications, hence the questions below.

> It works by adding a call to complex_bkg_clear_frame_area on all
> functions that clear the background. These are the functions for w32
> port. For the cairo port, they are parallel:
> 
> w32_clear_frame_area, w32_clear_glyph_string_rect,
> w32_draw_stretch_glyph_string, w32font_draw
> 
> I know I'm missing at least w32_draw_image_glyph_string, but works well
> enough for a test.
> 
> To setup the backgroud image for a frame, you would do something like
> this:
> 
> (progn
> (setq bkg (create-image "icons/hicolor/128x128/apps/emacs.png"))
> (frame-set-background-image (selected-frame) bkg 'center nil)
> (frame-set-background-policy (selected-frame) t))

So showing a vertical line for the fill-column indication would need
to define a background image for a frame?  How do we control the
horizontal coordinate where the line is drawn?

> The image can be placed in the center, or on sides or corners with 'n,
> 's, 'se, 'sw, etc. The background can be filled be repeating the image
> passing t as the last parameter of frame-set-background-image.

Why not let Lisp specify explicit coordinates for the image?

> Apart from the obvious overhead of drawing the image pixels,
> unfortunately the frame contents can't be scrolled to reuse text pixels
> (dispnew.c:scrolling_window). I don't think this can't be fixed without
> big changes.

Hmm.. scroll_run_hook is also called from two redisplay optimizations
in xdisp.c, so those will need to be disabled as well.  Too bad.

But maybe we can make them work if we consider the background image to
be scrolled together with the text? "all we need" is to insert a slice
of the same image from below or from above, depending on the scrolling
direction.

Btw, what happens when text is scrolled horizontally?

Is this only going to work with fixed images?  Then I guess features
like showing vertical lines as indentation indicators, like those
here:

  https://techpress.net/how-to-show-hide-indent-dots-in-vscode/

will not be possible?

> +get_all_live_windows (struct window *w, struct window **dest)
> +{
> +  if (WINDOW_LEAF_P (w))
> +    {

You could perhaps extend window_loop to do whatever the callers of
this function do

Thanks for working on this.





  reply	other threads:[~2024-11-08 15:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11 23:19 bug#16992: Feature request David Englund
2014-03-12  6:26 ` Glenn Morris
2020-08-04  9:50   ` Lars Ingebrigtsen
2021-11-05 13:42     ` bug#20647: bug#16992: feature request: background images Stefan Kangas
     [not found]       ` <CALaEO5W3+aEtwPr7bt3zNbkNw386GXpE-vkoRoojS0HqOvDQkQ@mail.gmail.com>
2021-11-15  7:08         ` Stefan Kangas
2021-11-16 11:10           ` tadashi watanabe
2024-11-06 22:34 ` Cecilio Pardo
2024-11-07  1:43   ` Stefan Kangas
2024-11-07  6:46     ` Cecilio Pardo
2024-11-07  6:04   ` Eli Zaretskii
2024-11-08 13:59     ` Cecilio Pardo
2024-11-08 15:46       ` Eli Zaretskii [this message]
2024-11-08 16:42         ` Cecilio Pardo
2024-11-08 18:50           ` Eli Zaretskii
2024-11-08 19:20             ` Cecilio Pardo
2024-11-09  7:44               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86r07lohj1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=16992@debbugs.gnu.org \
    --cc=cpardo@imayhem.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).