From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cecilio Pardo Newsgroups: gmane.emacs.bugs Subject: bug#16992: feature request: background images Date: Fri, 8 Nov 2024 17:42:48 +0100 Message-ID: References: <531F9A02.5060504@beloved.name> <9a735b38-6f08-4450-8522-44442bdcc02c@imayhem.com> <86wmhfr35a.fsf@gnu.org> <17673493-4117-47a8-a18b-e49a236f1d00@imayhem.com> <86r07lohj1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16961"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 16992@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 08 17:44:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t9S5v-0004Ie-8b for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Nov 2024 17:44:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9S5d-0006XG-64; Fri, 08 Nov 2024 11:44:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9S5a-0006WX-9z for bug-gnu-emacs@gnu.org; Fri, 08 Nov 2024 11:44:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t9S5a-0006Us-1C for bug-gnu-emacs@gnu.org; Fri, 08 Nov 2024 11:44:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=B8QvbumqNgTpNT+X4wyh03vEzWNBx+yRuK/fsr8Ed2E=; b=ewKipSHOEalwIEvYxt5azPSIYUwJeHQkPUvNvQ9N275zboSkUSPE/x22ounq+wCDpk8oLJobTsv/YvYQV0VsUWJ7FSx6gYcePUkbeGOio5PgQP9+yj2H/UA9mXjCF3ASyJ9DH35bWO139ctCMW/lDsn2wi1j/s+dkEwXToycufj7qZvsb8QGFt8uOq6obajFFGC1N3J0HuZT3fwryRf7IOK3gC3U0xEbPgoQaj/zFaa6uVG6A4wybKDNePTtvTtYqJDAM65yynYF8nfzem/O87BX1SPPNjHPp1JgjjCg4AgWTRhP91RNQYWUKOXagUp6hyskFnr/ZeM7nYfkvAnOUA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t9S5Z-0007Al-SQ for bug-gnu-emacs@gnu.org; Fri, 08 Nov 2024 11:44:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Cecilio Pardo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Nov 2024 16:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16992 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173108418627495 (code B ref -1); Fri, 08 Nov 2024 16:44:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Nov 2024 16:43:06 +0000 Original-Received: from localhost ([127.0.0.1]:51864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9S4f-00079P-Vj for submit@debbugs.gnu.org; Fri, 08 Nov 2024 11:43:06 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9S4d-00079H-Ts for submit@debbugs.gnu.org; Fri, 08 Nov 2024 11:43:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9S4d-00067Y-Nz for bug-gnu-emacs@gnu.org; Fri, 08 Nov 2024 11:43:03 -0500 Original-Received: from mail.imayhem.com ([82.223.54.191] helo=zealous-pike.82-223-54-191.plesk.page) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t9S4a-0006Fs-KU for bug-gnu-emacs@gnu.org; Fri, 08 Nov 2024 11:43:03 -0500 Original-Received: from [192.168.68.102] (111.red-88-21-7.staticip.rima-tde.net [88.21.7.111]) by zealous-pike.82-223-54-191.plesk.page (Postfix) with ESMTPSA id DC7BB800F2 for ; Fri, 8 Nov 2024 16:42:57 +0000 (UTC) Authentication-Results: zealous-pike.82-223-54-191.plesk.page; spf=pass (sender IP is 88.21.7.111) smtp.mailfrom=cpardo@imayhem.com smtp.helo=[192.168.68.102] Received-SPF: pass (zealous-pike.82-223-54-191.plesk.page: connection is authenticated) Content-Language: es-ES In-Reply-To: <86r07lohj1.fsf@gnu.org> Received-SPF: pass client-ip=82.223.54.191; envelope-from=cpardo@imayhem.com; helo=zealous-pike.82-223-54-191.plesk.page X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295080 Archived-At: On 08/11/2024 16:46, Eli Zaretskii wrote: > 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? No, the background image (if present) is drawn first, then 'dynamic' things like the indicator are drawn over, with the corresponding drawing api. We are doing both things. In the patch, the fill-column indicator line is drawn by looking directly at the value of fill_column. But I think it would be better to allow lisp to define multiple vertical lines, with the desired position. >> 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? Yes, I will add x/y offsets, to put it anywhere. >> 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. We can add scrolling images, sure. I think we should do both types then. > Btw, what happens when text is scrolled horizontally? Nothing special. Besides redrawing everything. > 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? Yes. Those are not part of the image. We use the same mechanism to draw on the background, but they are independent. We can use them without background images at all. Some of these things are easy to do, like the fill indicator, which doesn't depend on the contents of the buffer. Indentation lines are much more complex. If you find the mechanism to draw on the background acceptable, I can work on a first version of that. >> +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 Ok, thanks.