diff options
| author | Kim F. Storm | 2005-11-29 23:52:59 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-11-29 23:52:59 +0000 |
| commit | 3fefda51dd46afa45a3a51c9b3ae2e1b68dd2e48 (patch) | |
| tree | 2b67887c05ff4408f6c8cd2459b9a80bcddcda6a | |
| parent | 80cda39aeb69e90ee52c47e89a4bc6c698cecc43 (diff) | |
| download | emacs-3fefda51dd46afa45a3a51c9b3ae2e1b68dd2e48.tar.gz emacs-3fefda51dd46afa45a3a51c9b3ae2e1b68dd2e48.zip | |
(apropos-parse-pattern): Doc fix.
Set apropos-regexp directly, rather than expecting callers to do so.
(apropos-command, apropos, apropos-value, apropos-documentation):
Simplify calls to apropos-parse-pattern.
| -rw-r--r-- | lisp/apropos.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/apropos.el b/lisp/apropos.el index 5eda7567ef0..4e5109c1efb 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el | |||
| @@ -301,7 +301,9 @@ kind of objects to search." | |||
| 301 | 301 | ||
| 302 | (defun apropos-parse-pattern (pattern) | 302 | (defun apropos-parse-pattern (pattern) |
| 303 | "Rewrite a list of words to a regexp matching all permutations. | 303 | "Rewrite a list of words to a regexp matching all permutations. |
| 304 | If PATTERN is a string, that means it is already a regexp." | 304 | If PATTERN is a string, that means it is already a regexp. |
| 305 | This updates variables `apropos-pattern', `apropos-pattern-quoted', | ||
| 306 | `apropos-regexp', `apropos-words', and `apropos-all-words-regexp'." | ||
| 305 | (setq apropos-words nil | 307 | (setq apropos-words nil |
| 306 | apropos-all-words nil) | 308 | apropos-all-words nil) |
| 307 | (if (consp pattern) | 309 | (if (consp pattern) |
| @@ -325,11 +327,14 @@ If PATTERN is a string, that means it is already a regexp." | |||
| 325 | (setq syn (cdr syn)))) | 327 | (setq syn (cdr syn)))) |
| 326 | (setq apropos-words (cons s apropos-words) | 328 | (setq apropos-words (cons s apropos-words) |
| 327 | apropos-all-words (cons a apropos-all-words)))) | 329 | apropos-all-words (cons a apropos-all-words)))) |
| 328 | (setq apropos-all-words-regexp (apropos-words-to-regexp apropos-all-words ".+")) | 330 | (setq apropos-all-words-regexp |
| 329 | (apropos-words-to-regexp apropos-words ".*?")) | 331 | (apropos-words-to-regexp apropos-all-words ".+")) |
| 332 | (setq apropos-regexp | ||
| 333 | (apropos-words-to-regexp apropos-words ".*?"))) | ||
| 330 | (setq apropos-pattern-quoted (regexp-quote pattern) | 334 | (setq apropos-pattern-quoted (regexp-quote pattern) |
| 331 | apropos-all-words-regexp pattern | 335 | apropos-all-words-regexp pattern |
| 332 | apropos-pattern pattern))) | 336 | apropos-pattern pattern |
| 337 | apropos-regexp pattern))) | ||
| 333 | 338 | ||
| 334 | 339 | ||
| 335 | (defun apropos-calc-scores (str words) | 340 | (defun apropos-calc-scores (str words) |
| @@ -442,7 +447,7 @@ while a list of strings is used as a word list." | |||
| 442 | (if (or current-prefix-arg apropos-do-all) | 447 | (if (or current-prefix-arg apropos-do-all) |
| 443 | "command or function" "command")) | 448 | "command or function" "command")) |
| 444 | current-prefix-arg)) | 449 | current-prefix-arg)) |
| 445 | (setq apropos-regexp (apropos-parse-pattern pattern)) | 450 | (apropos-parse-pattern pattern) |
| 446 | (let ((message | 451 | (let ((message |
| 447 | (let ((standard-output (get-buffer-create "*Apropos*"))) | 452 | (let ((standard-output (get-buffer-create "*Apropos*"))) |
| 448 | (print-help-return-message 'identity)))) | 453 | (print-help-return-message 'identity)))) |
| @@ -508,7 +513,7 @@ show unbound symbols and key bindings, which is a little more | |||
| 508 | time-consuming. Returns list of symbols and documentation found." | 513 | time-consuming. Returns list of symbols and documentation found." |
| 509 | (interactive (list (apropos-read-pattern "symbol") | 514 | (interactive (list (apropos-read-pattern "symbol") |
| 510 | current-prefix-arg)) | 515 | current-prefix-arg)) |
| 511 | (setq apropos-regexp (apropos-parse-pattern pattern)) | 516 | (apropos-parse-pattern pattern) |
| 512 | (apropos-symbols-internal | 517 | (apropos-symbols-internal |
| 513 | (apropos-internal apropos-regexp | 518 | (apropos-internal apropos-regexp |
| 514 | (and (not do-all) | 519 | (and (not do-all) |
| @@ -577,7 +582,7 @@ at the function and at the names and values of properties. | |||
| 577 | Returns list of symbols and values found." | 582 | Returns list of symbols and values found." |
| 578 | (interactive (list (apropos-read-pattern "value") | 583 | (interactive (list (apropos-read-pattern "value") |
| 579 | current-prefix-arg)) | 584 | current-prefix-arg)) |
| 580 | (setq apropos-regexp (apropos-parse-pattern pattern)) | 585 | (apropos-parse-pattern pattern) |
| 581 | (or do-all (setq do-all apropos-do-all)) | 586 | (or do-all (setq do-all apropos-do-all)) |
| 582 | (setq apropos-accumulator ()) | 587 | (setq apropos-accumulator ()) |
| 583 | (let (f v p) | 588 | (let (f v p) |
| @@ -623,7 +628,7 @@ bindings. | |||
| 623 | Returns list of symbols and documentation found." | 628 | Returns list of symbols and documentation found." |
| 624 | (interactive (list (apropos-read-pattern "documentation") | 629 | (interactive (list (apropos-read-pattern "documentation") |
| 625 | current-prefix-arg)) | 630 | current-prefix-arg)) |
| 626 | (setq apropos-regexp (apropos-parse-pattern pattern)) | 631 | (apropos-parse-pattern pattern) |
| 627 | (or do-all (setq do-all apropos-do-all)) | 632 | (or do-all (setq do-all apropos-do-all)) |
| 628 | (setq apropos-accumulator () apropos-files-scanned ()) | 633 | (setq apropos-accumulator () apropos-files-scanned ()) |
| 629 | (let ((standard-input (get-buffer-create " apropos-temp")) | 634 | (let ((standard-input (get-buffer-create " apropos-temp")) |