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.devel Subject: Re: rmsbolt.el [Was: Colorful line numbers] Date: Sat, 23 Jul 2022 13:25:31 +0300 Message-ID: <83ilnoi0ro.fsf@gnu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8425"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 23 12:28:29 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 1oFCN2-000252-UN for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Jul 2022 12:28:29 +0200 Original-Received: from localhost ([::1]:42256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFCN1-0004g0-P5 for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Jul 2022 06:28:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFCKN-0002W3-8n for emacs-devel@gnu.org; Sat, 23 Jul 2022 06:25:44 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFCKM-0007Yi-Nq; Sat, 23 Jul 2022 06:25:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=bPH00AhAHSQuyoBBTPkfjI+85lRrwaubo84aSHX+8hc=; b=I823M9qw56pnLUVK8xVG cb4o531yJ28g+6ga/1NdbpEEgdyUDOY6S0+dOZEt9VhWjYFpcDFMRQdEfkKiXND7ioKid35OtyadM IPe0WLyxHRAPRmL6F2/bCQ+wWS/Kkv6173Bs/SkM68+g3rYtrJTHwQ+r1zAy2W9rD7w7A0arXeS/1 Xl+twAT5xe5DrhorBsvKUUDcKhuZeBo9W9QU3k4dBPOOu7HAzB5XGqThtd2/7JUpVB+qmO9/Lg+GJ dx5NxvAy7wSjnkLbR4MtQzRq+W7XGbKCmbgmVo2e2egmN8rAh1LbttSn27i7nTNOT8Uf1HdA+g54O 8mRKljFioKjquQ==; Original-Received: from [87.69.77.57] (port=1856 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 1oFCKD-0002ml-HP; Sat, 23 Jul 2022 06:25:40 -0400 In-Reply-To: <87pmhwmat0.fsf@gmail.com> (message from =?utf-8?B?Sm/Do28g?= =?utf-8?B?VMOhdm9yYQ==?= on Sat, 23 Jul 2022 10:35:07 +0100) 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:292520 Archived-At: > From: João Távora > Cc: emacs-devel@gnu.org > Date: Sat, 23 Jul 2022 10:35:07 +0100 > > Eli Zaretskii writes: > > >> Aaanyway, I think I'm happy with the current implementation that _doesn't_ > >> use line numbers at all. I think this discussion has been productive (to some > >> degree). If I ever need this again (or someone else, like Dmitry), I'll be sure > >> to ping here again. > > > > OK. Let me just say, for the future, that basing this on text > > properties is IMO not the best idea. I think a better idea is to have > > some buffer-local (or window-local) variable whose value is an > > appropriate data structure that specifies faces for ranges of line > > numbers. Of course that value will need to be updated at suitable > > times, which in itself is not a trivial task. > > OK. Since we're in speculation territory, I don't see a big difference > between that and using text properties, which are also a buffer-local > structure. The big difference from my POV is that text properties slow down redisplay code in general, whereas buffer-local variables only slow down (somewhat) the code which examines their values and uses them. > 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.