From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator Date: Sun, 26 Nov 2023 19:48:38 -0800 Message-ID: <878r6jq1gp.fsf@ushin.org> References: <87a5r5ph3p.fsf@bernoul.li> <87msv2vmzf.fsf@bernoul.li> <878r6mzezo.fsf@ushin.org> <87sf4tg6ts.fsf@bernoul.li> <875y1po3nk.fsf@ushin.org> <871qccqmgi.fsf@ushin.org> Reply-To: Joseph Turner 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="38644"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67390@debbugs.gnu.org, Adam Porter , Eli Zaretskii , Jonas Bernoulli To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 27 05:13:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1r7Szm-0009q3-P9 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Nov 2023 05:13:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7SzX-0005Oq-3Y; Sun, 26 Nov 2023 23:13:03 -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 1r7SzT-0005M6-7m for bug-gnu-emacs@gnu.org; Sun, 26 Nov 2023 23:13:00 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r7SzQ-0005ma-JH for bug-gnu-emacs@gnu.org; Sun, 26 Nov 2023 23:12:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r7SzV-0006sp-SA for bug-gnu-emacs@gnu.org; Sun, 26 Nov 2023 23:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Nov 2023 04:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67390 X-GNU-PR-Package: emacs Original-Received: via spool by 67390-submit@debbugs.gnu.org id=B67390.170105834326414 (code B ref 67390); Mon, 27 Nov 2023 04:13:01 +0000 Original-Received: (at 67390) by debbugs.gnu.org; 27 Nov 2023 04:12:23 +0000 Original-Received: from localhost ([127.0.0.1]:43062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7Syt-0006rx-0a for submit@debbugs.gnu.org; Sun, 26 Nov 2023 23:12:23 -0500 Original-Received: from out-189.mta1.migadu.com ([2001:41d0:203:375::bd]:60580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7Syn-0006rj-TQ for 67390@debbugs.gnu.org; Sun, 26 Nov 2023 23:12:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ushin.org; s=key1; t=1701058330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y6moiMXCpl88/MzE4Ed60fIrWAj8z97Nb94tHiGcB5U=; b=n1kdtdxQxJje7GgIXkvO6alwin2Jmbdkce3j/nTWP92Y2jhcnJwB4cNGOWiaxFaIRJMSL0 rM48r9Uwx6kPkw7HGDshZVoOKYg+bNZYiqryXaTemCWPckluNPaXs2nyL3UgwTYbEWDuPC kW0MHB/YpbsKkAp2mEJ3nPe8tjySpEYiDQS6ubXXP//BrtizY143KcU2YaLAuU8Ov6zyzm CKY9HpLZ7xU8uqk+xq5aoENTMrb9+hWZXI41NZgdW6CdmnhnZOFhe1WgfNz4nqDgKIez9k sENKgXr1kNWZ8UHwWB/q9lcwacW4S3VzEYRSPlUSbFw4rgZ8HoaR3gE83EGi2A== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275103 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > In the past, ISTR, Eli suggested to benchmark such things by visiting a > very large file in its beginning, then scrolling down by holding > the down arrow or PgDn for some fixed time period, like 30 seconds. > The Emacs that scrolls the farthest is the most performant. Not > entirely fail-proof (other processes may interfere, etc), but not > bad either. > > So here you could create very large fictitious Elisp file with 0, 1, 3 and > 10 shorthands each and then run your version vs my version and record > the final line numbers. Then show the files and the numbers. In a 2.5M Elisp file with 0 shorthand prefixes, after 30s of pressing C-v (scroll-up-command), point was on line 19238. I then tried the same file with 1 and 4 shorthands, and I got basically the same result: | With 1 shorthand prefix | | |-------------------------+-------| | No patch | 19447 | | mismatch | 19238 | | compare all prefixes | 19024 | | With 4 shorthand prefixes | | |---------------------------+-------| | No patch | 19211 | | mismatch | 19521 | | compare all prefixes | 19339 | There is a big margin of error (probably around 500-1000 lines) since my method wasn't at all exact. I stopped holding C-v when the stopwatch on another device hit 30s, and I might have held for =C2=B11s. If this approach to benchmarking is valid, I think it indicates that shorthands has no significant effect on performance in either case, though there may be a greater difference with more shorthand prefixes. > My version keeps a behaviour that can be considered buggy. > If a shorthand prefix has a common suffix with the longhand prefix > then that suffix will not be highlighted. Like: > ;; Local Variables: > ;; read-symbol-shorthands: (("bcrumb-" . "breadcrumb-") > ;; End: > Here only "b" would be highlighted, effectively showing the user > how much typing was saved. Is this wrong? Does it makes sense > to use shorthands like this? Another example case: ;; Local Variables: ;; read-symbol-shorthands: (("aw-" . "ace-window-") ;; End: Here only "a" would be highlighted. Thanks, Joseph