From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Leo Butler Newsgroups: gmane.emacs.help Subject: Re: non word abbrevs Date: Mon, 01 Nov 2021 08:49:34 -0500 Message-ID: <87fssgyoi9.fsf@t14.reltub.ca> References: <2F7AC7B8-48AA-4BF3-B5AA-A4141F248109@traduction-libre.org> <4097001A-F60D-4712-B828-EA778BFCF56E@traduction-libre.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="7407"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: help-gnu-emacs@gnu.org, Stefan Monnier To: Jean-Christophe Helary Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 01 14:55:29 2021 Return-path: Envelope-to: geh-help-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 1mhXmZ-0001f7-P9 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 01 Nov 2021 14:55:27 +0100 Original-Received: from localhost ([::1]:51352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhXmY-00059m-1u for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 01 Nov 2021 09:55:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhXls-00059a-HF for help-gnu-emacs@gnu.org; Mon, 01 Nov 2021 09:54:44 -0400 Original-Received: from mail-to1can01on071f.outbound.protection.outlook.com ([2a01:111:f400:fe5d::71f]:39008 helo=CAN01-TO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhXlp-0006Ar-Ep for help-gnu-emacs@gnu.org; Mon, 01 Nov 2021 09:54:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Suk94WMWeVve1NV6WUo8WJiLKGQXGAa2n/6ieJcA931sVtM/QHweLgixU2cz6hmQ+jsylt+/a4/HpWrzpYqqP3kL94vDNn5W+K5dygIPOoD8kS0OJ9Mgf0q6ZrIe5GFU7k+lO+nHkGJwlDH071xOgbCfosmyEhsc6C56/Rr2qoXLQqdEOqO2u2lr3fV3r5Fkd5VEc2MKf3K7pwhEc+twAKjenk3MpQZ9MTw9q6MzJxBnOrjF9txpEmXr/uXZFrPwHrmWFE3wf5hnPmo6oBIkf3CUCr51p+OIHeegKsSzOkL4U3YHy4vS7BageFYcNnkkD6MFnejfAzjStjfvjpi5Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NUxUlcf1MPZXh+aqaT0aFGzEnk7UfS4o11/2orXzvjg=; b=MPa4W2OIO0nPVMZZwoqD9xrXXz/vX3qkf7qarQaF7JPeDzt0GQM84EKEtLuw05QZkuH1RLINCvkMdA21tLZIr8LzYQqh/YplVZVfYxL4P0DlF86U04TWi4IGKe8EhiQCkAMnIkYh551vq72EiogEwL+H6bLCmm8gxrpQPPTAEB3obuHOC5/gliR58Stzjx2hDoPfLJoKebgKjZ4s1bfgT9fpN6eO2qgCnQH3UzpkOwiU/AMVdwHvxoNnap65P7OlK2IPHz9tsAOHDFE3NAReO1X/KoCG9mxsHEW/ri0j1kPqjFl1lY03Bql9z0/OiqV+K5DAs0m5WlJXX/uyzUlPIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=umanitoba.ca; dmarc=pass action=none header.from=umanitoba.ca; dkim=pass header.d=umanitoba.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umanitoba.onmicrosoft.com; s=selector2-umanitoba-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NUxUlcf1MPZXh+aqaT0aFGzEnk7UfS4o11/2orXzvjg=; b=Yn1248WwL9uIYs/t5UxY6mmw2q3XFeS/i9djYQUSbYS3WkGaFcVhwLlwZEFPHiOq7NPWqa+f9t29qTEYkQy5EhPKH2OPqkpCA1PEZwPmndWHagHedl2Z1MbDhDm+gZ7YmTPG43hc+xGpSemam88WXklrOUtXSiTA4GPjWSa4CcM= Authentication-Results: gnu.org; dkim=none (message not signed) header.d=none;gnu.org; dmarc=none action=none header.from=umanitoba.ca; Original-Received: from YT3PR01MB5590.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:60::14) by YT2PR01MB5606.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:54::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Mon, 1 Nov 2021 13:49:37 +0000 Original-Received: from YT3PR01MB5590.CANPRD01.PROD.OUTLOOK.COM ([fe80::3c76:7853:c444:32e]) by YT3PR01MB5590.CANPRD01.PROD.OUTLOOK.COM ([fe80::3c76:7853:c444:32e%7]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 13:49:37 +0000 In-Reply-To: (Jean-Christophe Helary's message of "Mon, 1 Nov 2021 22:17:28 +0900") X-ClientProxiedBy: MW4PR03CA0119.namprd03.prod.outlook.com (2603:10b6:303:b7::34) To YT3PR01MB5590.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:60::14) Original-Received: from t14 (45.44.33.194) by MW4PR03CA0119.namprd03.prod.outlook.com (2603:10b6:303:b7::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Mon, 1 Nov 2021 13:49:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9ae716c-39d9-4588-39da-08d99d3e71d9 X-MS-TrafficTypeDiagnostic: YT2PR01MB5606: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZNqukyW41kgWsLMnd9mzx8dyONyLYA3VUOIzrd4TEFjMtcBObo8jky8UaILWjFW+ezY4BYULJAYksSYgNyhDuhE1lqmlE6syMUSN0T7TlX6zWQswUSRlaTouQH2W4H7klCpkLJ6UqSrJmWan531arux0FZGryVICnBSXN+lsBYxldpCFYcQIMiJCtE+ZC1xqQquXKF/Cc4NgasmA8yKKCOwWG3iEWlRCnTTYe+iXAqd6wsH48NgRPcf8JZUI1eTP4MknYKInnCeOe1nJDqF05TjkdV3OXMhkP0I8KOfAgR7Kbxjtnoa998lEvNuPwQ5+KrUbXz9XufzGyVbp/YiwE5hbMiCmQO4UFuhqUsiNqdOwtT9qS4bMNT36M/J1eYo+Cy6B4GpWFU8bKXg2eHa6A12NaA9Myasd4BPvM9Oq/zfhO74HCpJPMgCKBVTSMHVLtwB6sEaa2vf1R6El/ygSSPTwO49PQKHOO2rd07eYXfKwU7YtuBk9vCaIo7lmlIwhrTaWF4haxIApZ5KBVwaCAM1vK4ycUMTGM+IHqVDupGQgQo0qkx7BSTxrwb1p32RGW94sDYo9niJs4XwVbJ1qZbePcfQROlgbSuLtvlI5YlALKL6lMAM6nwrw+hI66K+DUNCn58yw4RAe6M8b20L01Y6ltiyClk09aPclIzkE1CRFYTxJTqcP5GKOKrl9MpEt X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YT3PR01MB5590.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(4636009)(366004)(2906002)(38100700002)(6916009)(186003)(53546011)(8676002)(54906003)(26005)(4326008)(6486002)(786003)(316002)(8936002)(83380400001)(38350700002)(9686003)(6496006)(44832011)(86362001)(52116002)(7116003)(66556008)(66476007)(508600001)(5660300002)(956004)(66946007)(3480700007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZFpCMXdZdmRJc1c5MVZGaHhsZFEzYlRpYkhsR3BBLzZsdzg1WFdlem1LcGFv?= =?utf-8?B?SGJDY3pQNk5nSFA2RytXeURqZEVQQm5SdUVTOFZqVDc0SVBCVWZyNE5NR2Za?= =?utf-8?B?S3JKNTcwQ25oK0pFL2p0dldwQVVlSWx3T2lpRmtuNEdKVHp1WWIwS0t2K1pK?= =?utf-8?B?K0tXa0w3NndYZW50TWRGbFNoQTh3MG9PWHNQVDZKQis5MmpXazFQMC8vbmJp?= =?utf-8?B?bmFjdGd6eVM2WjBnV3BMYjh2dlV0cGlONTF6N3BBUDh2QWl0Y29PcnVseWE4?= =?utf-8?B?MjhNSThkbmh1SkUwR0YreHM0SzR0bFQ1MzRwM2Y0VUNGRGU0WkpSL1R5WVpj?= =?utf-8?B?MTl1U1ltN2Y4MGpVK1BrWmdJaVdCZGRuSzEyemFiK3NNdkRISHpWcEJqL2hZ?= =?utf-8?B?TjVZVWVlOFp4WHpnVEMxaFJsTEt0b2hkTFpZdDYzeEJZcVlFaWhPVGl4OWhS?= =?utf-8?B?cFNYN0JlMzlRTThIMGpmWlRVdUpMQld5eUZJQTd4bmdzQzJidHIxcnRKRzJz?= =?utf-8?B?dkJiOWRnZktjWkN4aW9WdkVscTJmcUZ4WWdjbGF2anl3OFBWcUlOc05sWjh3?= =?utf-8?B?UmN4eFdsY1FSbDgyZzhNdGJxWExtRnV4aWxFZUpxbnZWSUkzQWZRcTVaSGhR?= =?utf-8?B?U0xYeDcvS1pYai92MXJQQWt1RmRHR3Z3c2liMF X-OriginatorOrg: umanitoba.ca X-MS-Exchange-CrossTenant-Network-Message-Id: f9ae716c-39d9-4588-39da-08d99d3e71d9 X-MS-Exchange-CrossTenant-AuthSource: YT3PR01MB5590.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 13:49:37.5699 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4f80dd0b-338c-4e4c-8a14-90446962f7b8 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JMlkBFX5nCYDOh9OGFX+Fhrk7f0gorvovi7BBfUXVL84PMcwmLPV6Ufn8BwFe9BLnDLsimuBpLFMRuxC7v8b6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT2PR01MB5606 Received-SPF: pass client-ip=2a01:111:f400:fe5d::71f; envelope-from=Leo.Butler@umanitoba.ca; helo=CAN01-TO1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, MSGID_FROM_MTA_HEADER=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:134292 Archived-At: Jean-Christophe Helary writes: >> On Nov 1, 2021, at 21:43, Stefan Monnier via Users list for the GNU Emac= s text editor wrote: >>=20 >>>>> :regexp "\(?\)") >>>>> I must be missing something. >>>> Hmmm... backslashes? ;-) >>>> The above string is the same as "(?)" (in recentish Emacsen t= he >>>> above backslashes should presumably be highlighted in >>>> a font-lock-warning color for that reason). >>>=20 >>> I'm trying in *scratch* with lisp-mode on a recent "master" and I don't= get that... >>=20 >> I just tried it on my end with both `master` and Emacs-27.1 >>=20 >> emacs -Q >> :regexp "\(?\)") >>=20 >> and the two backslashes got the `font-lock-warning-face` (the strings >> are colored a kind of brick red and the warning is in red so it doesn't >> stand out as much as I'd like but it's visible). > > Ok, I just rebuilt the latest master and emacs -Q shows them... And I am = *not* going to dive into my init.el at this time of the day... > >>> :regexp "\\([<>=3D-]+\\)" >>=20 >> And since Emacs will only use the shortest match, it will only use >> one-char-long matches :-( >>=20 >> Try something like: "[^<>=3D-]\\([<>=3D-]+\\)" >> [ Yes, this shortest match business is a PITA. ] > > My abbrevs are arrows composed of < or > at the tips and - or =3D with a = minimum of 2 characters and a max of 3: > > =E2=86=92 =E2=87=92 > =E2=86=90 =E2=87=90 > =E2=86=94 =E2=87=94 > > In a different world, I'd try [<>=3D-]{2,3} > > Is that what you mean ? Try M-x regexp-builder RET This is a fast way to check your regexps are matching the way you intend. Btw, it might be easier to do something like (regexp-opt '("=3D>" "=3D=3D>") "[^>=3D<]\\(?:") =3D=3D=3D> "[^>=3D<]\\(?:=3D\\(?:=3D?>\\)\\)" Btw, I just checked that regexp with regexp-builder and it matched only 2 strings in this buffer. FWIW, Leo