X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/773e1f087264966e61d4364520452822c6d763c4..d75ffb4ed0b2e72a9361a07d16a5c884a9459728:/lisp/help-mode.el diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 88b5e095cf..9924300647 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -30,7 +30,6 @@ ;;; Code: (require 'button) -(require 'view) (eval-when-compile (require 'easymenu)) (defvar help-mode-map @@ -266,6 +265,15 @@ The format is (FUNCTION ARGS...).") :supertype 'help-xref 'help-function 'customize-create-theme 'help-echo (purecopy "mouse-2, RET: edit this theme file")) + +(define-button-type 'help-dir-local-var-def + :supertype 'help-xref + 'help-function (lambda (var &optional file) + ;; FIXME: this should go to the point where the + ;; local variable was defined. + (find-file file)) + 'help-echo (purecopy "mouse-2, RET: open directory-local variables file")) + (defvar bookmark-make-record-function) @@ -288,10 +296,7 @@ Commands: ;;;###autoload (defun help-mode-finish () (when (eq major-mode 'help-mode) - ;; View mode's read-only status of existing *Help* buffer is lost - ;; by with-output-to-temp-buffer. - (toggle-read-only 1) - + (setq buffer-read-only t) (save-excursion (goto-char (point-min)) (let ((inhibit-read-only t)) @@ -500,14 +505,14 @@ that." ((and (or (boundp sym) (get sym 'variable-documentation)) - (or - (documentation-property - sym 'variable-documentation) - (condition-case nil + (condition-case err + (or + (documentation-property + sym 'variable-documentation) (documentation-property (indirect-variable sym) - 'variable-documentation) - (cyclic-variable-indirection nil)))) + 'variable-documentation)) + (error (message "No doc found: %S" err) nil))) (help-xref-button 8 'help-variable sym)) ((fboundp sym) (help-xref-button 8 'help-function sym))))))) @@ -808,9 +813,8 @@ Implements `bookmark-make-record-function' for help-mode buffers." (unless (car help-xref-stack-item) (error "Cannot create bookmark - help command not known")) `(,@(bookmark-make-record-default 'NO-FILE 'NO-CONTEXT) - (buffer-name . "*Help*") (help-fn . ,(car help-xref-stack-item)) - (help-arg . ,(cadr help-xref-stack-item)) + (help-args . ,(cdr help-xref-stack-item)) (position . ,(point)) (handler . help-bookmark-jump))) @@ -819,10 +823,10 @@ Implements `bookmark-make-record-function' for help-mode buffers." "Jump to help-mode bookmark BOOKMARK. Handler function for record returned by `help-bookmark-make-record'. BOOKMARK is a bookmark name or a bookmark record." - (let ((help-fn (bookmark-prop-get bookmark 'help-fn)) - (help-arg (bookmark-prop-get bookmark 'help-arg)) - (position (bookmark-prop-get bookmark 'position))) - (funcall help-fn help-arg) + (let ((help-fn (bookmark-prop-get bookmark 'help-fn)) + (help-args (bookmark-prop-get bookmark 'help-args)) + (position (bookmark-prop-get bookmark 'position))) + (apply help-fn help-args) (pop-to-buffer "*Help*") (goto-char position)))