From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#997: perl-mode: Incorrect syntax highlighting for regex at top-level Date: Mon, 19 Sep 2022 13:03:08 -0300 Message-ID: <3a9155d8-6af5-d9d3-0d7c-2ea6c9501e0d@gmail.com> References: <871vzhoasd.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------ptefXk2ftqgna6Z0IyLlWVuQ" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22468"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: Harald =?UTF-8?Q?J=C3=B6rg?= , jidanni@jidanni.org To: 997@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 19 18:08:15 2022 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 1oaJJe-0005cm-Pk for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Sep 2022 18:08:14 +0200 Original-Received: from localhost ([::1]:52096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaJJc-0005Jv-8i for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Sep 2022 12:08:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaJFc-00041h-8H for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 12:04:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55886) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaJFa-0002vB-OP for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 12:04:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oaJFa-0004xr-A0 for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 12:04:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <871vzhoasd.fsf@jidanni.org> Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Sep 2022 16:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 997 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 997-submit@debbugs.gnu.org id=B997.166360340119007 (code B ref 997); Mon, 19 Sep 2022 16:04:02 +0000 Original-Received: (at 997) by debbugs.gnu.org; 19 Sep 2022 16:03:21 +0000 Original-Received: from localhost ([127.0.0.1]:54962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaJEu-0004wT-LA for submit@debbugs.gnu.org; Mon, 19 Sep 2022 12:03:21 -0400 Original-Received: from mail-oi1-f169.google.com ([209.85.167.169]:46738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaJEs-0004wA-QE; Mon, 19 Sep 2022 12:03:19 -0400 Original-Received: by mail-oi1-f169.google.com with SMTP id o184so15205762oif.13; Mon, 19 Sep 2022 09:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date; bh=GQM+I+dWaYz+w5pkyOxK+TaVCqmNfflT4bjOBp/7uJU=; b=mIrwa5sWduGoB6Fn95OyVGernjYFfQYcA3R6TCS1LEBNMOjAhHuGvymJjZpad232Rh 8en4POX5c0kUNNKUjefJ2aeWRlrjti3w5B0WwdRKUohHdBqWqKtR/Qaf1YjpDQiR82AI 15Cv+ToJivdm7AUS8FU7TM9D/5BgK9ko6v3YjH8ZYElfZQ+bMzrFhoI+UmadJ2MjK6yJ V0MhNAGf2Q6hppKM2F5C0Cs9MN/sQdp6Wt+qSiWCdzmpX7p2bJE/fh4SJKUVn+8mix9n IQP8Z01xdCR2QbskQy339msJFW111idJxbv5OBfFBhf4E/T1+zefGhGz8LD+yCl1Y5vj XuYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=GQM+I+dWaYz+w5pkyOxK+TaVCqmNfflT4bjOBp/7uJU=; b=L7Co+nhFswu27yBhAcGlZjoJmeCiZFkUtDTo7ahpO2J27yaPzwpeRJfRKynyQjH8PA wS+Ixx52HoaY+WC2rvmFRIjOMKq9XpN1Lh7QgfSOJYrUIQxD8Mjcb0XJlF+MicieL56K A+qu5lw4vNhLMHnfz5PFb16estCGi9MBP3NS5css5OiHSHbo4dBbiAtznX/E91lQ1VCM nP/Emn72X2wrl/qcYCMEhd5O/DMHds+IbE1OxjP4RSUkpEiGtAZvXwW+s6p+Z69L/lUa Agj2cHDgLRGBVJE/53t8KtcBqsKoVajgcN2LJmdsyfnDo9sAdgb+q6ipWZCS/EiOj8op xtwA== X-Gm-Message-State: ACrzQf0Rxreo1aeYaL5Q13xpv5H06dwZH7njZ7Vv9hvd4TifDVPkMblC 03jFANSDtq4kd9M1GocQxhKpq01dw8rWj//5 X-Google-Smtp-Source: AMsMyM7tQLym8I+2cxiQUBWDwWVdUGb2vkdl4h3qJ3RhSjWurumcFWZfebo2Vv1Rl0x/BKOMFq8vyA== X-Received: by 2002:aca:b683:0:b0:350:4823:8741 with SMTP id g125-20020acab683000000b0035048238741mr8526225oif.94.1663603392518; Mon, 19 Sep 2022 09:03:12 -0700 (PDT) Original-Received: from [192.168.0.234] ([181.228.28.240]) by smtp.gmail.com with ESMTPSA id i5-20020a056870c1c500b00118281a1227sm8003769oad.39.2022.09.19.09.03.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 09:03:11 -0700 (PDT) Content-Language: en-US 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" Xref: news.gmane.io gmane.emacs.bugs:243090 Archived-At: This is a multi-part message in MIME format. --------------ptefXk2ftqgna6Z0IyLlWVuQ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit tags 997 patch quit haj@posteo.de (Harald Jörg) writes: > Correctly detecting "nothing" in a regex needs some care.  So I'd like > to treat this as a separate bug which remains open for now. I attach a patch to fix this bug, by detecting that we moved to the beginning of buffer when searching for something before the "/". --------------ptefXk2ftqgna6Z0IyLlWVuQ Content-Type: text/x-patch; charset=UTF-8; name="0001-perl-mode-is-a-regexp-match-if-there-s-nothing-befor.patch" Content-Disposition: attachment; filename*0="0001-perl-mode-is-a-regexp-match-if-there-s-nothing-befor.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBlMzM5MTc2ZjMzOGQ4NjAzYzg2NzFkMjdiM2YxMTZjYTFiOTg4MzY0IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBNYXVybyBBcmFuZGEgPG1hdXJvb2FyYW5kYUBnbWFp bC5jb20+CkRhdGU6IE1vbiwgMTkgU2VwIDIwMjI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