;; Maintainer: FSF
;; Keywords: help, internal
+;; Package: emacs
;; This file is part of GNU Emacs.
(message "Unable to find location in file"))))
'help-echo (purecopy "mouse-2, RET: find face's definition"))
+(define-button-type 'help-package
+ :supertype 'help-xref
+ 'help-function 'describe-package
+ 'help-echo (purecopy "mouse-2, RET: Describe package"))
+
+(define-button-type 'help-package-def
+ :supertype 'help-xref
+ 'help-function (lambda (file) (dired file))
+ 'help-echo (purecopy "mouse-2, RET: visit package directory"))
+
\f
;;;###autoload
(defun help-mode ()
(with-current-buffer buffer
(bury-buffer))))
+ (set (make-local-variable 'revert-buffer-function)
+ 'help-mode-revert-buffer)
+
(run-mode-hooks 'help-mode-hook))
;;;###autoload
(let ((data (match-string 2)))
(save-match-data
(unless (string-match "^([^)]+)" data)
- (setq data (concat "(emacs)" data))))
+ (setq data (concat "(emacs)" data)))
+ (setq data ;; possible newlines if para filled
+ (replace-regexp-in-string "[ \t\n]+" " " data t t)))
(help-xref-button 2 'help-info data))))
;; URLs
(save-excursion
(fboundp sym) (facep sym))
(help-do-xref pos #'help-xref-interned (list sym)))))
+(defun help-mode-revert-buffer (ignore-auto noconfirm)
+ (when (or noconfirm (yes-or-no-p "Revert help buffer? "))
+ (let ((pos (point))
+ (item help-xref-stack-item)
+ ;; Pretend there is no current item to add to the history.
+ (help-xref-stack-item nil)
+ ;; Use the current buffer.
+ (help-xref-following t))
+ (apply (car item) (cdr item))
+ (goto-char pos))))
+
(defun help-insert-string (string)
"Insert STRING to the help buffer and install xref info for it.
This function can be used to restore the old contents of the help buffer