Function: elisp-get-fnsym-args-string

elisp-get-fnsym-args-string is a byte-compiled function defined in elisp-mode.el.gz.

Signature

(elisp-get-fnsym-args-string SYM &optional INDEX)

Documentation

Return a string containing the parameter list of the function SYM.

INDEX is the index of the parameter in the returned string to highlight. If SYM is a subr and no arglist is obtainable from the docstring or elsewhere, return a 1-line docstring.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/elisp-mode.el.gz
(defun elisp-get-fnsym-args-string (sym &optional index)
  "Return a string containing the parameter list of the function SYM.
INDEX is the index of the parameter in the returned string to highlight.
If SYM is a subr and no arglist is obtainable from the docstring
or elsewhere, return a 1-line docstring."
  (let ((argstring
	 (cond
	  ((not (and sym (symbolp sym) (fboundp sym))) nil)
	  ((and (eq sym (aref elisp--eldoc-last-data 0))
		(eq 'function (aref elisp--eldoc-last-data 2)))
	   (aref elisp--eldoc-last-data 1))
	  (t
	   (let* ((advertised (get-advertised-calling-convention
                               (indirect-function sym)))
                  doc
		  (args
		   (cond
		    ((listp advertised) advertised)
		    ((setq doc (help-split-fundoc
				(condition-case nil (documentation sym t)
				  (invalid-function nil))
				sym))
		     (substitute-command-keys (car doc)))
		    (t (help-function-arglist sym)))))
             ;; Stringify, and store before highlighting, downcasing, etc.
	     (elisp--last-data-store sym (elisp-function-argstring args)
                                     'function))))))
    ;; Highlight
    (if argstring
	(elisp--highlight-function-argument
         sym argstring index))))