summaryrefslogtreecommitdiff
path: root/lisp/apropos.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-07-30 12:06:25 +0200
committerStefan Kangas <stefan@marxist.se>2022-07-30 12:07:49 +0200
commitcd3ce6e54182a1630b870f13289131cc957eafa6 (patch)
treeff4d9e22ed282e56e91c47ada8a2f364af6e7d71 /lisp/apropos.el
parentf08f5b7afe5da475ebbce700116375757c37521e (diff)
downloademacs-cd3ce6e54182a1630b870f13289131cc957eafa6.tar.gz
* lisp/apropos.el (apropos-documentation): Simplify.
Diffstat (limited to 'lisp/apropos.el')
-rw-r--r--lisp/apropos.el68
1 files changed, 33 insertions, 35 deletions
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 0b84f9fa63b..13dc8fa1391 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -909,41 +909,39 @@ Returns list of symbols and documentation found."
(apropos-parse-pattern pattern t)
(or do-all (setq do-all apropos-do-all))
(setq apropos-accumulator () apropos-files-scanned ())
- (let ((standard-input (get-buffer-create " apropos-temp"))
- (apropos-sort-by-scores apropos-documentation-sort-by-scores)
- f v sf sv)
- (unwind-protect
- (with-current-buffer standard-input
- (apropos-documentation-check-doc-file)
- (if do-all
- (mapatoms
- (lambda (symbol)
- (setq f (apropos-safe-documentation symbol)
- v (get symbol 'variable-documentation))
- (if (integerp v) (setq v nil))
- (setq f (apropos-documentation-internal f)
- v (apropos-documentation-internal v))
- (setq sf (apropos-score-doc f)
- sv (apropos-score-doc v))
- (if (or f v)
- (if (setq apropos-item
- (cdr (assq symbol apropos-accumulator)))
- (progn
- (if f
- (progn
- (setcar (nthcdr 1 apropos-item) f)
- (setcar apropos-item (+ (car apropos-item) sf))))
- (if v
- (progn
- (setcar (nthcdr 2 apropos-item) v)
- (setcar apropos-item (+ (car apropos-item) sv)))))
- (setq apropos-accumulator
- (cons (list symbol
- (+ (apropos-score-symbol symbol 2) sf sv)
- f v)
- apropos-accumulator)))))))
- (apropos-print nil "\n----------------\n" nil t))
- (kill-buffer standard-input))))
+ (with-temp-buffer
+ (let ((standard-input (current-buffer))
+ (apropos-sort-by-scores apropos-documentation-sort-by-scores)
+ f v sf sv)
+ (apropos-documentation-check-doc-file)
+ (if do-all
+ (mapatoms
+ (lambda (symbol)
+ (setq f (apropos-safe-documentation symbol)
+ v (get symbol 'variable-documentation))
+ (if (integerp v) (setq v nil))
+ (setq f (apropos-documentation-internal f)
+ v (apropos-documentation-internal v))
+ (setq sf (apropos-score-doc f)
+ sv (apropos-score-doc v))
+ (if (or f v)
+ (if (setq apropos-item
+ (cdr (assq symbol apropos-accumulator)))
+ (progn
+ (if f
+ (progn
+ (setcar (nthcdr 1 apropos-item) f)
+ (setcar apropos-item (+ (car apropos-item) sf))))
+ (if v
+ (progn
+ (setcar (nthcdr 2 apropos-item) v)
+ (setcar apropos-item (+ (car apropos-item) sv)))))
+ (setq apropos-accumulator
+ (cons (list symbol
+ (+ (apropos-score-symbol symbol 2) sf sv)
+ f v)
+ apropos-accumulator)))))))
+ (apropos-print nil "\n----------------\n" nil t))))
(defun apropos-value-internal (predicate symbol function)