[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 bbf1ffd: Regexp Functions doc minor fixes
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] emacs-25 bbf1ffd: Regexp Functions doc minor fixes |
Date: |
Tue, 27 Sep 2016 00:01:12 +0000 (UTC) |
branch: emacs-25
commit bbf1ffd7c74bdf3ea766580788f7f4adb98a47f0
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Regexp Functions doc minor fixes
* doc/lispref/searching.texi (Regexp Functions):
Fix misspelling of “matching”. Use @table for table.
Reformat code example to fit into info file width (Bug#17862).
---
doc/lispref/searching.texi | 46 ++++++++++++++++++++++++--------------------
1 file changed, 25 insertions(+), 21 deletions(-)
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index a335e89..579460f 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -950,37 +950,41 @@ more efficient, but is almost never worth the effort.}.
The optional argument @var{paren} can be any of the following:
-a string
- the resulting regexp is preceded by @var{paren} and followed by
- @samp{\)}, e.g. use @samp{"\\(?1:"} to produce an explicitly
- numbered group.
address@hidden @asis
address@hidden a string
+The resulting regexp is preceded by @var{paren} and followed by
address@hidden)}, e.g. use @samp{"\\(?1:"} to produce an explicitly
+numbered group.
address@hidden
- the resulting regexp is surrounded by @samp{\<\(} and @samp{\)\>}.
address@hidden @code{words}
+The resulting regexp is surrounded by @samp{\<\(} and @samp{\)\>}.
address@hidden
- the resulting regexp is surrounded by @samp{\_<\(} and @samp{\)\_>}
- (this is often appropriate when maching programming-language
- keywords and the like).
address@hidden @code{symbols}
+The resulting regexp is surrounded by @samp{\_<\(} and @samp{\)\_>}
+(this is often appropriate when matching programming-language
+keywords and the like).
address@hidden
- the resulting regexp is surrounded by @samp{\(} and @samp{\)}.
address@hidden address@hidden
+The resulting regexp is surrounded by @samp{\(} and @samp{\)}.
address@hidden
- the resulting regexp is surrounded by @samp{\(?:} and @samp{\)},
- if it is necessary to ensure that a postfix operator appended to
- it will apply to the whole expression.
address@hidden @code{nil}
+The resulting regexp is surrounded by @samp{\(?:} and @samp{\)},
+if it is necessary to ensure that a postfix operator appended to
+it will apply to the whole expression.
address@hidden table
The resulting regexp of @code{regexp-opt} is equivalent to but usually
more efficient than that of a simplified version:
@example
(defun simplified-regexp-opt (strings &optional paren)
- (let ((parens (cond ((stringp paren) (cons paren "\\)"))
- ((eq paren 'words) '("\\<\\(" . "\\)\\>"))
- ((eq paren 'symbols) '("\\_<\\(" . "\\)\\_>"))
- ((null paren) '("\\(?:" . "\\)"))
- (t '("\\(" . "\\)")))))
+ (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))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 bbf1ffd: Regexp Functions doc minor fixes,
Paul Eggert <=