summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/eldoc.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2007-08-08 08:14:03 +0000
committerGlenn Morris <rgm@gnu.org>2007-08-08 08:14:03 +0000
commit4b4a23c4663c67e756cd45cdb80569a201e26afc (patch)
treed4e24ecb1e25c3d57ee931cfe3f77348a9241102 /lisp/emacs-lisp/eldoc.el
parenta3fcbf6c3bef39282d1dacc88b66f169a4035ec5 (diff)
(eldoc-get-fnsym-args-string): Make second argument optional, for
backwards compatibility, and only highlight args when present. Fix symbol name typo (doc/args).
Diffstat (limited to 'lisp/emacs-lisp/eldoc.el')
-rw-r--r--lisp/emacs-lisp/eldoc.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index c1bc6dae51..2ff273ebab 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -267,13 +267,13 @@ Emacs Lisp mode) that support Eldoc.")
;; Return a string containing the function parameter list, or 1-line
;; docstring if function is a subr and no arglist is obtainable from the
;; docstring or elsewhere.
-(defun eldoc-get-fnsym-args-string (sym argument-index)
+(defun eldoc-get-fnsym-args-string (sym &optional argument-index)
(let ((args nil)
(doc nil))
(cond ((not (and sym (symbolp sym) (fboundp sym))))
((and (eq sym (aref eldoc-last-data 0))
(eq 'function (aref eldoc-last-data 2)))
- (setq args (aref eldoc-last-data 1)))
+ (setq doc (aref eldoc-last-data 1)))
((setq doc (help-split-fundoc (documentation sym t) sym))
(setq args (car doc))
(string-match "\\`[^ )]* ?" args)
@@ -281,8 +281,9 @@ Emacs Lisp mode) that support Eldoc.")
(eldoc-last-data-store sym args 'function))
(t
(setq args (eldoc-function-argstring sym))))
- (when args
- (setq doc (eldoc-highlight-function-argument sym args argument-index)))
+ (and args
+ argument-index
+ (setq doc (eldoc-highlight-function-argument sym args argument-index)))
doc))
;; Highlight argument INDEX in ARGS list for SYM.