@@ -724,22 +724,27 @@ the output includes key-bindings of commands."
724
724
; ; (autoload (push (cdr x) autoloads))
725
725
('require (push (cdr x) requires))
726
726
('provide (push (cdr x) provides))
727
- ('t nil ) ; Skip "was an autoload" entries.
727
+ ('t nil ) ; Skip "was an autoload" entries.
728
728
; ; FIXME: Print information about each individual method: both
729
729
; ; its docstring and specializers (bug#21422).
730
730
('cl-defmethod (push (cadr x) provides))
731
731
(_ (push (or (cdr-safe x) x) symbols))))
732
- (let ((apropos-pattern " " )) ; Dummy binding for apropos-symbols-internal.
733
- (apropos-symbols-internal
734
- symbols apropos-do-all
735
- (concat
736
- (format-message
737
- " Library `%s' provides: %s\n and requires: %s"
738
- file
739
- (mapconcat #'apropos-library-button
740
- (or provides '(nil )) " and " )
741
- (mapconcat #'apropos-library-button
742
- (or requires '(nil )) " and " )))))))
732
+ (let ((apropos-pattern " " ) ; Dummy binding for apropos-symbols-internal.
733
+ (text
734
+ (concat
735
+ (format-message
736
+ " Library `%s' provides: %s\n and requires: %s"
737
+ file
738
+ (mapconcat #'apropos-library-button
739
+ (or provides '(nil )) " and " )
740
+ (mapconcat #'apropos-library-button
741
+ (or requires '(nil )) " and " )))))
742
+ (if (null symbols)
743
+ (with-output-to-temp-buffer " *Apropos*"
744
+ (with-current-buffer standard-output
745
+ (apropos-mode)
746
+ (apropos--preamble text)))
747
+ (apropos-symbols-internal symbols apropos-do-all text)))))
743
748
744
749
(defun apropos-symbols-internal (symbols keys &optional text )
745
750
; ; Filter out entries that are marked as apropos-inhibit.
@@ -1154,10 +1159,7 @@ as a heading."
1154
1159
symbol item)
1155
1160
(set-buffer standard-output)
1156
1161
(apropos-mode)
1157
- (insert (substitute-command-keys " Type \\ [apropos-follow] on " )
1158
- (if apropos-multi-type " a type label" " an entry" )
1159
- " to view its full documentation.\n\n " )
1160
- (if text (insert text " \n\n " ))
1162
+ (apropos--preamble text)
1161
1163
(dolist (apropos-item p)
1162
1164
(when (and spacing (not (bobp )))
1163
1165
(princ spacing))
@@ -1287,6 +1289,14 @@ as a heading."
1287
1289
(fill-region opoint (point ) nil t )))
1288
1290
(or (bolp ) (terpri )))))
1289
1291
1292
+ (defun apropos--preamble (text )
1293
+ (let ((inhibit-read-only t ))
1294
+ (insert (substitute-command-keys " Type \\ [apropos-follow] on " )
1295
+ (if apropos-multi-type " a type label" " an entry" )
1296
+ " to view its full documentation.\n\n " )
1297
+ (when text
1298
+ (insert text " \n\n " ))))
1299
+
1290
1300
(defun apropos-follow ()
1291
1301
" Invokes any button at point, otherwise invokes the nearest label button."
1292
1302
(interactive )
0 commit comments