From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: rmsbolt.el [Was: Colorful line numbers] Date: Sat, 23 Jul 2022 19:11:31 +0100 Message-ID: <87czdvn1gs.fsf@gmail.com> References: <87leslpow2.fsf@gmail.com> <83ilnpl8e0.fsf@gnu.org> <874jz9peq0.fsf@gmail.com> <837d45l6ge.fsf@gnu.org> <87zgh1nyo6.fsf@gmail.com> <831qudl1k3.fsf@gnu.org> <87v8rpntiv.fsf@gmail.com> <83sfmtjjy8.fsf@gnu.org> <87fsitnpxd.fsf@gmail.com> <83k085jgxr.fsf@gnu.org> <835yjojr0f.fsf@gnu.org> <87pmhwmat0.fsf@gmail.com> <83ilnoi0ro.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2859"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 23 20:11:25 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oFJb1-0000dv-9U for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Jul 2022 20:11:23 +0200 Original-Received: from localhost ([::1]:55864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFJaz-0006Cx-Uk for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Jul 2022 14:11:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFJa0-0005BO-GO for emacs-devel@gnu.org; Sat, 23 Jul 2022 14:10:20 -0400 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:38885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oFJZy-0000N2-RR; Sat, 23 Jul 2022 14:10:20 -0400 Original-Received: by mail-wr1-x42c.google.com with SMTP id k11so10048901wrx.5; Sat, 23 Jul 2022 11:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :user-agent:mime-version:content-transfer-encoding; bh=VUuVpvuh10Hx3YYjhMwMFuN3kyPzLOzgTNQruPNN3Qc=; b=BINyqkVwKMxObekviljUlpW+UC/B8c4D2wR3im3DzAbhMtpTayYydRmboBGZvmpRcJ 1GA0+0G5/e7V8D+QymRiAd4NzWUJVebMNIVfYB5Pga71E5J3t8fG1Oi6kyMHpv5WJiBw H/yJvfj+eZ3xwsyoT3nIXvFFHXepZBnLxHq3fR/QEAoBzVTZmNmB0Vm9tMc3Ja4xdHeY chw7sXlCJAKYJwBJ26inFMKXu/LMgkk/bt/mgE+CWVsRztG57l46ozMhEMpVNStTna1w SLbFTYsGpLxeeIxf+DUBckwhfPn1wM3tG66R69TtQMtiEwG1uvq6GukMtfTzgQL/XyVP mv3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:user-agent:mime-version:content-transfer-encoding; bh=VUuVpvuh10Hx3YYjhMwMFuN3kyPzLOzgTNQruPNN3Qc=; b=djQNulAgytnfU5T1tQbPKEbxI5GXX/6Dbbhsm6EkUB6E2f6/e1PUyB85Q+9gxHBYX2 Z0IhNRy+yHghAz20m9zvoRgfZL+o+Iu5I3JyWP98VesPmCYYSBI9geV47eapRSwNgvH0 1l5B0PnIPM4efjJIv/fW/aPs3NtV0/JefiXEUW+ELsvKT0llsSxH6GL0eW4MRbvhV7eo tWnhxURe/UbVZTUSNhtY3jEvU0S09Tbi3IKe0uFDRPm8g83QUuRr35P+cAmh5w/9HpbP cg9SGlBb5tV/qwgKKNJqejiFIKxZvVdclzdcyWTLUtfAJdC0NstY6Nja5Nq23oPmygzj ovCw== X-Gm-Message-State: AJIora8TLaPGbQMf9oE8UVvjaRGRaJxccw8c9Wv8PxhEY606/1v1/dgi DOFnbSegVvK9o7PlsBnXNAPRLyRibJQ= X-Google-Smtp-Source: AGRyM1tkXS31j9cWs9sFeDRVZmQVWNqre3tmCP/qunRHaVpzKILQXsss03zgmrQjZtJjbOI3JSEARg== X-Received: by 2002:adf:f8ca:0:b0:21e:40f3:4f5c with SMTP id f10-20020adff8ca000000b0021e40f34f5cmr3441384wrq.618.1658599815994; Sat, 23 Jul 2022 11:10:15 -0700 (PDT) Original-Received: from krug ([62.28.191.198]) by smtp.gmail.com with ESMTPSA id b17-20020a5d40d1000000b0021d6dad334bsm7514173wrq.4.2022.07.23.11.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 11:10:15 -0700 (PDT) In-Reply-To: <83ilnoi0ro.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Jul 2022 13:25:31 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=joaotavora@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:292550 Archived-At: Eli Zaretskii writes: >> Looking up the line we're iterating in that hypothetical >> Lisp structure would seem to amount to about the same work as looking >> for a particulr text property in a known place of that same line. > > No, referencing a variable is much faster, because it doesn't involve > finding the correct interval for a buffer position. I don't know details of this data structure you are proposing but if it's somehow a set of mappings between line ranges and faces (as you described it), then you have to somehow traverse it to find, given a particular line number, the correct mapping and the face to use in maybe_produce_line_number(). Just as one would have to lookup a text given for a particular buffer position related to that line. But I'm just speculating: I don't know what algorithm you have in mind. I've understood that having text properties by itself can negatively impact editing even if they don't contribute anything to the display. And maybe updating your data structure could be cheaper, since adding and removing things that aren't newlines doesn't require any update. Then again, updating a Lisp structure is probably slower than updating a optimized internal structure (a tree?) for text properties. So go ahead and do this structure you propose, if you have time and see value in it. Then we'll have something to compare against. Thanks, Jo=C3=A3o