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: Colorful line numbers Date: Fri, 22 Jul 2022 12:29:59 +0100 Message-ID: <874jz9peq0.fsf@gmail.com> References: <87leslpow2.fsf@gmail.com> <83ilnpl8e0.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="410"; 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 Fri Jul 22 13:31:39 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 1oEqsc-000AXg-Up for ged-emacs-devel@m.gmane-mx.org; Fri, 22 Jul 2022 13:31:38 +0200 Original-Received: from localhost ([::1]:49920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEqsb-00026E-FF for ged-emacs-devel@m.gmane-mx.org; Fri, 22 Jul 2022 07:31:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEqps-0000V0-Uo for emacs-devel@gnu.org; Fri, 22 Jul 2022 07:28:49 -0400 Original-Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:42575) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oEqpq-0006iJ-KQ; Fri, 22 Jul 2022 07:28:48 -0400 Original-Received: by mail-wr1-x42e.google.com with SMTP id bu1so6080109wrb.9; Fri, 22 Jul 2022 04:28:45 -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=oEsKkf9AghjDEm9VyG3zHrbIp+pjXpVBodDg7bzt30U=; b=eFAtwZIcpdU9v3e+TuAixsH5eGGyWBEJHC0j/fXmNMWvcd/dWXFD9PdnndxAectVqR GtbmnGFluaavujm5nhEzpxYLR3JcCzSHdkdi1XxCrTsdPx7Kiv/LsjKXAzrOqwYs/7yr oQ8eUQA5gBFHJed5SKMJEgOw8BrXP5AhWoo52qDOFDzQa5p2bSsqc41azWD4DhXkt+Lv jrxNOQW5z1EgVM5VbM5qb3mibxpvmj2kZbtIQ8RPnUzAxRSSleiyRsJJtMMKdj5Tlk87 yx/FSjx6GquCj75oZKzx925eDwpcHu5x30MV5fbkUeFtYy9b6tnWGJ2yhIaMwEWNj7+f 6unA== 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=oEsKkf9AghjDEm9VyG3zHrbIp+pjXpVBodDg7bzt30U=; b=bIfOne7mzAoH9sTBeUemGF6qrjgiTd/qrcEs6eESxpV1rlRnxOfmPAIVUheiek/dO7 vxqsMQbY/jeGwl4jgIRlsArUhcqsjcHy+IvARpHoVbpWPI+4fCZGmfpw1sW/dfn/xor1 4K0vXUxVKx5YqUhG5oPMbQT9ioRCAVpk8rJuZ+gtX+SQXKvCqv6wMLoqE9FMlOgj/Fcd Aa2XbosC0hav+P4OS9sLhePr0hJ06ui1c82e68RYBtrbfPY+Cyl1RS69MLAvI239w2OI iLtQyqrZQBvdefp/8j6WasKBsOV0nV64lej1WtmmNYout3Uyiq03mQAD0zkobprgClqd qm5A== X-Gm-Message-State: AJIora8EqdMnZkd3Fxjik//23WAS/gbTWO0qPCLvOWIcyyuJHeXp8i4B 7L4znOQeni8izH6vw9ojzGwgALkPwos= X-Google-Smtp-Source: AGRyM1tIUFhe3XBBusoxNYSRp6apYu4YiuvjGNyK6gR4JKJMgALwvh/2GOk0wP7X1g8JH1VEeUd8pQ== X-Received: by 2002:a5d:45c5:0:b0:21e:5755:d443 with SMTP id b5-20020a5d45c5000000b0021e5755d443mr10374wrs.45.1658489323988; Fri, 22 Jul 2022 04:28:43 -0700 (PDT) Original-Received: from krug (87-196-72-209.net.novis.pt. [87.196.72.209]) by smtp.gmail.com with ESMTPSA id t3-20020a1c4603000000b003a2d87aea57sm8576462wma.10.2022.07.22.04.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 04:28:43 -0700 (PDT) In-Reply-To: <83ilnpl8e0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 22 Jul 2022 14:00:23 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=joaotavora@gmail.com; helo=mail-wr1-x42e.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:292418 Archived-At: Eli Zaretskii writes: >> Could we implement one such mechanism? > No. The native line-number display is implemented inside the low > level of the display code, and I don't want to call to Lisp from > there. If nothing else, it will slow down redisplay when line numbers > are used, whereas avoiding that slowdown was an explicit goal of > developing native line-number display. Does checking for a given text property on some buffer text call into Lisp? If it isn't, and it's cheap, then this hypothetical feature could have very low overhead when not used. Even if you're opposed the idea, could you perhaps some pointers on how to implement it, so that I try my hand at it and benchmark the before/after? > Why aren't the existing faces enough?=20=20 I would like to propertize each line number's background with a different color based on assembler information. This would create a visually cue similar to the one used in Matt Godbolt's "Compiler explorer" which works in the browser. There, you have two side-by-side windows of source code, you enter some C code on the left and it starts compiling it immediately. If compilation succeeds, it immediately shows the assembly code on the right. Finally, it colorizes the lines with a unique and dynamically determined, color based on the assembler code that each line produces when the file compiled (according to gcc -g). The reader can visually match these colors in the left and right windeos to see, to some extent, how the compiler proceeded. I've recently discovered Jay Kamat's most excellent rmsbolt.el. It is is even better than godbolt.org in many aspects but is missing this last feature, which I would like to add. But instead of highlighting the whole line, I thought it would be nicer and less distracting if I just highlighted the line number's background. > And if they aren't enough, why cannot you use line-number-mode? I do use line-number-mode, but I don't understand how it can help me here. AFAIK it shows me one line number at a time in the modeline, not besides the text. Jo=C3=A3o