unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34596: Typo in regex-opt doc string
@ 2019-02-20 22:10 Mattias Engdegård
  2019-02-22  8:12 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Mattias Engdegård @ 2019-02-20 22:10 UTC (permalink / raw)
  To: 34596

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.






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#34596: Typo in regex-opt doc string
  2019-02-20 22:10 bug#34596: Typo in regex-opt doc string Mattias Engdegård
@ 2019-02-22  8:12 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2019-02-22  8:12 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: 34596-done

> From: Mattias Engdegård <mattiase@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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-22  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-20 22:10 bug#34596: Typo in regex-opt doc string Mattias Engdegård
2019-02-22  8:12 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).