From: Zhu Zihao <all_but_last@163.com>
To: 38170@debbugs.gnu.org
Subject: bug#38170: 27.0.50; [PATCH] rx.el: Fix misplaced "char" identifiers.
Date: Mon, 11 Nov 2019 18:24:10 +0800 [thread overview]
Message-ID: <87eeyed839.wl-all_but_last@163.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
New rx implementation introduce some bug:
1. (rx char) throw an error "Unknown rx symbol char"
2. (rx (char ?A ?B)) return a regexp match A or B.
This patch aims to fix this.
[-- Attachment #2: 0001-rx.el-Fix-misplaced-char-identifiers.patch --]
[-- Type: text/plain, Size: 1385 bytes --]
From 1b5d28b8b2bcbf91ad32991d3602de45ef9bef76 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
To: bug-gnu-emacs@gnu.org
Date: Sun, 10 Nov 2019 20:02:44 +0800
Subject: 27.0.50; [PATCH] rx.el: Fix misplaced "char" identifiers.
---
lisp/emacs-lisp/rx.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 52a35ffa2a7..c5f341a7b0a 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -153,7 +153,7 @@ rx--translate-symbol
(pcase sym
;; Use `list' instead of a quoted list to wrap the strings here,
;; since the return value may be mutated.
- ((or 'nonl 'not-newline 'any) (cons (list ".") t))
+ ((or 'nonl 'not-newline 'any 'char) (cons (list ".") t))
((or 'anychar 'anything) (cons (list "[^z-a]") t))
('unmatchable (rx--empty))
((or 'bol 'line-start) (cons (list "^") 'lseq))
@@ -857,7 +857,7 @@ rx--translate-form
(pcase (car form)
((or 'seq : 'and 'sequence) (rx--translate-seq body))
((or 'or '|) (rx--translate-or body))
- ((or 'any 'in 'char) (rx--translate-any nil body))
+ ((or 'any 'in) (rx--translate-any nil body))
('not-char (rx--translate-any t body))
('not (rx--translate-not nil body))
--
2.24.0
next reply other threads:[~2019-11-11 10:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 10:24 Zhu Zihao [this message]
2019-11-11 13:37 ` bug#38170: 27.0.50; [PATCH] rx.el: Fix misplaced "char" identifiers Mattias Engdegård
2019-11-11 13:54 ` Zhu Zihao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eeyed839.wl-all_but_last@163.com \
--to=all_but_last@163.com \
--cc=38170@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).