mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-16 10:50:49 -08:00
apropos.el (apropos-words-to-regexp): Fix algorithm.
* apropos.el (apropos-words-to-regexp): Fix algorithm. Fixes: debbugs:13946
This commit is contained in:
parent
150622a173
commit
ba874b6430
2 changed files with 19 additions and 10 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
2013-12-18 Shigeru Fukaya <shigeru.fukaya@gmail.com>
|
||||||
|
|
||||||
|
* apropos.el (apropos-words-to-regexp): Fix algorithm (Bug#13946).
|
||||||
|
|
||||||
2013-12-18 Glenn Morris <rgm@gnu.org>
|
2013-12-18 Glenn Morris <rgm@gnu.org>
|
||||||
|
|
||||||
* Makefile.in (BYTE_COMPILE_FLAGS): Set load-prefer-newer to t.
|
* Makefile.in (BYTE_COMPILE_FLAGS): Set load-prefer-newer to t.
|
||||||
|
|
|
||||||
|
|
@ -341,16 +341,21 @@ before finding a label."
|
||||||
|
|
||||||
|
|
||||||
(defun apropos-words-to-regexp (words wild)
|
(defun apropos-words-to-regexp (words wild)
|
||||||
"Make regexp matching any two of the words in WORDS."
|
"Make regexp matching any two of the words in WORDS.
|
||||||
(concat "\\("
|
WILD should be a subexpression matching wildcards between matches."
|
||||||
(mapconcat 'identity words "\\|")
|
(setq words (delete-dups (copy-sequence words)))
|
||||||
"\\)"
|
(if (null (cdr words))
|
||||||
(if (cdr words)
|
(car words)
|
||||||
(concat wild
|
(mapconcat
|
||||||
"\\("
|
(lambda (w)
|
||||||
(mapconcat 'identity words "\\|")
|
(concat "\\(?:" w "\\)" ;; parens for synonyms
|
||||||
"\\)")
|
wild "\\(?:"
|
||||||
"")))
|
(mapconcat 'identity
|
||||||
|
(delq w (copy-sequence words))
|
||||||
|
"\\|")
|
||||||
|
"\\)"))
|
||||||
|
words
|
||||||
|
"\\|")))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun apropos-read-pattern (subject)
|
(defun apropos-read-pattern (subject)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue