X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/863666ebae563a9a83dd8bce54227dfd6f66987d..4fa60c545d251de8a3ad73afbed78ffc7a2f3489:/lisp/help-fns.el?ds=sidebyside diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 7dc7eebb06..178096d102 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1,7 +1,7 @@ ;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*- -;; Copyright (C) 1985-1986, 1993-1994, 1998-2012 -;; Free Software Foundation, Inc. +;; Copyright (C) 1985-1986, 1993-1994, 1998-2013 Free Software +;; Foundation, Inc. ;; Maintainer: FSF ;; Keywords: help, internal @@ -76,7 +76,7 @@ DEF is the function whose usage we're looking for in DOCSTRING." (when (and docstring (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" docstring)) (cons (format "(%s%s" ;; Replace `fn' with the actual function name. - (if (consp def) "anonymous" def) + (if (symbolp def) def "anonymous") (match-string 1 docstring)) (unless (zerop (match-beginning 0)) (substring docstring 0 (match-beginning 0)))))) @@ -494,8 +494,7 @@ suitable file is found, return nil." (use (car obsolete))) (when obsolete (insert "\nThis " - (if (eq (car-safe (symbol-function 'with-current-buffer)) - 'macro) + (if (eq (car-safe (symbol-function function)) 'macro) "macro" "function") " is obsolete") @@ -616,13 +615,11 @@ FILE is the file where FUNCTION was probably defined." (point))) (terpri)(terpri) - (let* ((doc-raw (condition-case err - (documentation function t) - (error (format "No Doc! %S" err)))) + (let* ((doc-raw (documentation function t)) ;; If the function is autoloaded, and its docstring has ;; key substitution constructs, load the library. (doc (progn - (and (autoloadp real-def) + (and (autoloadp real-def) doc-raw help-enable-auto-load (string-match "\\([^\\]=\\|[^=]\\|\\`\\)\\\\[[{<]" doc-raw) @@ -792,7 +789,7 @@ it is displayed along with the global value." (cond ((bufferp locus) (princ (format "Local in buffer %s; " - (buffer-name)))) + (buffer-name buffer)))) ((framep locus) (princ (format "It is a frame-local variable; "))) ((terminal-live-p locus) @@ -850,12 +847,10 @@ it is displayed along with the global value." (obsolete (get variable 'byte-obsolete-variable)) (use (car obsolete)) (safe-var (get variable 'safe-local-variable)) - (doc (condition-case err - (or (documentation-property - variable 'variable-documentation) - (documentation-property - alias 'variable-documentation)) - (error (format "Doc not found: %S" err)))) + (doc (or (documentation-property + variable 'variable-documentation) + (documentation-property + alias 'variable-documentation))) (extra-line nil)) ;; Mention if it's a local variable.