;; (autoload (push (cdr x) autoloads))
('require (push (cdr x) requires))
('provide (push (cdr x) provides))
- ('t nil) ; Skip "was an autoload" entries.
+ ('t nil) ; Skip "was an autoload" entries.
;; FIXME: Print information about each individual method: both
;; its docstring and specializers (bug#21422).
('cl-defmethod (push (cadr x) provides))
(_ (push (or (cdr-safe x) x) symbols))))
- (let ((apropos-pattern "")) ;Dummy binding for apropos-symbols-internal.
- (apropos-symbols-internal
- symbols apropos-do-all
- (concat
- (format-message
- "Library `%s' provides: %s\nand requires: %s"
- file
- (mapconcat #'apropos-library-button
- (or provides '(nil)) " and ")
- (mapconcat #'apropos-library-button
- (or requires '(nil)) " and ")))))))
+ (let ((apropos-pattern "") ;Dummy binding for apropos-symbols-internal.
+ (text
+ (concat
+ (format-message
+ "Library `%s' provides: %s\nand requires: %s"
+ file
+ (mapconcat #'apropos-library-button
+ (or provides '(nil)) " and ")
+ (mapconcat #'apropos-library-button
+ (or requires '(nil)) " and ")))))
+ (if (null symbols)
+ (with-output-to-temp-buffer "*Apropos*"
+ (with-current-buffer standard-output
+ (apropos-mode)
+ (apropos--preamble text)))
+ (apropos-symbols-internal symbols apropos-do-all text)))))
(defun apropos-symbols-internal (symbols keys &optional text)
;; Filter out entries that are marked as apropos-inhibit.
symbol item)
(set-buffer standard-output)
(apropos-mode)
- (insert (substitute-command-keys "Type \\[apropos-follow] on ")
- (if apropos-multi-type "a type label" "an entry")
- " to view its full documentation.\n\n")
- (if text (insert text "\n\n"))
+ (apropos--preamble text)
(dolist (apropos-item p)
(when (and spacing (not (bobp)))
(princ spacing))
(fill-region opoint (point) nil t)))
(or (bolp) (terpri)))))
+(defun apropos--preamble (text)
+ (let ((inhibit-read-only t))
+ (insert (substitute-command-keys "Type \\[apropos-follow] on ")
+ (if apropos-multi-type "a type label" "an entry")
+ " to view its full documentation.\n\n")
+ (when text
+ (insert text "\n\n"))))
+
(defun apropos-follow ()
"Invokes any button at point, otherwise invokes the nearest label button."
(interactive)