Mercurial > emacs
comparison lisp/emacs-lisp/eldoc.el @ 16385:2b768a1e4f5f
(eldoc-function-argstring-from-docstring): Add search that finds arglist
for `start-process'; possibly others.
author | Noah Friedman <friedman@splode.com> |
---|---|
date | Fri, 04 Oct 1996 04:43:42 +0000 |
parents | 27e6b6f4f1b6 |
children | 436fd36233d1 |
comparison
equal
deleted
inserted
replaced
16384:4ec13b05b0fa | 16385:2b768a1e4f5f |
---|---|
9 ;; Created: 1995-10-06 | 9 ;; Created: 1995-10-06 |
10 | 10 |
11 ;; LCD Archive Entry: | 11 ;; LCD Archive Entry: |
12 ;; eldoc|Noah Friedman|friedman@prep.ai.mit.edu| | 12 ;; eldoc|Noah Friedman|friedman@prep.ai.mit.edu| |
13 ;; show function arglist or variable docstring in echo area| | 13 ;; show function arglist or variable docstring in echo area| |
14 ;; $Date: 1995/11/25 03:45:25 $|$Revision: 1.5 $|~/misc/eldoc.el.gz| | 14 ;; $Date: 1996/07/14 16:46:25 $|$Revision: 1.6 $|~/misc/eldoc.el.gz| |
15 | 15 |
16 ;; $Id: eldoc.el,v 1.5 1995/11/25 03:45:25 friedman Exp friedman $ | 16 ;; $Id: eldoc.el,v 1.6 1996/07/14 16:46:25 friedman Exp friedman $ |
17 | 17 |
18 ;; This program is free software; you can redistribute it and/or modify | 18 ;; This program is free software; you can redistribute it and/or modify |
19 ;; it under the terms of the GNU General Public License as published by | 19 ;; it under the terms of the GNU General Public License as published by |
20 ;; the Free Software Foundation; either version 2, or (at your option) | 20 ;; the Free Software Foundation; either version 2, or (at your option) |
21 ;; any later version. | 21 ;; any later version. |
317 (let ((docstring (documentation fn 'raw)) | 317 (let ((docstring (documentation fn 'raw)) |
318 (doc nil) | 318 (doc nil) |
319 (doclist nil) | 319 (doclist nil) |
320 (end nil)) | 320 (end nil)) |
321 (save-match-data | 321 (save-match-data |
322 ;; TODO: Move these into a separate table that is iterated over until | |
323 ;; a match is found. | |
322 (cond | 324 (cond |
323 ;; Try first searching for args starting with symbol name. | 325 ;; Try first searching for args starting with symbol name. |
324 ;; This is to avoid matching parenthetical remarks in e.g. sit-for. | 326 ;; This is to avoid matching parenthetical remarks in e.g. sit-for. |
325 ((string-match (format "^(%s[^\n)]*)$" fn) docstring) | 327 ((string-match (format "^(%s[^\n)]*)$" fn) docstring) |
326 ;; end does not include trailing ")" sequence. | 328 ;; end does not include trailing ")" sequence. |
371 ((string-match (format "^[ \t]+\\((%s[^\n)]*)\\)$" fn) docstring) | 373 ((string-match (format "^[ \t]+\\((%s[^\n)]*)\\)$" fn) docstring) |
372 ;; end does not include trailing ")" sequence. | 374 ;; end does not include trailing ")" sequence. |
373 (setq end (- (match-end 1) 1)) | 375 (setq end (- (match-end 1) 1)) |
374 (if (string-match " +" docstring (match-beginning 1)) | 376 (if (string-match " +" docstring (match-beginning 1)) |
375 (setq doc (substring docstring (match-end 0) end)) | 377 (setq doc (substring docstring (match-end 0) end)) |
376 (setq doc "")))) | 378 (setq doc ""))) |
379 | |
380 ;; This finds the argstring for `start-process'. | |
381 ;; I don't know if there are any others with the same pattern. | |
382 ((string-match "^Args are +\\([^\n]+\\)$" docstring) | |
383 (setq doc (substring docstring (match-beginning 1) (match-end 1)))) | |
384 ) | |
377 | 385 |
378 (cond ((not (stringp doc)) | 386 (cond ((not (stringp doc)) |
379 nil) | 387 nil) |
380 ((string-match "&" doc) | 388 ((string-match "&" doc) |
381 (let ((p 0) | 389 (let ((p 0) |