diff options
| author | Glenn Morris | 2007-08-08 08:14:03 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-08-08 08:14:03 +0000 |
| commit | 4b4a23c4663c67e756cd45cdb80569a201e26afc (patch) | |
| tree | d4e24ecb1e25c3d57ee931cfe3f77348a9241102 | |
| parent | a3fcbf6c3bef39282d1dacc88b66f169a4035ec5 (diff) | |
| download | emacs-4b4a23c4663c67e756cd45cdb80569a201e26afc.tar.gz emacs-4b4a23c4663c67e756cd45cdb80569a201e26afc.zip | |
(eldoc-get-fnsym-args-string): Make second argument optional, for
backwards compatibility, and only highlight args when present.
Fix symbol name typo (doc/args).
| -rw-r--r-- | lisp/emacs-lisp/eldoc.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index c1bc6dae515..2ff273ebab3 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el | |||
| @@ -267,13 +267,13 @@ Emacs Lisp mode) that support Eldoc.") | |||
| 267 | ;; Return a string containing the function parameter list, or 1-line | 267 | ;; Return a string containing the function parameter list, or 1-line |
| 268 | ;; docstring if function is a subr and no arglist is obtainable from the | 268 | ;; docstring if function is a subr and no arglist is obtainable from the |
| 269 | ;; docstring or elsewhere. | 269 | ;; docstring or elsewhere. |
| 270 | (defun eldoc-get-fnsym-args-string (sym argument-index) | 270 | (defun eldoc-get-fnsym-args-string (sym &optional argument-index) |
| 271 | (let ((args nil) | 271 | (let ((args nil) |
| 272 | (doc nil)) | 272 | (doc nil)) |
| 273 | (cond ((not (and sym (symbolp sym) (fboundp sym)))) | 273 | (cond ((not (and sym (symbolp sym) (fboundp sym)))) |
| 274 | ((and (eq sym (aref eldoc-last-data 0)) | 274 | ((and (eq sym (aref eldoc-last-data 0)) |
| 275 | (eq 'function (aref eldoc-last-data 2))) | 275 | (eq 'function (aref eldoc-last-data 2))) |
| 276 | (setq args (aref eldoc-last-data 1))) | 276 | (setq doc (aref eldoc-last-data 1))) |
| 277 | ((setq doc (help-split-fundoc (documentation sym t) sym)) | 277 | ((setq doc (help-split-fundoc (documentation sym t) sym)) |
| 278 | (setq args (car doc)) | 278 | (setq args (car doc)) |
| 279 | (string-match "\\`[^ )]* ?" args) | 279 | (string-match "\\`[^ )]* ?" args) |
| @@ -281,8 +281,9 @@ Emacs Lisp mode) that support Eldoc.") | |||
| 281 | (eldoc-last-data-store sym args 'function)) | 281 | (eldoc-last-data-store sym args 'function)) |
| 282 | (t | 282 | (t |
| 283 | (setq args (eldoc-function-argstring sym)))) | 283 | (setq args (eldoc-function-argstring sym)))) |
| 284 | (when args | 284 | (and args |
| 285 | (setq doc (eldoc-highlight-function-argument sym args argument-index))) | 285 | argument-index |
| 286 | (setq doc (eldoc-highlight-function-argument sym args argument-index))) | ||
| 286 | doc)) | 287 | doc)) |
| 287 | 288 | ||
| 288 | ;; Highlight argument INDEX in ARGS list for SYM. | 289 | ;; Highlight argument INDEX in ARGS list for SYM. |