# HG changeset patch # User Glenn Morris # Date 1186560843 0 # Node ID 694f889fbd90b723e9f094d1d7ccd592a8b18360 # Parent 6187a43977b4bd0dbeb2317119fb2d340ccc6627 (eldoc-get-fnsym-args-string): Make second argument optional, for backwards compatibility, and only highlight args when present. Fix symbol name typo (doc/args). diff -r 6187a43977b4 -r 694f889fbd90 lisp/emacs-lisp/eldoc.el --- a/lisp/emacs-lisp/eldoc.el Wed Aug 08 08:13:41 2007 +0000 +++ b/lisp/emacs-lisp/eldoc.el Wed Aug 08 08:14:03 2007 +0000 @@ -267,13 +267,13 @@ ;; 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 @@ (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.