GNU bug report logs - #34596
Typo in regex-opt doc string

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Wed, 20 Feb 2019 22:12:01 UTC

Severity: minor

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#34596: closed (Typo in regex-opt doc string)
Date: Fri, 22 Feb 2019 08:14:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 22 Feb 2019 10:12:59 +0200
with message-id <83d0nkfdh0.fsf <at> gnu.org>
and subject line Re: bug#34596: Typo in regex-opt doc string
has caused the debbugs.gnu.org bug report #34596,
regarding Typo in regex-opt doc string
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
34596: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34596
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mattias Engdegård <mattiase <at> acm.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Typo in regex-opt doc string
Date: Wed, 20 Feb 2019 23:10:52 +0100
The example code in the regexp-opt doc string doesn't actually work because of a typo:

 (defun simplified-regexp-opt (strings &optional paren)
   (let ((parens
          (cond ((stringp paren)       (cons paren "\\)"))
                ((eq paren 'words)    '("\\<\\(" . "\\)\\>"))
                ((eq paren 'symbols) '("\\_<\\(" . "\\)\\_>"))
                ((null paren)          '("\\(?:" . "\\)"))
                (t                       '("\\(" . "\\)")))))
     (concat (car paren)
             (mapconcat 'regexp-quote strings "\\|")
             (cdr paren))))

`paren' should be `parens'  in the last three lines.



[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 34596-done <at> debbugs.gnu.org
Subject: Re: bug#34596: Typo in regex-opt doc string
Date: Fri, 22 Feb 2019 10:12:59 +0200
> From: Mattias Engdegård <mattiase <at> acm.org>
> Date: Wed, 20 Feb 2019 23:10:52 +0100
> 
>  (defun simplified-regexp-opt (strings &optional paren)
>    (let ((parens
>           (cond ((stringp paren)       (cons paren "\\)"))
>                 ((eq paren 'words)    '("\\<\\(" . "\\)\\>"))
>                 ((eq paren 'symbols) '("\\_<\\(" . "\\)\\_>"))
>                 ((null paren)          '("\\(?:" . "\\)"))
>                 (t                       '("\\(" . "\\)")))))
>      (concat (car paren)
>              (mapconcat 'regexp-quote strings "\\|")
>              (cdr paren))))
> 
> `paren' should be `parens'  in the last three lines.

Thanks, fixed.


This bug report was last modified 6 years and 85 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.