all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Patrick Xarles Hayes <pxhayes@gmail.com>
Cc: 25123@debbugs.gnu.org
Subject: bug#25123: 25.1.50; rx.el errs on character alternatives which include both ?\] and ?-
Date: Wed, 07 Dec 2016 23:23:41 -0500	[thread overview]
Message-ID: <877f7bf3qq.fsf@users.sourceforge.net> (raw)
In-Reply-To: <CABPaSSaCu=ppwv=rb-+okYWpjrhVmySUqx5_A1JT=1GDZwaD8w@mail.gmail.com> (Patrick Xarles Hayes's message of "Tue, 6 Dec 2016 02:11:29 -0500")

[-- Attachment #1: Type: text/plain, Size: 439 bytes --]

found 25123 24.3
tags 25123 patch
quit

Patrick Xarles Hayes <pxhayes@gmail.com> writes:

> The following fails in both Emacs 24.3.1 and 25.1.50.1:
>
> (require 'rx)
> (rx-any '(char (93 . 123) (60 . 91) (45 . 58)))
>
> I rewrote `rx-any' to the following, and it seems to work (though it may
> be introducing new bugs I'm not noticing):
>

There seems to be a lot of changes there, I can't really follow it.
Here's a more minimal patch:


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 876 bytes --]

From ccb763c86dbb58972b49a26d5ffe5cf195a5975a Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Wed, 7 Dec 2016 23:17:37 -0500
Subject: [PATCH v1] Fix rx-any with range with ?\] and ?-

* lisp/emacs-lisp/rx.el: Make sure not to produce a circular list.
---
 lisp/emacs-lisp/rx.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 66d295e..d305597 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -521,7 +521,7 @@ rx-any
 	     (setq args (nconc (delq ?- args) (list ?-))))
 	    ((setq m (assq ?- args))
 	     ;; next to the bracket's range, make the second range
-	     (setcdr args (cons m (delq m args))))))
+	     (setcdr args (cons m (delq m (cdr args)))))))
      ;; bracket in the end range
      ;;	 => "[]...-]"
      ((setq m (rassq ?\] args))
-- 
2.9.3


  reply	other threads:[~2016-12-08  4:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06  7:11 bug#25123: 25.1.50; rx.el errs on character alternatives which include both ?\] and ?- Patrick Xarles Hayes
2016-12-08  4:23 ` npostavs [this message]
2016-12-18 13:49   ` npostavs

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877f7bf3qq.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=25123@debbugs.gnu.org \
    --cc=pxhayes@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.