Function: apropos-words-to-regexp

apropos-words-to-regexp is a byte-compiled function defined in apropos.el.gz.

Signature

(apropos-words-to-regexp WORDS WILD)

Documentation

Return a regexp matching any two of the words in WORDS.

WILD should be a subexpression matching wildcards between matches.

Source Code

;; Defined in /usr/src/emacs/lisp/apropos.el.gz
(defun apropos-words-to-regexp (words wild)
  "Return a regexp matching any two of the words in WORDS.
WILD should be a subexpression matching wildcards between matches."
  (setq words (delete-dups (copy-sequence words)))
  (if (null (cdr words))
      (car words)
    (mapconcat
     (lambda (w)
       (concat "\\(?:" w "\\)" ;; parens for synonyms
               wild "\\(?:"
               (mapconcat #'identity
			  (delq w (copy-sequence words))
			  "\\|")
               "\\)"))
     words
     "\\|")))