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


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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.





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

Previous Next


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