From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jonas Bernoulli 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: Wed, 22 Nov 2023 23:18:18 +0100 Message-ID: <87a5r5ph3p.fsf@bernoul.li> Reply-To: Jonas Bernoulli Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9270"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joseph Turner , Adam Porter , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: 67390@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 22 23:19:23 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 1r5vZ4-0002Dh-MQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Nov 2023 23:19:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5vYl-0003Mx-Bj; Wed, 22 Nov 2023 17:19:04 -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 1r5vYi-0003Mm-I4 for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 17:19:01 -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 1r5vYg-0007Nr-Pc for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 17:19:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r5vYj-0000a4-TA for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 17:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jonas Bernoulli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Nov 2023 22:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67390 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17006915212197 (code B ref -1); Wed, 22 Nov 2023 22:19:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Nov 2023 22:18:41 +0000 Original-Received: from localhost ([127.0.0.1]:60009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5vYO-0000ZN-U7 for submit@debbugs.gnu.org; Wed, 22 Nov 2023 17:18:41 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:45240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5vYN-0000Z5-50 for submit@debbugs.gnu.org; Wed, 22 Nov 2023 17:18:39 -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 1r5vYD-0003Jf-Uj for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 17:18:30 -0500 Original-Received: from mail.hostpark.net ([212.243.197.30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5vYC-0007KE-23 for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 17:18:29 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id B8BC71622A; Wed, 22 Nov 2023 23:18:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-type:content-type:mime-version:message-id:date:date :subject:subject:from:from; s=sel2011a; t=1700691501; bh=Slz+AOm DONt0AsjcBVEXdB/O+Nm81qMPRQko44/UNzY=; b=u9gvS8OqMOt5tCmxof+Swgu h89K33xox7FR//uNmCCD8TPp75ue/5yH03ZVNOo82a66c0IFDZK1V58j9nPRiyEE uRvMuwutCPbp5SjcHB9Sg89xXG60uueSTYY/HQl+rvDYHiwDWg5/XJAn3CT4DFGg e7YFzW9jPzXLPb0tYN0I= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id G29anzRuvacJ; Wed, 22 Nov 2023 23:18:21 +0100 (CET) Original-Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 39E7F161DD; Wed, 22 Nov 2023 23:18:21 +0100 (CET) Received-SPF: pass client-ip=212.243.197.30; envelope-from=jonas@bernoul.li; helo=mail.hostpark.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: 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:274781 Archived-At: Hello, `shorthands-font-lock-shorthands' assumes that the shorthand uses the same separator as the real symbol name, e.g., "s-" instead of "long-". This causes an additional character to be highlighted when an alternative separator is used, e.g., when using "s/" instead of "long-". `shorthands--mismatch-from-end' returns the length of the common suffix, of the shorthand and the long name. (shorthands--mismatch-from-end "s-tail" "long-tail") => 5 "s-" is highlighted in this case. Since `shorthands-font-lock-shorthands' also wants to highlight the separator, "-" in this case, it corrects this off-by-one, but when different separators are in use, this causes an additional character to be highlighted (shorthands--mismatch-from-end "s/tail" "long-tail") => 4 "s/t" is highlighted in this case. Could we add support for using an alternative separator in shorthands? IMO it is okay to use another separator for *shorthand* prefixes. They won't show up in M-x completion candidates, for example. Shorthands are confined to the file where they are being used, and I think authors should be free to use whatever prefix they fancy. Cheers, Jonas