diff options
author | John Paul Wallington <jpw@pobox.com> | 2003-01-03 11:46:20 +0000 |
---|---|---|
committer | John Paul Wallington <jpw@pobox.com> | 2003-01-03 11:46:20 +0000 |
commit | 2dba57c18e7e941b0d01bd7890a6cd0154e021e4 (patch) | |
tree | 743a2550e407efc127d7abe8e9aea7f02756af25 /lisp/emacs-lisp/eldoc.el | |
parent | 7413b888c02a4de594d76045cde31a5a80e7902e (diff) |
(eldoc-get-var-docstring): Only return a
documentation string when `sym' is non-nil.
Diffstat (limited to 'lisp/emacs-lisp/eldoc.el')
-rw-r--r-- | lisp/emacs-lisp/eldoc.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index ea09720db2..b40ffc0afb 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -7,7 +7,7 @@ ;; Keywords: extensions ;; Created: 1995-10-06 -;; $Id: eldoc.el,v 1.20 2002/01/08 23:57:30 rms Exp $ +;; $Id: eldoc.el,v 1.21 2002/11/19 23:32:54 monnier Exp $ ;; This file is part of GNU Emacs. @@ -327,16 +327,17 @@ With prefix ARG, turn ElDoc mode on if and only if ARG is positive." ;; Return a string containing a brief (one-line) documentation string for ;; the variable. (defun eldoc-get-var-docstring (sym) - (cond ((and (eq sym (aref eldoc-last-data 0)) - (eq 'variable (aref eldoc-last-data 2))) - (aref eldoc-last-data 1)) - (t - (let ((doc (documentation-property sym 'variable-documentation t))) - (cond (doc - (setq doc (eldoc-docstring-format-sym-doc - sym (eldoc-docstring-first-line doc))) - (eldoc-last-data-store sym doc 'variable))) - doc)))) + (when sym + (cond ((and (eq sym (aref eldoc-last-data 0)) + (eq 'variable (aref eldoc-last-data 2))) + (aref eldoc-last-data 1)) + (t + (let ((doc (documentation-property sym 'variable-documentation t))) + (cond (doc + (setq doc (eldoc-docstring-format-sym-doc + sym (eldoc-docstring-first-line doc))) + (eldoc-last-data-store sym doc 'variable))) + doc))))) (defun eldoc-last-data-store (symbol doc type) (aset eldoc-last-data 0 symbol) |