--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#34596: Typo in regex-opt doc string |
Date: |
Fri, 22 Feb 2019 10:12:59 +0200 |
> From: Mattias EngdegÄrd <address@hidden>
> 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.
--- End Message ---