Subject: bug#34596: closed (Re: bug#34596: Typo in regex-opt doc string)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 22 Feb 2019 08:14:02 +0000

Your bug report

#34596: Typo in regex-opt doc string

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
34596: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34596
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#34596: Typo in regex-opt doc string
From: Eli Zaretskii <[email-masked]>
To: Mattias Engdegård <[email-masked]>
Cc: [email-masked]
Date: Fri, 22 Feb 2019 10:12:59 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Mattias Engdegård <[email-masked]>
> 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.

Subject: Typo in regex-opt doc string
From: Mattias Engdegård <[email-masked]>
To: [email-masked]
Date: Wed, 20 Feb 2019 23:10:52 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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.