aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-11-10 03:18:51 +0000
committerRichard M. Stallman2005-11-10 03:18:51 +0000
commitfe8bc3fa174dbfaf3420378f24120afa508b470a (patch)
treef9ff65e107c657028ea832b948e596a9259d4996
parent1f0bb3e7fe4a691aaabb77d6a066570e309b3e1e (diff)
downloademacs-fe8bc3fa174dbfaf3420378f24120afa508b470a.tar.gz
emacs-fe8bc3fa174dbfaf3420378f24120afa508b470a.zip
(apropos-pattern): Renamed from apropos-regexp.
(apropos-orig-pattern): Renamed from apropos-orig-regexp. All uses changed. (apropos-rewrite-regexp): Doc fix. (apropos-variable, apropos-command apropos, apropos-value): Change prompt; carry through the argument renaming.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/apropos.el81
2 files changed, 60 insertions, 30 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d081c319ba0..9fa5965093c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12005-11-09 Richard M. Stallman <rms@gnu.org>
2
3 * apropos.el (apropos-pattern): Renamed from apropos-regexp.
4 (apropos-orig-pattern): Renamed from apropos-orig-regexp.
5 All uses changed.
6 (apropos-rewrite-regexp): Doc fix.
7 (apropos-variable, apropos-command, apropos, apropos-value):
8 Change prompt; carry through the argument renaming.
9
12005-11-09 Luc Teirlinck <teirllm@auburn.edu> 102005-11-09 Luc Teirlinck <teirllm@auburn.edu>
2 11
3 * find-lisp.el: Require dired. 12 * find-lisp.el: Require dired.
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 990ad68e5ec..ab2e72d98ce 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -126,10 +126,10 @@ The computed score is shown for each match."
126(defvar apropos-mode-hook nil 126(defvar apropos-mode-hook nil
127 "*Hook run when mode is turned on.") 127 "*Hook run when mode is turned on.")
128 128
129(defvar apropos-regexp nil 129(defvar apropos-pattern nil
130 "Regexp used in current apropos run.") 130 "Regexp used in current apropos run.")
131 131
132(defvar apropos-orig-regexp nil 132(defvar apropos-orig-pattern nil
133 "Regexp as entered by user.") 133 "Regexp as entered by user.")
134 134
135(defvar apropos-all-regexp nil 135(defvar apropos-all-regexp nil
@@ -270,9 +270,10 @@ before finding a label."
270 ""))) 270 "")))
271 271
272(defun apropos-rewrite-regexp (regexp) 272(defun apropos-rewrite-regexp (regexp)
273 "Rewrite a list of words to a regexp matching all permutations. 273 "Rewrite a space-separated words list to a regexp matching all permutations.
274If REGEXP is already a regexp, don't modify it." 274If REGEXP contains any special regexp characters, that means it
275 (setq apropos-orig-regexp regexp) 275is already a regexp, so return it unchanged."
276 (setq apropos-orig-pattern regexp)
276 (setq apropos-words () apropos-all-words ()) 277 (setq apropos-words () apropos-all-words ())
277 (if (string-equal (regexp-quote regexp) regexp) 278 (if (string-equal (regexp-quote regexp) regexp)
278 ;; We don't actually make a regexp matching all permutations. 279 ;; We don't actually make a regexp matching all permutations.
@@ -376,7 +377,7 @@ normal variables."
376 (if (or current-prefix-arg apropos-do-all) 377 (if (or current-prefix-arg apropos-do-all)
377 "variable" 378 "variable"
378 "user option") 379 "user option")
379 " (regexp or words): ")) 380 " (word list or regexp): "))
380 current-prefix-arg)) 381 current-prefix-arg))
381 (apropos-command regexp nil 382 (apropos-command regexp nil
382 (if (or do-all apropos-do-all) 383 (if (or do-all apropos-do-all)
@@ -389,8 +390,13 @@ normal variables."
389;;;###autoload 390;;;###autoload
390(defalias 'command-apropos 'apropos-command) 391(defalias 'command-apropos 'apropos-command)
391;;;###autoload 392;;;###autoload
392(defun apropos-command (apropos-regexp &optional do-all var-predicate) 393(defun apropos-command (apropos-pattern &optional do-all var-predicate)
393 "Show commands (interactively callable functions) that match APROPOS-REGEXP. 394 "Show commands (interactively callable functions) that match APROPOS-PATTERN.
395APROPOS-PATTERN can be a word, a list of words (separated by spaces),
396or a regexp (using some regexp special characters). If it is a word,
397search for matches for that word as a substring. If it is a list of words,
398search for matches for any two (or more) of those words.
399
394With optional prefix DO-ALL, or if `apropos-do-all' is non-nil, also show 400With optional prefix DO-ALL, or if `apropos-do-all' is non-nil, also show
395noninteractive functions. 401noninteractive functions.
396 402
@@ -401,15 +407,15 @@ satisfy the predicate VAR-PREDICATE."
401 (if (or current-prefix-arg 407 (if (or current-prefix-arg
402 apropos-do-all) 408 apropos-do-all)
403 "or function ") 409 "or function ")
404 "(regexp or words): ")) 410 "(word list or regexp): "))
405 current-prefix-arg)) 411 current-prefix-arg))
406 (setq apropos-regexp (apropos-rewrite-regexp apropos-regexp)) 412 (setq apropos-pattern (apropos-rewrite-regexp apropos-pattern))
407 (let ((message 413 (let ((message
408 (let ((standard-output (get-buffer-create "*Apropos*"))) 414 (let ((standard-output (get-buffer-create "*Apropos*")))
409 (print-help-return-message 'identity)))) 415 (print-help-return-message 'identity))))
410 (or do-all (setq do-all apropos-do-all)) 416 (or do-all (setq do-all apropos-do-all))
411 (setq apropos-accumulator 417 (setq apropos-accumulator
412 (apropos-internal apropos-regexp 418 (apropos-internal apropos-pattern
413 (or var-predicate 419 (or var-predicate
414 (if do-all 'functionp 'commandp)))) 420 (if do-all 'functionp 'commandp))))
415 (let ((tem apropos-accumulator)) 421 (let ((tem apropos-accumulator))
@@ -457,15 +463,20 @@ satisfy the predicate VAR-PREDICATE."
457 463
458 464
459;;;###autoload 465;;;###autoload
460(defun apropos (apropos-regexp &optional do-all) 466(defun apropos (apropos-pattern &optional do-all)
461 "Show all bound symbols whose names match APROPOS-REGEXP. 467 "Show all bound symbols whose names match APROPOS-PATTERN.
468APROPOS-PATTERN can be a word, a list of words (separated by spaces),
469or a regexp (using some regexp special characters). If it is a word,
470search for matches for that word as a substring. If it is a list of words,
471search for matches for any two (or more) of those words.
472
462With optional prefix DO-ALL or if `apropos-do-all' is non-nil, also 473With optional prefix DO-ALL or if `apropos-do-all' is non-nil, also
463show unbound symbols and key bindings, which is a little more 474show unbound symbols and key bindings, which is a little more
464time-consuming. Returns list of symbols and documentation found." 475time-consuming. Returns list of symbols and documentation found."
465 (interactive "sApropos symbol (regexp or words): \nP") 476 (interactive "sApropos symbol (word list or regexp): \nP")
466 (setq apropos-regexp (apropos-rewrite-regexp apropos-regexp)) 477 (setq apropos-pattern (apropos-rewrite-regexp apropos-pattern))
467 (apropos-symbols-internal 478 (apropos-symbols-internal
468 (apropos-internal apropos-regexp 479 (apropos-internal apropos-pattern
469 (and (not do-all) 480 (and (not do-all)
470 (not apropos-do-all) 481 (not apropos-do-all)
471 (lambda (symbol) 482 (lambda (symbol)
@@ -520,21 +531,26 @@ time-consuming. Returns list of symbols and documentation found."
520 531
521 532
522;;;###autoload 533;;;###autoload
523(defun apropos-value (apropos-regexp &optional do-all) 534(defun apropos-value (apropos-pattern &optional do-all)
524 "Show all symbols whose value's printed image matches APROPOS-REGEXP. 535 "Show all symbols whose value's printed image matches APROPOS-PATTERN.
536APROPOS-PATTERN can be a word, a list of words (separated by spaces),
537or a regexp (using some regexp special characters). If it is a word,
538search for matches for that word as a substring. If it is a list of words,
539search for matches for any two (or more) of those words.
540
525With optional prefix DO-ALL or if `apropos-do-all' is non-nil, also looks 541With optional prefix DO-ALL or if `apropos-do-all' is non-nil, also looks
526at the function and at the names and values of properties. 542at the function and at the names and values of properties.
527Returns list of symbols and values found." 543Returns list of symbols and values found."
528 (interactive "sApropos value (regexp or words): \nP") 544 (interactive "sApropos value (word list or regexp): \nP")
529 (setq apropos-regexp (apropos-rewrite-regexp apropos-regexp)) 545 (setq apropos-pattern (apropos-rewrite-regexp apropos-pattern))
530 (or do-all (setq do-all apropos-do-all)) 546 (or do-all (setq do-all apropos-do-all))
531 (setq apropos-accumulator ()) 547 (setq apropos-accumulator ())
532 (let (f v p) 548 (let (f v p)
533 (mapatoms 549 (mapatoms
534 (lambda (symbol) 550 (lambda (symbol)
535 (setq f nil v nil p nil) 551 (setq f nil v nil p nil)
536 (or (memq symbol '(apropos-regexp 552 (or (memq symbol '(apropos-pattern
537 apropos-orig-regexp apropos-all-regexp 553 apropos-orig-pattern apropos-all-regexp
538 apropos-words apropos-all-words 554 apropos-words apropos-all-words
539 do-all apropos-accumulator 555 do-all apropos-accumulator
540 symbol f v p)) 556 symbol f v p))
@@ -559,14 +575,19 @@ Returns list of symbols and values found."
559 575
560 576
561;;;###autoload 577;;;###autoload
562(defun apropos-documentation (apropos-regexp &optional do-all) 578(defun apropos-documentation (apropos-pattern &optional do-all)
563 "Show symbols whose documentation contain matches for APROPOS-REGEXP. 579 "Show symbols whose documentation contain matches for APROPOS-PATTERN.
580APROPOS-PATTERN can be a word, a list of words (separated by spaces),
581or a regexp (using some regexp special characters). If it is a word,
582search for matches for that word as a substring. If it is a list of words,
583search for matches for any two (or more) of those words.
584
564With optional prefix DO-ALL or if `apropos-do-all' is non-nil, also use 585With optional prefix DO-ALL or if `apropos-do-all' is non-nil, also use
565documentation that is not stored in the documentation file and show key 586documentation that is not stored in the documentation file and show key
566bindings. 587bindings.
567Returns list of symbols and documentation found." 588Returns list of symbols and documentation found."
568 (interactive "sApropos documentation (regexp or words): \nP") 589 (interactive "sApropos documentation (word list or regexp): \nP")
569 (setq apropos-regexp (apropos-rewrite-regexp apropos-regexp)) 590 (setq apropos-pattern (apropos-rewrite-regexp apropos-pattern))
570 (or do-all (setq do-all apropos-do-all)) 591 (or do-all (setq do-all apropos-do-all))
571 (setq apropos-accumulator () apropos-files-scanned ()) 592 (setq apropos-accumulator () apropos-files-scanned ())
572 (let ((standard-input (get-buffer-create " apropos-temp")) 593 (let ((standard-input (get-buffer-create " apropos-temp"))
@@ -610,7 +631,7 @@ Returns list of symbols and documentation found."
610 (if (funcall predicate symbol) 631 (if (funcall predicate symbol)
611 (progn 632 (progn
612 (setq symbol (prin1-to-string (funcall function symbol))) 633 (setq symbol (prin1-to-string (funcall function symbol)))
613 (if (string-match apropos-regexp symbol) 634 (if (string-match apropos-pattern symbol)
614 (progn 635 (progn
615 (if apropos-match-face 636 (if apropos-match-face
616 (put-text-property (match-beginning 0) (match-end 0) 637 (put-text-property (match-beginning 0) (match-end 0)
@@ -637,7 +658,7 @@ Returns list of symbols and documentation found."
637 (let (p p-out) 658 (let (p p-out)
638 (while pl 659 (while pl
639 (setq p (format "%s %S" (car pl) (nth 1 pl))) 660 (setq p (format "%s %S" (car pl) (nth 1 pl)))
640 (if (or (not compare) (string-match apropos-regexp p)) 661 (if (or (not compare) (string-match apropos-pattern p))
641 (if apropos-property-face 662 (if apropos-property-face
642 (put-text-property 0 (length (symbol-name (car pl))) 663 (put-text-property 0 (length (symbol-name (car pl)))
643 'face apropos-property-face p)) 664 'face apropos-property-face p))
@@ -653,7 +674,7 @@ Returns list of symbols and documentation found."
653 p-out)) 674 p-out))
654 675
655 676
656;; Finds all documentation related to APROPOS-REGEXP in internal-doc-file-name. 677;; Finds all documentation related to APROPOS-PATTERN in internal-doc-file-name.
657 678
658(defun apropos-documentation-check-doc-file () 679(defun apropos-documentation-check-doc-file ()
659 (let (type symbol (sepa 2) sepb beg end) 680 (let (type symbol (sepa 2) sepb beg end)
@@ -782,7 +803,7 @@ alphabetically by symbol name; but this function also sets
782If SPACING is non-nil, it should be a string; separate items with that string. 803If SPACING is non-nil, it should be a string; separate items with that string.
783If non-nil TEXT is a string that will be printed as a heading." 804If non-nil TEXT is a string that will be printed as a heading."
784 (if (null apropos-accumulator) 805 (if (null apropos-accumulator)
785 (message "No apropos matches for `%s'" apropos-orig-regexp) 806 (message "No apropos matches for `%s'" apropos-orig-pattern)
786 (setq apropos-accumulator 807 (setq apropos-accumulator
787 (sort apropos-accumulator 808 (sort apropos-accumulator
788 (lambda (a b) 809 (lambda (a b)