emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master cd3ce6e541 10/10: * lisp/apropos.el (apropos-documentation): Simp


From: Stefan Kangas
Subject: master cd3ce6e541 10/10: * lisp/apropos.el (apropos-documentation): Simplify.
Date: Sat, 30 Jul 2022 06:12:06 -0400 (EDT)

branch: master
commit cd3ce6e54182a1630b870f13289131cc957eafa6
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    * lisp/apropos.el (apropos-documentation): Simplify.
---
 lisp/apropos.el | 68 ++++++++++++++++++++++++++++-----------------------------
 1 file changed, 33 insertions(+), 35 deletions(-)

diff --git a/lisp/apropos.el b/lisp/apropos.el
index 0b84f9fa63..13dc8fa139 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]