From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#47832: 28.0.50; define-fringe-bitmap and emacs --daemon Date: Tue, 25 May 2021 15:56:59 +0300 Message-ID: <835yz7c6p0.fsf@gnu.org> References: <7dee3f4235cf450a3254@heytings.org> <83mttxwgm8.fsf@gnu.org> <1869622e16688e6aedec@heytings.org> <83h7k5w54l.fsf@gnu.org> <83fszpw40t.fsf@gnu.org> <1869622e16c60dc2ce0d@heytings.org> <83eef9w0xd.fsf@gnu.org> <1869622e16270efbc7e8@heytings.org> <87im3778ao.fsf@gnus.org> <83eedvc9jm.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15884"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 47832@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 25 14:58:24 2021 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 1llWdc-0003uX-6Y for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 May 2021 14:58:24 +0200 Original-Received: from localhost ([::1]:53432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llWdb-00020a-9x for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 May 2021 08:58:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llWdG-0001ld-Do for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 08:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33389) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llWdG-0001Wi-5Z for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 08:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1llWdG-0005ec-4L for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 08:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 May 2021 12:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47832 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch Original-Received: via spool by 47832-submit@debbugs.gnu.org id=B47832.162194743021670 (code B ref 47832); Tue, 25 May 2021 12:58:02 +0000 Original-Received: (at 47832) by debbugs.gnu.org; 25 May 2021 12:57:10 +0000 Original-Received: from localhost ([127.0.0.1]:44935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llWcQ-0005dQ-EU for submit@debbugs.gnu.org; Tue, 25 May 2021 08:57:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llWcO-0005d8-UH for 47832@debbugs.gnu.org; Tue, 25 May 2021 08:57:09 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43742) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llWcJ-0000s4-3m; Tue, 25 May 2021 08:57:03 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2284 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llWcI-0003kT-E7; Tue, 25 May 2021 08:57:02 -0400 In-Reply-To: (message from Gregory Heytings on Tue, 25 May 2021 12:44:34 +0000) 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" Xref: news.gmane.io gmane.emacs.bugs:207201 Archived-At: > Date: Tue, 25 May 2021 12:44:34 +0000 > From: Gregory Heytings > cc: Lars Ingebrigtsen , 47832@debbugs.gnu.org > > > >> diff --git a/src/fringe.c b/src/fringe.c > >> index 65c9a84..47615f5 100644 > >> --- a/src/fringe.c > >> +++ b/src/fringe.c > >> @@ -1776,14 +1776,15 @@ gui_init_fringe (struct redisplay_interface *rif) > >> for (bt = NO_FRINGE_BITMAP + 1; bt < MAX_STANDARD_FRINGE_BITMAPS; bt++) > >> { > >> struct fringe_bitmap *fb = &standard_bitmaps[bt]; > >> - rif->define_fringe_bitmap (bt, fb->bits, fb->height, fb->width); > >> + if (!fringe_bitmaps[bt]) > >> + rif->define_fringe_bitmap (bt, fb->bits, fb->height, fb->width); > >> } > >> > >> /* Set up user-defined fringe bitmaps that might have been defined > >> before the frame of this kind was initialized. This can happen > >> if Emacs is started as a daemon and the init files define fringe > >> bitmaps. */ > >> - for ( ; bt < max_used_fringe_bitmap; bt++) > >> + for (bt = NO_FRINGE_BITMAP + 1; bt < max_used_fringe_bitmap; bt++) > >> { > >> struct fringe_bitmap *fb = fringe_bitmaps[bt]; > >> if (fb) > > > > Why does the second for-loop go again over the bitmaps that the first > > one already processed? Or what am I missing? > > > > Each loop processes its "own" bitmaps. In the first loop > define_fringe_bitmap is called only if (!fringe_bitmaps[bt]), in the > second loop it is called only if (fringe_bitmaps[bt]). IOW, the first > loop processes the standard bitmaps that are not overridden by > user-defined bitmaps, and the second loop processes user-defined bitmaps. If the standard bitmaps were overridden by user-defined ones, why do we need to set those overriding user-defined bitmaps once again?