From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#33205: 26.1; unibyte/multibyte missing in rx.el Date: Sat, 29 Dec 2018 11:23:18 +0200 Message-ID: <83efa0660p.fsf@gnu.org> References: <83pnvrjqec.fsf@gnu.org> <160755c702f9b4dfc80be8b5664eb3919804bb84.camel@acm.org> <83wopyi00z.fsf@gnu.org> <83pnvjcvwc.fsf@gnu.org> <834lcsd7qu.fsf@gnu.org> <5203F729-8090-4453-80CC-1249DB064631@acm.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1546075350 12863 195.159.176.226 (29 Dec 2018 09:22:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Dec 2018 09:22:30 +0000 (UTC) Cc: 33205@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 29 10:22:25 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdAp6-0003GR-Lv for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2018 10:22:24 +0100 Original-Received: from localhost ([127.0.0.1]:35509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdArD-0004FF-Je for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2018 04:24:35 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdAqp-0004El-87 for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 04:24:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdAqg-0007jg-UU for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 04:24:11 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38853) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gdAqg-0007jX-Py for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 04:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gdAqg-0007fn-Fa for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 04:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Dec 2018 09:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33205 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33205-submit@debbugs.gnu.org id=B33205.154607543929487 (code B ref 33205); Sat, 29 Dec 2018 09:24:02 +0000 Original-Received: (at 33205) by debbugs.gnu.org; 29 Dec 2018 09:23:59 +0000 Original-Received: from localhost ([127.0.0.1]:40833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdAqd-0007fW-Au for submit@debbugs.gnu.org; Sat, 29 Dec 2018 04:23:59 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52149) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdAqc-0007fK-5J for 33205@debbugs.gnu.org; Sat, 29 Dec 2018 04:23:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdAqH-0007Xg-UP for 33205@debbugs.gnu.org; Sat, 29 Dec 2018 04:23:52 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdAqH-0007XZ-PQ; Sat, 29 Dec 2018 04:23:37 -0500 Original-Received: from [176.228.60.248] (port=3259 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gdAqH-0005ZK-Cs; Sat, 29 Dec 2018 04:23:37 -0500 In-reply-to: <5203F729-8090-4453-80CC-1249DB064631@acm.org> (message from Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= on Mon, 19 Nov 2018 21:07:39 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153979 Archived-At: > From: Mattias EngdegÄrd > Date: Mon, 19 Nov 2018 21:07:39 +0100 > Cc: 33205@debbugs.gnu.org > > Perhaps you want me to open a new bug for the above? I'm attaching a patch all the same, but you may prefer doing it differently. Thanks, I have some comments. First, please provide a ChangeLog-style commit log message describing the changes. See CONTRIBUTE for more details. > + "Turn a string argument to `any' into a list of characters and, representing > +ranges, dotted pairs of characters. The original order is not preserved." The first line of a doc string should be a single full sentence, and it should mention the arguments of the function. Also, the first sentence confused me: what do you mean by this part: "... and, representing ranges, dotted pairs of characters" Finally, please use the US English convention of leaving 2 spaces between sentences in the documentation. > + (let ((decode-char > + ;; Make sure raw bytes are decoded as such, to avoid confusion with > + ;; U+0080..U+00FF. > + (if (multibyte-string-p str) > + #'identity > + (lambda (c) (if (and (>= c #x80) (<= c #xff)) > + (+ c #x3fff00) > + c)))) > + (len (length str)) > + (i 0) > + (ret nil)) > + (while (< i len) > + (cond ((and (< i (- len 2)) > + (= (aref str (+ i 1)) ?-)) > + ;; Range. > + (let ((start (funcall decode-char (aref str i))) > + (end (funcall decode-char (aref str (+ i 2))))) > + (cond ((< start end) (push (cons start end) ret)) > + ((= start end) (push start ret))) > + (setq i (+ i 3)))) > + (t > + ;; Single character. > + (push (funcall decode-char (aref str i)) ret) > + (setq i (+ i 1))))) > + ret)) This seems to have dropped the validity check which signaled an error in the original code? Any reason for that? Thanks.