From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: rust-ts-mode: appropriately fontify doc strings Date: Sat, 2 Dec 2023 01:58:36 +0200 Message-ID: References: <8734wotac6.fsf@poincare.umons.ac.be> <87il5is524.fsf@poincare.umons.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7957"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: "emacs-devel@gnu.org" To: Christophe TROESTLER Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 02 00:59:29 2023 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 1r9DPs-0001ry-UF for ged-emacs-devel@m.gmane-mx.org; Sat, 02 Dec 2023 00:59:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9DPF-0002hV-JM; Fri, 01 Dec 2023 18:58:49 -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 1r9DPA-0002gs-NG for emacs-devel@gnu.org; Fri, 01 Dec 2023 18:58:44 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9DP8-0005wh-Vx for emacs-devel@gnu.org; Fri, 01 Dec 2023 18:58:44 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 93C7D5C00DD; Fri, 1 Dec 2023 18:58:39 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 01 Dec 2023 18:58:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1701475119; x=1701561519; bh=APA1FGAWzaUFL8xaBJmhJTvlBUqJL5THXZP 1JKh+LE8=; b=swdMaUP/HuJHgVIU9yfODEUUD7NdOtML2attF893+NO9oemG7C8 UGeNkfmSs8HbZh7XUJXCoL/JQwb0r+XsRiynaEoAzzqDOcyhqRH1XWMKm7QNsMZz hpUlP6byVm4rAcqOoWCIRcjl/C4GHHUs8IJdarvuji79EuGiaG293CdGQqkoay6H amCVYvk9Dek4MxMxgy4HNNVrH/N7HYYQCsdoYLdUYgZvqpnywoGQG+/3RftvbRfX wfQd34f8C63oQjN5DWYFtVTNXb/M9Q3QnwYfC9f6h1YUApLZ/PuS8hQKxsdzVdij vABqBnzEmaxPoVQ982+Nk7b1j3ZdcVZJbnw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701475119; x=1701561519; bh=APA1FGAWzaUFL8xaBJmhJTvlBUqJL5THXZP 1JKh+LE8=; b=Cot/kQgs1114yk0jAJk5xK8Sb1jmDAr/bXgMkuUaweS4NboNpw+ keAFPNrS7KUypA3e20kqJDQEFvJot3ST/YakNh3cauAxKGHFQ6PZqxE59ob47xaR SbnOGu/Uhr9HGPftBW4qR3qJHKLH96FHfH/CJOWmJuPokIOEo4E5LI1ZnsL7klR7 kUVB3MHyKGd7DDOEGeozrzLEA8vyYfFtiCC1waiqKFDD+fUTrkA6XOz2+eq3hmZG pJoK3RQbjAHk824q3hf6jwlyRaVxzhaAPg35zcF4ODryhIbJ0DA8wWkZM3zie+IM Bn1isFZyFI/ECk9PLu2HUBag+KvnUFZjI8g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudejtddgudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Dec 2023 18:58:38 -0500 (EST) Content-Language: en-US In-Reply-To: <87il5is524.fsf@poincare.umons.ac.be> Received-SPF: pass client-ip=66.111.4.28; envelope-from=dmitry@gutov.dev; helo=out4-smtp.messagingengine.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 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, NICE_REPLY_A=-1.534, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:313453 Archived-At: On 01/12/2023 10:25, Christophe TROESTLER wrote: > Hi, > > On 1 December 2023 at 01:50 +01, Dmitry Gutov wrote: >> On 30/11/2023 01:21, Christophe TROESTLER wrote: >>> + (prefix (buffer-substring-no-properties beg (min (+ beg 3) end))) >>> + (face (if (string-equal "///" prefix) >> It'll probably be faster overall to use save-excursion and looking-at >> instead of creating a substring. > Thanks for your feedback. I did dome tests and the two are comparable (on Emacs 29.1) but here is a version that uses your suggestion. Thanks! I'd rather err on the side of this one, even if initial testing shows the approaches are comparable. It's good to have verified that it's not slower, anyway. I've pushed it to emacs-29. In the future, please send patches to the bug tracker, though (then it's easier to ensure they are not lost).