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: rust-ts-mode: appropriately fontify doc strings Date: Sat, 02 Dec 2023 09:55:43 +0200 Message-ID: <83o7f982dc.fsf@gnu.org> References: <8734wotac6.fsf@poincare.umons.ac.be> <87il5is524.fsf@poincare.umons.ac.be> 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="14442"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Dmitry Gutov , Christophe.TROESTLER@umons.ac.be Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 02 08:56:47 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 1r9Krn-0003Y4-1i for ged-emacs-devel@m.gmane-mx.org; Sat, 02 Dec 2023 08:56:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9Kqp-0003GS-95; Sat, 02 Dec 2023 02:55:47 -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 1r9Kqn-0003GI-HP for emacs-devel@gnu.org; Sat, 02 Dec 2023 02:55:46 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9Kqm-0003i7-Hm; Sat, 02 Dec 2023 02:55:44 -0500 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=i8hRAzz3Fb7NgfXo1OlWcr6Cv22Hjlnfopc585VX1Rc=; b=T5GlBv+7G95gg0t9k7As DdhucFk8Ya5JfIbCWTNpkVc1OxhmL22G7dI0u9R1G3BNVEGewvXwTh2tbYnloJ1HbzbvVy/QoF+vI fOfDhdaOHHk1Fj935mQtni8/AdRQkuAbM93BSsUAZvrMXrN4SPTQrO6OckRZAvtet+b1fFxJZOFua vfy0Cs7Y4mO5J7qD/893TFAXv7iqGIC8voupDZ03Mq0G1dYnD3qEA9k7KrJs8c5b+LkIi9HDAs05Y gBUCywteDXiRgMLJ+sPcGAKsXJ80X+A9e8W3hwZoKxBUxIoZqUo0lmjLN9eT05C0MpvU75/d6kyaW o3q6RyvGL8/wVg==; In-Reply-To: (message from Dmitry Gutov on Sat, 2 Dec 2023 01:58:36 +0200) 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:313461 Archived-At: > Date: Sat, 2 Dec 2023 01:58:36 +0200 > Cc: "emacs-devel@gnu.org" > From: Dmitry Gutov > > 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. This seems to result in ELC progmodes/rust-ts-mode.elc In rust-ts-mode--comment-docstring: progmodes/rust-ts-mode.el:290:61: Warning: Unused lexical argument `end'