From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Scan of regexps in Emacs (March 17) Date: Sun, 7 Apr 2019 02:47:32 -0700 Organization: UCLA Computer Science Department Message-ID: <4aa828be-afda-8606-5606-a5478cf9d306@cs.ucla.edu> References: <5363970c-3207-1bb4-8b30-74a7d12277cc@cs.ucla.edu> <05269D79-B016-4FCB-94B8-068BF7D1C2D2@acm.org> <3974269b-6cad-0744-bd1f-66c067f94192@cs.ucla.edu> <4b1164c4-e302-ce41-07c3-145d31a97b4c@cs.ucla.edu> <21CCFA3D-B391-44E1-9ED5-1D37009F1988@acm.org> <09AE372B-3A30-4596-8C4E-B9F4CBF6E348@acm.org> <692fe297-1c72-0cda-8765-c119fd0b5ef6@cs.ucla.edu> <8F82F7FF-8921-4ABF-AA1F-18777104BB2A@acm.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1C61357F5104F46F2813DBAE" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="79516"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Cc: Emacs developers To: =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 07 11:47:54 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hD4P4-000KXe-BY for ged-emacs-devel@m.gmane.org; Sun, 07 Apr 2019 11:47:54 +0200 Original-Received: from localhost ([127.0.0.1]:36621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hD4P3-0003WW-Ck for ged-emacs-devel@m.gmane.org; Sun, 07 Apr 2019 05:47:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hD4Ot-0003WP-SJ for emacs-devel@gnu.org; Sun, 07 Apr 2019 05:47:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hD4Os-0002lB-GQ for emacs-devel@gnu.org; Sun, 07 Apr 2019 05:47:43 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:34342) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hD4Os-0002fs-2D for emacs-devel@gnu.org; Sun, 07 Apr 2019 05:47:42 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EA87C161623; Sun, 7 Apr 2019 02:47:38 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id jt8t6lORIQ1D; Sun, 7 Apr 2019 02:47:37 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9F537161603; Sun, 7 Apr 2019 02:47:37 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qZGUsEz9Qc6r; Sun, 7 Apr 2019 02:47:37 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 72D10161269; Sun, 7 Apr 2019 02:47:37 -0700 (PDT) In-Reply-To: <8F82F7FF-8921-4ABF-AA1F-18777104BB2A@acm.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235064 Archived-At: This is a multi-part message in MIME format. --------------1C61357F5104F46F2813DBAE Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Mattias Engdeg=C3=A5rd wrote: > Some tool improvements uncovered more oddities; log attached. Thanks, I installed the attached to fix the oddities that Michael hadn't = already=20 fixed. --------------1C61357F5104F46F2813DBAE Content-Type: text/x-patch; name="0001-Fix-more-regexp-oddities.patch" Content-Disposition: attachment; filename="0001-Fix-more-regexp-oddities.patch" Content-Transfer-Encoding: quoted-printable >From 659ab82fac9f8f2823b1729e85769627c77f140e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 7 Apr 2019 02:44:37 -0700 Subject: [PATCH] Fix more regexp oddities MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Problems reported by Mattias Engdeg=C3=A5rd in: https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00178.html * lisp/progmodes/sh-script.el (sh-get-indent-info): Reorder skip-chars-forward arg so that it does not look like a regexp. * lisp/progmodes/verilog-mode.el (verilog-sk-define-signal): Fix typo: the string is not a regexp. * lisp/vc/log-edit.el (log-edit-goto-eoh): Fix typo: stray =E2=80=98:=E2=80= =99. * lisp/xml.el (xml-parse-dtd): Avoid =E2=80=98-=E2=80=99 right after char= class. --- lisp/progmodes/sh-script.el | 3 +-- lisp/progmodes/verilog-mode.el | 2 +- lisp/vc/log-edit.el | 2 +- lisp/xml.el | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index dd3a6fa411..853a3500ee 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -2905,8 +2905,7 @@ sh-get-indent-info (setq align-point (point)))) (or (bobp) (forward-char -1)) - ;; FIXME: This charset looks too much like a regexp. --= Stef - (skip-chars-forward "[a-z0-9]*?") + (skip-chars-forward "*0-9?[]a-z") ) ((string-match "[])}]" x) (setq x (sh-safe-forward-sexp -1)) diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode= .el index 7b9c3921fb..916594bdde 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -14263,7 +14263,7 @@ verilog-sk-def-reg (defun verilog-sk-define-signal () "Insert a definition of signal under point at top of module." (interactive "*") - (let* ((sig-re "[a-zA-Z0-9_]*") + (let* ((sig-re "a-zA-Z0-9_") (v1 (buffer-substring (save-excursion (skip-chars-backward sig-re) diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 8bd1bbddb7..42710dd8dc 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -350,7 +350,7 @@ log-edit-match-to-eoh (defun log-edit-goto-eoh () ;FIXME: Almost rfc822-goto-eoh! (goto-char (point-min)) (when (re-search-forward - "^\\([^[:alpha:]]\\|[[:alnum:]-]+[^[:alnum:]-:]\\)" nil 'move) + "^\\([^[:alpha:]]\\|[[:alnum:]-]+[^[:alnum:]-]\\)" nil 'move) (goto-char (match-beginning 0)))) =20 (defun log-edit--match-first-line (limit) diff --git a/lisp/xml.el b/lisp/xml.el index 2337952f06..b5b923f863 100644 --- a/lisp/xml.el +++ b/lisp/xml.el @@ -718,10 +718,10 @@ xml-parse-dtd (cond ((looking-at "PUBLIC\\s-+") (goto-char (match-end 0)) (unless (or (re-search-forward - "\\=3D\"\\([[:space:][:alnum:]-'()+,./:=3D?;!*#@$_%]*\\)\"" + "\\=3D\"\\([[:space:][:alnum:]'()+,./:=3D?;!*#@$_%-]*\\)\"" nil t) (re-search-forward - "\\=3D'\\([[:space:][:alnum:]-()+,./:=3D?;!*#@$_%]*\\)'" + "\\=3D'\\([[:space:][:alnum:]()+,./:=3D?;!*#@$_%-]*\\)'" nil t)) (error "XML: Missing Public ID")) (let ((pubid (match-string-no-properties 1))) --=20 2.17.1 --------------1C61357F5104F46F2813DBAE--